Skip to content

Mesa ANV: v_cmp_*_f16 treats f16 subnormals as zero (agc_driver_vopc_compare) #2861

Closed

Description

@ThatsLeo

agc_driver_vopc_compare fails on Intel Arc (Meteor Lake, Mesa 26.2.3 ANV), as reported for other Intel GPUs in #2114:

vopc compares: thread 0 compare 36 is 0, expected 1

Every failing compare has an f16 subnormal operand (0x0001): -0 < 0x0001 and 0 < 0x0001 come out false. EmitF16BitsToF32 widens halves with UnpackHalf2x16, which may flush subnormals, and ANV does.

Fix: ThatsLeo/AnyPS5:fix/shader-f16-subnormal-widen (one commit, e59865e0, on main 57f96fd2). A subnormal half is converted as its fraction times 2^-24 with its sign, which is exact in f32; other halves still go through UnpackHalf2x16. All callers of EmitF16BitsToF32 get the exact conversion.

Tested: Fedora 44, GCC 16.2.1, Release. agc_driver_vopc_compare passes on Intel Arc and lavapipe. Full ctest on main (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.

Activity

  1. Silverash-i8 commented on Oct 10, 2026

    @Silverash-i8
    Contributor

    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. On main 57f96fd2 I stacked e59865e0 (this) and 7df6c709 (#2860) with the other Intel fixes (#2777's 758eeb9f, #2815's 377829ec, the LDS lock change from #2805, #1250 for vop1_float_unary), plus the fp16_overflow skip from my 7217a416:

    So both fixes work on Arrow Lake. The difference is that #2822 adds DenormPreserve 16 to UnpackHalf2x16 and 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.

  2. oneandonlydean commented on Oct 10, 2026

    @oneandonlydean
    Collaborator

    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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions