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

Closed
opened 2026-10-17 11:42:14 +00:00 by screamm · 6 comments
screamm commented 2026-10-17 11:42:14 +00:00 (Migrated from github.com)
Contributor

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

  • GPU: NVIDIA GeForce RTX 4070 (10de:2786), driver 596.21, Vulkan
  • OS: Windows 11 Pro 26220
  • Compiler: WinLibs GCC 15.2.0 r7, Release, BUILD_TESTING=ON
  • main at ca82d7d882 (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 300 fails 3 of 3, in about 1-2 s each, with the same message:

AGC graphics: v_fma_f16 without a known float mode of 0x7c00, 0x0000, 0x0000 is 0x7fff, expected 0xfe00

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):

AGC graphics: 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

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. float16Ternary in core/shader/recompiler/Translation/src/FloatInstructions.cpp does 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.

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5897960002 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/7100). Originally posted by [screamm](https://github.com/screamm) on 2026-10-17T11:42:14Z. --- **Title ID:** not applicable, this is a test failure on current `main`. **Environment** - GPU: NVIDIA GeForce RTX 4070 (10de:2786), driver 596.21, Vulkan - OS: Windows 11 Pro 26220 - Compiler: WinLibs GCC 15.2.0 r7, Release, `BUILD_TESTING=ON` - `main` at ca82d7d882b0ac17d955f6e107fe2eb0cae244af (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 300` fails 3 of 3, in about 1-2 s each, with the same message: AGC graphics: v_fma_f16 without a known float mode of 0x7c00, 0x0000, 0x0000 is 0x7fff, expected 0xfe00 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): AGC graphics: 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 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. `float16Ternary` in `core/shader/recompiler/Translation/src/FloatInstructions.cpp` does 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.
akkadbakkad89 commented 2026-10-17 11:46:18 +00:00 (Migrated from github.com)
Author
Contributor

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 at v_fma_f16 ... is 0x7fff, expected 0xfe00
  • agc_driver_fma_mix_f16_denormal_modes: fails at v_fma_mix_f32 ... is 0x7fffffff, expected 0xffc00000

Taking 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/SameHalf in Float16ResultModifiers.cpp). Bit-exact comparison is preserved for every non-NaN expectation, so the denormal-mode coverage is unchanged. The alternative (canonicalising NaN in float16Ternary) would be a production change to emitted code; if a console NaN convention ever gets documented that can be a separate PR.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6233506572 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/7100#issuecomment-6233506572). Originally posted by [akkadbakkad89](https://github.com/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 at `v_fma_f16 ... is 0x7fff, expected 0xfe00` - `agc_driver_fma_mix_f16_denormal_modes`: fails at `v_fma_mix_f32 ... is 0x7fffffff, expected 0xffc00000` Taking 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`/`SameHalf` in Float16ResultModifiers.cpp). Bit-exact comparison is preserved for every non-NaN expectation, so the denormal-mode coverage is unchanged. The alternative (canonicalising NaN in `float16Ternary`) would be a production change to emitted code; if a console NaN convention ever gets documented that can be a separate PR.
milescoviello commented 2026-10-17 11:48:36 +00:00 (Migrated from github.com)
Author
Contributor

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, main e09dbc2b42, 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 0xfe00
  • agc_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)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6233525905 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/7100#issuecomment-6233525905). Originally posted by [milescoviello](https://github.com/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, `main` e09dbc2b42, 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 0xfe00` - `agc_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)
MarcZX10 commented 2026-10-17 21:09:27 +00:00 (Migrated from github.com)
Author
Contributor

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.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6241132945 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/7100#issuecomment-6241132945). Originally posted by [MarcZX10](https://github.com/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.
KauaSantos702 commented 2026-10-18 00:30:45 +00:00 (Migrated from github.com)
Author
Contributor

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).

  • NVIDIA GeForce RTX 5070 (Blackwell), driver 32.0.16.1714, Windows 11
  • WinLibs GCC 15.2.0 r7, Release, BUILD_TESTING=ON
  • ctest -R '^agc_driver_(f16_fma_denormal_modes|fma_mix_f16_denormal_modes)$' -j1 --repeat until-fail:3
Test Result
agc_driver_f16_fma_denormal_modes 3/3 passed
agc_driver_fma_mix_f16_denormal_modes 3/3 passed

With 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.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6243744955 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/7100#issuecomment-6243744955). Originally posted by [KauaSantos702](https://github.com/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). - NVIDIA GeForce RTX 5070 (Blackwell), driver 32.0.16.1714, Windows 11 - WinLibs GCC 15.2.0 r7, Release, `BUILD_TESTING=ON` - `ctest -R '^agc_driver_(f16_fma_denormal_modes|fma_mix_f16_denormal_modes)$' -j1 --repeat until-fail:3` | Test | Result | |---|---| | `agc_driver_f16_fma_denormal_modes` | 3/3 passed | | `agc_driver_fma_mix_f16_denormal_modes` | 3/3 passed | With 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.
MarcZX10 commented 2026-10-18 01:52:39 +00:00 (Migrated from github.com)
Author
Contributor

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.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6244444863 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/7100#issuecomment-6244444863). Originally posted by [MarcZX10](https://github.com/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.
oneandonlydean commented 2026-10-18 02:55:40 +00:00 (Migrated from github.com)
Author
Contributor

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.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6244937812 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/7100#issuecomment-6244937812). Originally posted by [oneandonlydean](https://github.com/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.
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5#7100
No description provided.