test(agc): accept any NaN where the f16 fma and fma_mix tests expect one #7093
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/7093"
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 thuanquang on 2026-10-17T11:13:52Z.
What
agc_driver_f16_fma_denormal_modes(#7034) andagc_driver_fma_mix_f16_denormal_modes(#7040) compare every result bit for bit with the values the RX 6700 XT wrote, including rows whose result is a NaN (inf * 0). The technical debt entry on NaN results says the NaN bits of f16 arithmetic and ofv_fma_mix_f32with f16 sources "are left to the driver", so those rows depend on the driver: on an RTX 5080 (driver 32.0.16.1062)agc_driver_f16_fma_denormal_modesfails onmainwithv_fma_f16 without a known float mode of 0x7c00, 0x0000, 0x0000 is 0x7fff, expected 0xfe00(report on #7034), and thev_fma_mix_f32test has the same kind of row (0xffc00000on AMD,0x7fffffffreported on NVIDIA in #6976).Both checks now accept any NaN where the expected value is a NaN; the f16 one still requires the high half of the register to be zero. Every other row is still compared bit for bit, so the tests keep catching the denormal handling they were written for.
Tested
Windows 11 26200, AMD Radeon RX 6700 XT (gfx1031), driver 32.0.21045.5002, WinLibs GCC 15.2.0 r7, Release,
BUILD_TESTING=ON,ANYPS5_REQUIRE_VULKAN=1,main864729dc0:core/shader/recompilerreverted to6a32550fd(before #7034 and #7040) both still fail on non-NaN rows:v_fma_f16 f16 denormal mode 0, IEEE mode on of 0x3bff, 0x0400, 0x0000 is 0x0400, expected 0x0000andv_fma_mix_f32 of three f16 sources f32 denormals flushed, f16 denormal mode 0, IEEE mode off of 0x00010000, 0x00000000, 0x3f800000 is 0x33800000, expected 0x00000000.python tools/check_conventions.py --base origin/mainwith this title and body passes.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by fma-rc on 2026-10-17T12:14:55Z.
Ran this on Linux,
mainc9e6c45depluse5b4b326c, Release, GCC 16.2.1. Both tests pass with the PR on an RTX 5080 (driver 615.78.08), a Radeon 610M on RADV and lavapipe.With
main's two test files on the same build, both fail on the RTX 5080:v_fma_f16 without a known float mode of 0x7c00, 0x0000, 0x0000 is 0x7fff, expected 0xfe00andv_fma_mix_f32 ... of 0x00007c00, 0x00000001, 0x3f800000 is 0x7fffffff, expected 0xffc00000. On RADV they pass either way. Every other row still has to match bit for bit, and only the NaN rows are relaxed.Imported from boykopovar/AnyPS5. Originally posted by akkadbakkad89 on 2026-10-17T12:22:53Z.
Validation on a second NVIDIA device, since the only NVIDIA datapoint so far is the RTX 5080 failure report: RTX 3070 (driver 617.42), Windows 11, MinGW (WinLibs GCC 15.2.0), Release, head
e5b4b326c, serial fresh processes viactest -R "agc_driver_f16_fma_denormal_modes|agc_driver_fma_mix_f16_denormal_modes":agc_driver_f16_fma_denormal_modes: pass (fails onmainatv_fma_f16 ... is 0x7fff, expected 0xfe00)agc_driver_fma_mix_f16_denormal_modes: pass (fails onmainatv_fma_mix_f32 ... is 0x7fffffff, expected 0xffc00000)Independent confirmation that the NaN-relaxed checks accept NVIDIA's encodings. I had opened #7109 with the same approach before noticing this PR predates the issue itself; closing mine as the duplicate. The
actual <= 0xffffuguard on the f16 form is a nice extra — it keeps catching a stray high half that a looser any-NaN check would miss.