Mesa ANV: v_cmp_*_f16 treats f16 subnormals as zero (agc_driver_vopc_compare) #2861
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 ThatsLeo on 2026-10-10T16:48:32Z.
agc_driver_vopc_comparefails on Intel Arc (Meteor Lake, Mesa 26.2.3 ANV), as reported for other Intel GPUs in #2114:Every failing compare has an f16 subnormal operand (
0x0001):-0 < 0x0001and0 < 0x0001come out false.EmitF16BitsToF32widens halves withUnpackHalf2x16, which may flush subnormals, and ANV does.Fix:
ThatsLeo/AnyPS5:fix/shader-f16-subnormal-widen(one commit,e59865e0, onmain57f96fd2). A subnormal half is converted as its fraction times 2^-24 with its sign, which is exact in f32; other halves still go throughUnpackHalf2x16. All callers ofEmitF16BitsToF32get the exact conversion.Tested: Fedora 44, GCC 16.2.1, Release.
agc_driver_vopc_comparepasses on Intel Arc and lavapipe. Fullctestonmain(57f96fd2), on this branch and with all eight fixes listed in #2803-#2807 and here, on Intel Arc and lavapipe: no new failure. With all of them and #1250, all 698 tests pass on Intel Arc and on lavapipe. Dreaming Sarah (PPSA02929) runs with no visual difference.AI-assisted: yes.
Imported from boykopovar/AnyPS5. Originally posted by Silverash-i8 on 2026-10-10T17:29:51Z.
Tested this on the Windows Intel driver too, since it's the same failure I reported in #2822 for Arrow Lake.
Windows 11, WinLibs GCC 15.2.0 r7, Release, Intel Graphics in a Core Ultra 9 275HX (Arrow Lake, driver 32.0.101.8991),
ANYPS5_GPU=Intel. Onmain57f96fd2I stackede59865e0(this) and7df6c709(#2860) with the other Intel fixes (#2777's758eeb9f, #2815's377829ec, the LDS lock change from #2805, #1250 forvop1_float_unary), plus thefp16_overflowskip from my7217a416:agc_driver_vopc_comparepasses.ctest -j6: 2 failures out of 709 (46 skipped on this device). One wasagc_driver_gated_dispatch_capture, the timing flake from #2832, which passes on its own. The other waspatched_libraries, which passes on a re-run and doesn't touch shaders.So both fixes work on Arrow Lake. The difference is that #2822 adds
DenormPreserve 16toUnpackHalf2x16and only applies where the device has Float16, RoundingModeRTE and DenormPreserve, while this one converts subnormals exactly everywhere, at the cost of a few extra instructions per widen. Since this one doesn't depend on device support, I'd be happy for it to be the one that goes in, and I'll close #2822 if the maintainers agree.AI-assisted (Claude Code); I ran everything above on my machine.
Imported from boykopovar/AnyPS5. Originally posted by oneandonlydean on 2026-10-10T18:08:44Z.
Closing as a duplicate of #2822. Your exact widening (
e59865e0) and test results would be useful there; #1463 (open) takes the same integer-decode route.