Skip to content

test(shader): cover packed half minmax NaN classification - #2314

Closed
JulioCacko wants to merge 1 commit into
boykopovar:mainfrom
JulioCacko:contrib/packed-fp16-minmax-regression
Closed

JulioCacko wants to merge 1 commit into
boykopovar:mainfrom
JulioCacko:contrib/packed-fp16-minmax-regression

Conversation

@JulioCacko

Copy link
Copy Markdown
Contributor

What

Add exact Vulkan regression expectations for packed FP16 min/max with quiet/signalling NaNs in both operands and signs, signed zero, infinity, and ordinary finite values. Explicitly enable IEEE_MODE for cases requiring NaN priority, instead of assuming the default shader mode.

The local investigation found that checking exponent bits with 0x7c00 instead of including the quiet bit (0x7e00) misclassifies 1,022 quiet-NaN patterns across both signs. Current upstream already contains that mask correction in TranslationContext::packedFloat16; this PR contributes regression coverage only. Expected behavior follows the existing upstream packed min/max implementation and float-mode handling; this is not an independent RDNA2 hardware-oracle measurement.

Related startup investigation: zero-stride descriptor handling was validated locally using TideOPL's existing PR #1769. Its implementation is excluded from our contributions and remains credited to that PR. Conversion, Vulkan initialization and shader test output do not establish Demon's Souls menus, gameplay, or Gold status.

Tested

Windows 11 x64, MinGW GCC, RelWithDebInfo, NVIDIA GeForce RTX 3070. Focused build passed; agc_driver_float16_misc passed 1/1 (1.65 s) with ANYPS5_REQUIRE_VULKAN=1, no skip. The branch/title/body conventions check passed. Built and tested with the integrated contribution set on upstream d70b8998; this branch changes only the FP16 test. This validates the recompiled output on the host GPU, not original RDNA2 instruction execution on an AMD hardware oracle.

Checklist

  • Based on current main; open-PR overlap checked before submission
  • One topic per PR
  • No new code comments or investigation files in the repository
  • Tests only; no shader instruction semantics changed
  • Depends on: none
  • AI-assisted: yes; reviewed and submitted by the author

@github-actions github-actions Bot added the agc libSceAgc* label Oct 9, 2026
@Kikoarl

Kikoarl commented Oct 9, 2026

Copy link
Copy Markdown
Contributor

Tested on Linux (CachyOS x86_64, Intel RPL-S iGPU / Mesa 26.3.0-devel / Vulkan 1.4.363, GCC 16.2.1) at d1f0919f:

  • Build: Built cleanly in RAM (/tmp/anyps5_build) with zero warnings/errors.
  • Conventions: python3 tools/check_conventions.py --base origin/main --head HEAD -> PASS (0 errors).
  • Verification: Verified Float16Misc.cpp test suite. Verifies IEEE 754 NaN propagation and hardware min/max semantics for packed half-precision operations.

LGTM!

@oneandonlydean

Copy link
Copy Markdown
Collaborator

Closing: the expected values come from main's own implementation, so the test passes on main and doesn't check the hardware behaviour. A test measured on hardware would be welcome.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

agc libSceAgc*

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants