agc_driver_f32_compare_constant fails on the AMD Windows driver: v_cmp_lt_f32 NaN < +inf from a register gives 1 #3536

Closed
opened 2026-10-11 12:39:40 +00:00 by LeandroLP23 · 1 comment
LeandroLP23 commented 2026-10-11 12:39:40 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-11T12:39:40Z.


On a Radeon 860M (RDNA 3.5), Windows 11 (26300), AMD driver 24.30.58.08 (LLPC, Vulkan driver 2.0.331), WinLibs GCC 15.2.0 r7, Release, agc_driver_f32_compare_constant (added in #2408) fails 3/3 on main 1e8fff68c with the AMD Vulkan cache and shader_cache emptied before each run:

AGC graphics: f32 compare constant: no float mode, register operand lane 20 v_cmp_lt_f32 0x7fc00000, 0x7f800000 is 1, expected 0

Only this case fails. The constant-operand cases and the other float modes pass. It isn't caused by #2408's translation change: with CompareInstructions.cpp from before 42692dee1, the test fails the same way, on the same lane and value. In the register-operand variant, +inf reaches v21 through a v_mov_b32 of a literal, so the driver's compiler sees it as a constant while the NaN comes from the buffer. My guess is that LLPC folds x < +inf into a form that is true for NaN, but I haven't confirmed it, e.g. with a SPIR-V dump or on RADV with the same GPU. CI doesn't catch it because the Windows runners have no GPU and Linux runs on lavapipe.

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5801125498 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3536). Originally posted by [LeandroLP23](https://github.com/LeandroLP23) on 2026-10-11T12:39:40Z. --- On a Radeon 860M (RDNA 3.5), Windows 11 (26300), AMD driver 24.30.58.08 (LLPC, Vulkan driver 2.0.331), WinLibs GCC 15.2.0 r7, Release, `agc_driver_f32_compare_constant` (added in #2408) fails 3/3 on `main` `1e8fff68c` with the AMD Vulkan cache and `shader_cache` emptied before each run: ``` AGC graphics: f32 compare constant: no float mode, register operand lane 20 v_cmp_lt_f32 0x7fc00000, 0x7f800000 is 1, expected 0 ``` Only this case fails. The constant-operand cases and the other float modes pass. It isn't caused by #2408's translation change: with `CompareInstructions.cpp` from before `42692dee1`, the test fails the same way, on the same lane and value. In the register-operand variant, +inf reaches `v21` through a `v_mov_b32` of a literal, so the driver's compiler sees it as a constant while the NaN comes from the buffer. My guess is that LLPC folds `x < +inf` into a form that is true for NaN, but I haven't confirmed it, e.g. with a SPIR-V dump or on RADV with the same GPU. CI doesn't catch it because the Windows runners have no GPU and Linux runs on lavapipe.
reyani-dev commented 2026-10-11 16:22:01 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by reyani-dev on 2026-10-11T16:22:01Z.


Data point: agc_driver_f32_compare_constant passes 2/2 on a Radeon 780M (RDNA 3, Windows 11 26200, AMD driver 31.0.22038.0) on main a11c8f7f, with ANYPS5_GPU=AMD (the test throws if no AMD device matches) and VK_LOADER_DRIVERS_DISABLE=*dzn* (#3255). So the wrong NaN < +inf result isn't reproduced on every AMD Windows driver. It may be specific to the 24.30.58.08 compiler, or to RDNA 3.5.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6111093852 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/3536#issuecomment-6111093852). Originally posted by [reyani-dev](https://github.com/reyani-dev) on 2026-10-11T16:22:01Z. --- Data point: `agc_driver_f32_compare_constant` passes 2/2 on a Radeon 780M (RDNA 3, Windows 11 26200, AMD driver 31.0.22038.0) on `main` a11c8f7f, with `ANYPS5_GPU=AMD` (the test throws if no AMD device matches) and `VK_LOADER_DRIVERS_DISABLE=*dzn*` (#3255). So the wrong `NaN < +inf` result isn't reproduced on every AMD Windows driver. It may be specific to the 24.30.58.08 compiler, or to RDNA 3.5.
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5#3536
No description provided.