AGC: agc_driver_quad_pixel_mask samples the wrong mip level under a partial quad mask on Windows (RTX 5060 Ti and Radeon 860M) #14237

Closed
opened 2026-11-01 02:36:43 +00:00 by LeandroLP23 · 0 comments
LeandroLP23 commented 2026-11-01 02:36:43 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-11-01T02:36:43Z.


agc_driver_quad_pixel_mask fails on Windows on both GPUs I have, in the implicit-LOD case under a partial quad pixel mask. The constant-color cases and mask 0xf pass. The sampled pixel gets the wrong mip level, so the derivatives that go through the demoted helper pixels come out wrong, and the error differs by vendor.

The test samples a 256x128 texture at (x/64, y/32) on a 64x32 target. One pixel step is 4 texels, so level 2 (red 96) is expected.

GPU Driver / OS main Result
NVIDIA GeForce RTX 5060 Ti Windows 11 029463ceb6 pixel (1, 0) channel 0 is 32, expected 96 (level 0: zero derivative)
AMD Radeon 860M Windows 11 0e9dc7bc4c pixel (1, 0) channel 0 is 128, expected 96 (level 3: derivative twice too large)
  • It happens on every run (3 of 3 on the RTX 5060 Ti), with and without VK_LAYER_KHRONOS_validation. The layer reports no VUID- errors.

  • Both GPUs report shaderDemoteToHelperInvocation, so the test takes the demote path.

  • On the Radeon 860M the test fails at 90b20afac8 too, the commit that switched quad-mask pixels from kill to demote, but there the helpers write their color (pixel (0, 0) channel 2 is 2, expected 0), which 79d72b6836 later fixed. So I can't point to a commit where it passed on this GPU. #6015 reported it passing on an RTX 4090 with the Linux driver 610.57.04.

  • On NVIDIA it follows the 621 drivers on Blackwell: an RTX 5080 passes on 617.42 and fails on 621.14 (adam25136), and an Ada RTX 4060 Laptop passes on 621.14 (joafern22). #14341 passes on the RTX 5080 with both drivers.

Mask 2 leaves one live pixel per quad, so all of its derivatives come from helper lanes. One explanation that fits both results: the coordinate math before image_sample (v_mul_f32 after s_wqm_b64) doesn't run in the helper lanes, either because their EXEC bit is cleared or because they don't take part in the subgroup operation that rebuilds the whole-quad mask. Then the helper lanes keep a stale value, and what that value is depends on the driver. I haven't confirmed this in the SPIR-V. Is the derivative supposed to see helper lanes as live for WQM here?

Command: ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 ctest --test-dir build -R "^agc_driver_quad_pixel_mask$" --output-on-failure

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:6142439372 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/14237). Originally posted by [LeandroLP23](https://github.com/LeandroLP23) on 2026-11-01T02:36:43Z. --- `agc_driver_quad_pixel_mask` fails on Windows on both GPUs I have, in the implicit-LOD case under a partial quad pixel mask. The constant-color cases and mask `0xf` pass. The sampled pixel gets the wrong mip level, so the derivatives that go through the demoted helper pixels come out wrong, and the error differs by vendor. The test samples a 256x128 texture at `(x/64, y/32)` on a 64x32 target. One pixel step is 4 texels, so level 2 (red 96) is expected. | GPU | Driver / OS | `main` | Result | |---|---|---|---| | NVIDIA GeForce RTX 5060 Ti | Windows 11 | `029463ceb6` | `pixel (1, 0) channel 0 is 32, expected 96` (level 0: zero derivative) | | AMD Radeon 860M | Windows 11 | `0e9dc7bc4c` | `pixel (1, 0) channel 0 is 128, expected 96` (level 3: derivative twice too large) | - It happens on every run (3 of 3 on the RTX 5060 Ti), with and without `VK_LAYER_KHRONOS_validation`. The layer reports no `VUID-` errors. - Both GPUs report `shaderDemoteToHelperInvocation`, so the test takes the demote path. - On the Radeon 860M the test fails at 90b20afac8 too, the commit that switched quad-mask pixels from kill to demote, but there the helpers write their color (`pixel (0, 0) channel 2 is 2, expected 0`), which 79d72b6836 later fixed. So I can't point to a commit where it passed on this GPU. #6015 reported it passing on an RTX 4090 with the Linux driver 610.57.04. - On NVIDIA it follows the 621 drivers on Blackwell: an RTX 5080 passes on 617.42 and fails on 621.14 (adam25136), and an Ada RTX 4060 Laptop passes on 621.14 (joafern22). #14341 passes on the RTX 5080 with both drivers. Mask 2 leaves one live pixel per quad, so all of its derivatives come from helper lanes. One explanation that fits both results: the coordinate math before `image_sample` (`v_mul_f32` after `s_wqm_b64`) doesn't run in the helper lanes, either because their EXEC bit is cleared or because they don't take part in the subgroup operation that rebuilds the whole-quad mask. Then the helper lanes keep a stale value, and what that value is depends on the driver. I haven't confirmed this in the SPIR-V. Is the derivative supposed to see helper lanes as live for WQM here? Command: `ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 ctest --test-dir build -R "^agc_driver_quad_pixel_mask$" --output-on-failure` AI-assisted: yes (Claude Code)
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#14237
No description provided.