exec_vop/rdna2_silicon (new in #191): fails 33 of 480 cases with TOMBOX_EXEC_HW=1 on an RTX 3080, all NaN results of the f16 FMA family #194

Closed
opened 2026-11-26 06:13:21 +00:00 by github-bot · 1 comment
Owner

@⁠kiwe147 on GitHub · 2026-11-23 00:25 UTC · original

On main c4b7607, vop::rdna2_silicon::rdna2_silicon_results passes on WARP and fails when the exec suite runs on a real GPU:

TOMBOX_EXEC_HW=1 cargo test --locked -p tombox-xshader --test exec rdna2_silicon
rdna2_silicon: 12 mnemonics verified, 3 failing, 480 cases
rdna2_silicon: 33 failing cases

2 of 2 runs on c4b7607 fail, and the same 33 cases fail on the head of #191 alone. Without TOMBOX_EXEC_HW (WARP) it passes (1 passed). The rest of the exec and isa_sweep suites pass on this GPU in hardware mode (109 passed, 0 failed, 2 ignored on baadb80, before #191 was in).

All 33 failing cases are v_fmac_f16 (15), v_fmaak_f16 (11) and v_fmamk_f16 (7), and in every one the expected result is a NaN. The GPU returns 0x7fff in the low half; the silicon record has the payload and sign of the input NaN, for example:

#1  v_fmac_f16: got [9dfb7fff] want [9dfbfe00]
#2  v_fmac_f16: got [63017fff] want [63017e00]
#9  v_fmac_f16: got [c1ac7fff] want [c1ac7e01]

So the numbers match everywhere except the NaN bit pattern (the NVIDIA GPU returns an all-ones-mantissa quiet NaN, 0x7fff, where gfx1036 keeps 0xfe00, 0x7e00 or 0x7e01). The other 447 cases and the other 9 mnemonics of the test match.

This looks like a property of the GPU running the test, not a translator bug: the test checks the translator against recorded AMD silicon, and another vendor's GPU does not reproduce AMD's NaN payload. Possible directions, your call: compare NaN results as a class (any NaN) when TOMBOX_EXEC_HW is set, or leave the NaN cases for the WARP run only. I have not looked at what other exec tests do for NaN payloads.

I did not test other NVIDIA generations or an AMD GPU, so I do not know whether the RTX 4070 Ti in #188 gives the same result.

Setup: Windows 11 Pro 10.0.26200, NVIDIA GeForce RTX 3080 (driver 621.24), MSVC (VS Build Tools 17.14), Rust 1.91.1.

AI-assisted: yes (Claude Code)

**@⁠kiwe147** on GitHub · 2026-11-23 00:25 UTC · [original](https://github.com/omonkeyz/xbox-emulator/issues/194) On `main` `c4b7607`, `vop::rdna2_silicon::rdna2_silicon_results` passes on WARP and fails when the `exec` suite runs on a real GPU: ``` TOMBOX_EXEC_HW=1 cargo test --locked -p tombox-xshader --test exec rdna2_silicon rdna2_silicon: 12 mnemonics verified, 3 failing, 480 cases rdna2_silicon: 33 failing cases ``` 2 of 2 runs on `c4b7607` fail, and the same 33 cases fail on the head of #191 alone. Without `TOMBOX_EXEC_HW` (WARP) it passes (1 passed). The rest of the `exec` and `isa_sweep` suites pass on this GPU in hardware mode (109 passed, 0 failed, 2 ignored on `baadb80`, before #191 was in). All 33 failing cases are `v_fmac_f16` (15), `v_fmaak_f16` (11) and `v_fmamk_f16` (7), and in every one the expected result is a NaN. The GPU returns `0x7fff` in the low half; the silicon record has the payload and sign of the input NaN, for example: ``` #1 v_fmac_f16: got [9dfb7fff] want [9dfbfe00] #2 v_fmac_f16: got [63017fff] want [63017e00] #9 v_fmac_f16: got [c1ac7fff] want [c1ac7e01] ``` So the numbers match everywhere except the NaN bit pattern (the NVIDIA GPU returns an all-ones-mantissa quiet NaN, `0x7fff`, where gfx1036 keeps `0xfe00`, `0x7e00` or `0x7e01`). The other 447 cases and the other 9 mnemonics of the test match. This looks like a property of the GPU running the test, not a translator bug: the test checks the translator against recorded AMD silicon, and another vendor's GPU does not reproduce AMD's NaN payload. Possible directions, your call: compare NaN results as a class (any NaN) when `TOMBOX_EXEC_HW` is set, or leave the NaN cases for the WARP run only. I have not looked at what other exec tests do for NaN payloads. I did not test other NVIDIA generations or an AMD GPU, so I do not know whether the RTX 4070 Ti in #188 gives the same result. Setup: Windows 11 Pro 10.0.26200, NVIDIA GeForce RTX 3080 (driver 621.24), MSVC (VS Build Tools 17.14), Rust 1.91.1. AI-assisted: yes (Claude Code)
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 06:13:21 +00:00
Author
Owner

@⁠omonkeyz on GitHub · 2026-11-23 00:36 UTC · original

Thanks for the careful report. I agree it's a property of the host GPU, not a translator bug. The translator uses host float math for f16 FMAs, so NaN payloads follow the device that runs the test. WARP happens to keep the gfx1036 payloads, and NVIDIA returns its own canonical quiet NaN.

Proposed fix, in the test only:

  • Under TOMBOX_EXEC_HW=1, compare an expected NaN as a class (any NaN with the same sign/quiet status where it is defined) and log the payload difference.
  • Keep the exact bit comparison on WARP.
  • Add a BLOCKERS line saying RDNA2 NaN payload propagation for the f16 FMA family is not modelled on non-AMD hosts.

@⁠SchmashinPrunes, since this is your test from #191, would you send that change? If not, a PR from anyone is welcome.

**@⁠omonkeyz** on GitHub · 2026-11-23 00:36 UTC · [original](https://github.com/omonkeyz/xbox-emulator/issues/194#issuecomment-7088482541) Thanks for the careful report. I agree it's a property of the host GPU, not a translator bug. The translator uses host float math for f16 FMAs, so NaN payloads follow the device that runs the test. WARP happens to keep the gfx1036 payloads, and NVIDIA returns its own canonical quiet NaN. Proposed fix, in the test only: - Under `TOMBOX_EXEC_HW=1`, compare an expected NaN as a class (any NaN with the same sign/quiet status where it is defined) and log the payload difference. - Keep the exact bit comparison on WARP. - Add a BLOCKERS line saying RDNA2 NaN payload propagation for the f16 FMA family is not modelled on non-AMD hosts. @⁠SchmashinPrunes, since this is your test from #191, would you send that change? If not, a PR from anyone is welcome.
This discussion has been locked. Commenting is limited to contributors.
No description provided.