agc_driver_f32_arithmetic_nan fails on NVIDIA (Windows) since #2279: v_fmamk_f32 returns a quiet NaN where the signalling one is expected #2581
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 Yuva1024 on 2026-10-10T06:56:04Z.
agc_driver_f32_arithmetic_nanfails on every run onmain6f262eb0:Windows 11 (26200), WinLibs GCC 15.2.0 r7, Release, RTX 4060 (driver 617.42),
ctest -R ^agc_driver_f32_arithmetic_nan$, 5 runs each:main530b6a42main530b6a42with #2279 reverted (git revert -m 1 c94cbb7a)main6f262eb0The last full
cteston this machine without it wasbc40a6b5(606/606), before #2279 merged at 06:14 UTC. The rest of the suite passes, includingf32_denormal_flush,f32_output_modifierandvector_fma_nan_result.#2279 records Linux results (RADV wave64, lavapipe); CI's Windows job has no Vulkan driver, so the AGC tests skip there. I have not analysed why the NVIDIA result differs or tried other GPUs.
AI-assisted: yes (Claude Code).
Imported from boykopovar/AnyPS5. Originally posted by Yuva1024 on 2026-10-10T07:08:20Z.
Root cause, and a fix that keeps #2279's selection, in case a re-land is preferred to the revert in #2584. Same setup as the report: Windows 11 (26200), WinLibs GCC 15.2.0 r7, RTX 4060 (driver 617.42),
main6f262eb0.Cause.
EmitFPNanResultFma32turns each source into integer bits withOpBitcast. Forv_fmamk_f32the literal is a floatOpConstant 0x7f812345(a signalling NaN), so the module containsOpBitcast %uintapplied directly to a NaN constant. I dumped the SPIR-V the test compiles: it has that float constant and four direct bitcasts of it. The only other NaN constant,0xffc12345(thev_fmaak_f32literal), is already quiet.That fits what the test shows. With the test changed to list every mismatch instead of stopping at the first, there are 44, all
v_fmamk_f32(22 lanes in each of the no-float-mode andIEEE=0runs, none inIEEE=1), and each is the expected payload with the quiet bit set (0x7fc12345). This is consistent with the driver folding the bitcast of a constant and quieting the NaN; I have not looked inside the driver.The IR does not hit this:
ConstantFolder.cpp(foldBitCast) turns a bitcast of anF32immediate into aU32immediate before emission. The new op does the bitcast inside the emitter, which bypasses that.Fix (one function, plus the
<bit>include): use the immediate's bits as an integer constant when a source is anF32immediate.Diff
With it,
agc_driver_f32_arithmetic_nanhas 0 mismatches in all three runs, and the compiled SPIR-V no longer contains a bitcast of a NaN constant. Not tested: Linux or other GPUs. The rest of the suite is still running with this change; I will only follow up if something fails.Whether to revert or fix is the maintainers' call; this does not change #2584.
AI-assisted: yes (Claude Code).