test: agc_driver_f16_fma_denormal_modes and agc_driver_fma_mix_f16_denormal_modes fail on NVIDIA (NaN sign/payload differs from the AMD table) #7100
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by screamm on 2026-10-17T11:42:14Z.
Title ID: not applicable, this is a test failure on current
main.Environment
BUILD_TESTING=ONmainatca82d7d882(plain checkout, no extra patches)Result
ctest --test-dir build -R '^agc_driver_f16_fma_denormal_modes$' --output-on-failure --repeat until-pass:3 --timeout 300fails 3 of 3, in about 1-2 s each, with the same message:In the full
-R '^agc_driver_'pass (488 tests) this test and one more fail, 484 pass, 2 skip. The second failure (3 of 3 as well):All other f16 tests pass, including the ones from #7021, #7030 and #7031.
What it is
Introduced by #7034 (
agc_driver_f16_fma_denormal_modes, merged 2026-10-17 07:52 UTC) and #7040 (agc_driver_fma_mix_f16_denormal_modes). Both tests compare raw result bits for an invalid operation (inf * 0 + x), whose result is a NaN. The expected tables were measured on an AMD GPU (RX 6700 XT) and contain the AMD default NaN (0xfe00 for f16, 0xffc00000 for f32). This GPU returns the NVIDIA canonical NaN (0x7fff, 0x7fffffff). Both are NaNs; only sign and payload differ.float16Ternaryincore/shader/recompiler/Translation/src/FloatInstructions.cppdoes not canonicalise the NaN, so the bits come from the GPU's FMA. The test stops at the first mismatch, so I do not know whether later rows would also differ.Other reports
Amoenus reported the same first assertion on an RTX 5080 (3 of 3) in a comment on #7034, with a Radeon passing 3 of 3. The PR author (RX 6700 XT) and a Radeon 860M pass. The #7034 CI skipped the build and test jobs, so no CI run covers these tests on a GPU. The PR "Tested" section lists NVIDIA as not tested.
Not checked
No fix attempted; whether the right fix is to canonicalise NaNs in the recompiler or to accept any NaN in the tests is a maintainer decision. Other NVIDIA drivers, Intel and the PS5 hardware are untested.
Written with Claude Code assistance.
Imported from boykopovar/AnyPS5. Originally posted by akkadbakkad89 on 2026-10-17T11:46:18Z.
Reproduced on a third NVIDIA device: RTX 3070 (driver 617.42), Windows 11, WinLibs GCC 15.2.0, Release, main
e09dbc2b4, serial fresh processes:agc_driver_f16_fma_denormal_modes: fails atv_fma_f16 ... is 0x7fff, expected 0xfe00agc_driver_fma_mix_f16_denormal_modes: fails atv_fma_mix_f32 ... is 0x7fffffff, expected 0xffc00000Taking it. I'll keep the scope test-side per the "either NaN is valid" framing: when the expected word is NaN, accept any NaN encoding in the result — the suite already uses this idiom (
IsNan16/SameHalfin Float16ResultModifiers.cpp). Bit-exact comparison is preserved for every non-NaN expectation, so the denormal-mode coverage is unchanged. The alternative (canonicalising NaN infloat16Ternary) would be a production change to emitted code; if a console NaN convention ever gets documented that can be a separate PR.Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-17T11:48:36Z.
Same on Linux, so it isn't Windows-specific. RTX 4070 Ti, NVIDIA 595.99.02, Ubuntu 24.04, GCC 13.3, Release,
maine09dbc2b42, 3 of 3 each:agc_driver_f16_fma_denormal_modes:v_fma_f16 without a known float mode of 0x7c00, 0x0000, 0x0000 is 0x7fff, expected 0xfe00agc_driver_fma_mix_f16_denormal_modes:v_fma_mix_f32 of three f16 sources f32 denormals flushed, f16 denormal mode 0, IEEE mode off of 0x00007c00, 0x00000001, 0x3f800000 is 0x7fffffff, expected 0xffc00000@thuanquang, would you like to adjust the tests? One option is to require only a NaN wherever the AMD table holds a NaN, since Vulkan leaves the NaN payload to the device. Or should the recompiler produce AMD's default NaN instead? If you'd rather I took the test-side change, I can.
AI-assisted: yes (Claude Code)
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-17T21:09:27Z.
The test-only fix is merged as #7093. It accepts any NaN encoding only for expected NaN cases and keeps bit-exact checks for non-NaN rows. The independent RTX 5080, RTX 3070, Radeon 610M/RADV and lavapipe runs posted on #7093 confirm both failing tests pass with that change. This appears addressed on current
main; please close the issue if you agree.Imported from boykopovar/AnyPS5. Originally posted by KauaSantos702 on 2026-10-18T00:30:45Z.
One more NVIDIA generation for #7093: on Blackwell, both tests pass 3/3 on current
main(b4f05ab32, which includes #7093).BUILD_TESTING=ONctest -R '^agc_driver_(f16_fma_denormal_modes|fma_mix_f16_denormal_modes)$' -j1 --repeat until-fail:3agc_driver_f16_fma_denormal_modesagc_driver_fma_mix_f16_denormal_modesWith the RTX 3070, 4070, 4070 Ti and 5080 results above, that covers Ampere, Ada and Blackwell. From the NVIDIA side, this issue looks ready to close.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-18T01:52:39Z.
Thanks for the Blackwell result. PR #7093 is merged, and the two previously failing tests pass 3/3 on an RTX 5070 as well. Together with the reported Ampere and Ada results, the NVIDIA NaN-payload failure is covered; I am closing this issue as addressed by #7093.
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-18T02:55:40Z.
Fixed by #7093 (
32f28a462); the two tests pass on RTX 5080, 5070, 3070, Radeon 610M and lavapipe. Closing.