fix(shader): leave pixel helpers out of EXEC values only where ballots skip them #12458

Merged
QRMOE merged 3 commits from upstream-pr/12458 into main 2026-11-14 03:44:00 +00:00
QRMOE commented 2026-10-28 14:35:40 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by QRMOE on 2026-10-28T14:35:40Z.


What

Re-lands the helper-lane waterfall fix from #11199 (reverted by #12298) without the part that broke derivatives on NVIDIA.

#11199 cleared helper invocations from every pixel-stage ballot. NVIDIA's helpers take part in ballots and run, so that filter handed them compare-mask bits and saved EXEC values the console's helpers would not get, and PPSA21564 showed lines along triangle edges (@oneandonlydean's report on #11199). This PR leaves ballots alone and changes three things:

  • EXEC read as a value (hostExecWord: s_mov_b64 sN, exec, the saveexec copy, ALU sources) is masked by the plain host ballot instead of its whole-quad expansion. On a driver that keeps helpers out of ballots (AMD's Windows driver: RX 9070 XT here, and the RDNA2 iGPU in @wachi35676's run on #11199), a helper that s_wqm put into EXEC is no longer in the value, so a waterfall over EXEC (s_ff1, v_readlane_b32, v_cmp, s_andn2_b64) ends instead of looping on a bit that no compare can clear (#11052). Where helpers take part in ballots, the plain ballot already holds the whole quad, so the value is the same as on main.
  • The whole-quad expansion came from #6291, to keep helper bits in a saved EXEC across a restore. In pixel programs that job now goes to the per-lane mask the translator already keeps for SGPR masks: s_mov_b64 of a mask operand and the s_*_saveexec copy store each lane's own EXEC bit, and writing EXEC back from that copy uses it, so a restored helper is switched back on whatever the driver does with ballots. Other stages keep the word copy, because there the per-lane bit would hide that lanes 32-63 of a wave64 on a 32-lane host are 0, which the vertex half-wave reduction proof in agc_shader_memory relies on.
  • In a wave32 pixel program, s_mov_b32 and the 32-bit scalar logic ops (s_and_b32, s_or_b32, s_andn2_b32, ...) on SGPR masks combine the sources' lane bits, as the 64-bit forms already did. So a v_cmp mask combined by s_and_b32 and read by v_cndmask_b32 (path 1 in the report) gives each lane its own compare bit. Before, wave32 rebuilt that bit from the ballot word, so on a driver that leaves helpers out of ballots a helper that s_wqm switched on read 0. That is the agc_driver_pixel_helper_lane_masks failure on CI's llvmpipe (983 wrong pixels, wave32 only).

Compare-mask words keep the driver's own helper bits, as on main. Read per lane, a mask now holds the lane's own bit on every driver, and where helpers take part in ballots (NVIDIA) that is the bit it got before #11199.

Tests:

  • agc_driver_pixel_helper_waterfall is back, with the pixel index computed after s_wqm so helpers carry their own key. It no longer requires helpers to be skipped: the console iterates the helpers whole-quad mode put into EXEC, NVIDIA does too, and AMD's driver cannot. It checks that the loop ends under the pass limit, that every live lane is picked exactly once, and that the pass count lies between the live lanes and the lanes of their quads.
  • New agc_driver_pixel_helper_lane_masks: implicit-LOD sampling on a 5-level mip chain, with every covered pixel checked against the expected level (6696 inside, 1121 in partly covered quads), for wave64 and wave32, native and emulated barycentrics, and mips 0-2. Three programs: two v_cmp masks combined by s_and_b64/s_and_b32 and then v_cndmask_b32 of the coordinate; EXEC copied to an SGPR and back without s_wqm; EXEC saved by s_and_saveexec and restored by s_or. Before the save, the coordinate registers hold 4.0 while helpers are on, so a helper that is switched off feeds a wrong derivative.
  • The docs/dev/debt/shader.md entry for EXEC read as a value now states what differs from the console on each kind of driver, and no longer lists the 32-bit scalar logic ops as keeping only the value.

Tested

Windows 11 26200, AMD Radeon RX 9070 XT (driver 32.0.31021.1015), Vulkan SDK 1.4.363.0, GCC 15.2.0, Release. Same machine and GPU for every arm, ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ctest --test-dir build -R <pattern> -V. The main arm is this tree with core/shader and docs/dev/debt/shader.md from the branch's base main 6a11d88f70 and the two new tests kept.

Tests (22): agc_driver_pixel_helper_waterfall, agc_driver_pixel_helper_lane_masks, agc_driver_pixel_helper_lanes, agc_driver_pixel_implicit_derivatives, agc_driver_pixel_row_reduction, agc_driver_pixel_exec_interpolation, agc_driver_pixel_barycentric_emulation, agc_driver_mesh_barycentric_emulation, agc_shader_memory, agc_shader_entry_lane_proof_budget, agc_shader_quad_mask_no_demote, agc_shader_helpers, agc_subgroup_barrier, agc_dpp_write, agc_driver_dpp16_inactive_source, agc_driver_dpp16_operands, agc_driver_dpp16_row_share_xmask, agc_driver_dpp8, agc_driver_dpp8_pk_fmac, agc_driver_dpp_no_form, agc_driver_wave32_subgroup, agc_driver_graphics. For head 9b2aea4955 both arms also ran every other agc_driver_pixel* test and agc_driver_wave32_exec_lane_bits, 36 in all.

main this branch (9b2aea4955)
Passed 35 of 36 36 of 36
Failed agc_driver_pixel_helper_waterfall: "the wave whose first lane is pixel 584 hit the pass limit" none
VUID- lines 0 0
was not found but was requested by env var VK_INSTANCE_LAYERS 0 0

With VK_LOADER_DEBUG=layer the loader reports Insert instance layer "VK_LAYER_KHRONOS_validation". tools/check_conventions.py --base origin/main passes, and the branch merges cleanly into current main.

Narrow subgroups (CI's llvmpipe, subgroup size 8, failed agc_driver_pixel_helper_lane_masks on ec04b0cf52 with compare masks combined by a scalar AND, emulate0 wave32 mip0: ... incorrect=983 incorrect_edge=983; the test stops at its first failure, so the later cases did not run there):

  • The width is not what fails. A wave32 pixel program on an 8-lane host runs each subgroup as a partial wave with ballot bits 0-7, and the three programs read masks only per lane and through s_wqm, whose quads lie inside a subgroup. The failing case is the only one that rebuilt a lane's bit from a compare's ballot word, and the wave64 form already used lane bits and passed on llvmpipe.
  • To check the cause on this machine, I built a local, uncommitted variant that ANDs every pixel ballot predicate with !OpIsHelperInvocationEXT, so helpers are left out of ballots as on llvmpipe. On ec04b0cf52 it fails with exactly the CI line, incorrect=983 incorrect_edge=983 in emulate0 wave32 mip0. On 9b2aea4955 agc_driver_pixel_helper_lane_masks passes all 36 cases, and agc_driver_pixel_helper_waterfall, agc_driver_pixel_helper_lanes and agc_driver_pixel_implicit_derivatives pass too.
  • I have no lavapipe here, so this head has not run on llvmpipe yet. The only other narrow device on this machine, SwiftShader (subgroup size 4), lacks VK_KHR_8bit_storage, so the test skips there. CI's Linux lane is the narrow-subgroup check for this head.

In a title: @hugodearaujo ran CONTROL Resonant (PPSA34547 01.300.300) on Linux, RX 9070 XT, RADV (Mesa 26.2.6), with #11580 in every build (comment). On main the GPU hung about 115 s after New Game, inside a pixel shader's waterfall over EXEC (s_mov_b32 s80, exec before s_wqm_b32). With ec04b0cf52 and no APS5_LOOP_GUARD, it did not hang in 900 s. The change in 9b2aea4955 was not run in a title.

Limits of this testing:

  • I have no NVIDIA GPU, so the PPSA21564 picture is not reproduced here. On this RX 9070 XT agc_driver_pixel_helper_lane_masks passes on main, on this branch, and also with #11199's original recompiler change, so this card does not show the derivative regression. SeaSunPT's RTX 5070 Ti runs show the same: it also passes there with #11199's change. So it checks the intended per-lane values, but it is not a guard for the NVIDIA picture regression; agc_driver_pixel_helper_waterfall still covers the hang. On ec04b0cf52, @oneandonlydean's RTX 4090 passes both new tests, and in PPSA21564 the cloud-sea lines do not come back (0.38 at +100 s, against 0.57 on main and 0.69 after #11199). TechLevelZero's RTX 2000 Ada run shows no new failures or validation IDs. These runs were not repeated on 9b2aea4955.
  • I ran no title here, and nothing was run on a PS5.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: #11052
  • Unblocks: none
  • GPUs tested: AMD Radeon RX 9070 XT, driver 32.0.31021.1015, Windows 11 26200
  • AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5052313101 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12458). Originally posted by [QRMOE](https://github.com/QRMOE) on 2026-10-28T14:35:40Z. --- ### What Re-lands the helper-lane waterfall fix from #11199 (reverted by #12298) without the part that broke derivatives on NVIDIA. #11199 cleared helper invocations from every pixel-stage ballot. NVIDIA's helpers take part in ballots and run, so that filter handed them compare-mask bits and saved EXEC values the console's helpers would not get, and PPSA21564 showed lines along triangle edges (@oneandonlydean's report on #11199). This PR leaves ballots alone and changes three things: - EXEC read as a value (`hostExecWord`: `s_mov_b64 sN, exec`, the saveexec copy, ALU sources) is masked by the plain host ballot instead of its whole-quad expansion. On a driver that keeps helpers out of ballots (AMD's Windows driver: RX 9070 XT here, and the RDNA2 iGPU in @wachi35676's run on #11199), a helper that `s_wqm` put into EXEC is no longer in the value, so a waterfall over EXEC (`s_ff1`, `v_readlane_b32`, `v_cmp`, `s_andn2_b64`) ends instead of looping on a bit that no compare can clear (#11052). Where helpers take part in ballots, the plain ballot already holds the whole quad, so the value is the same as on `main`. - The whole-quad expansion came from #6291, to keep helper bits in a saved EXEC across a restore. In pixel programs that job now goes to the per-lane mask the translator already keeps for SGPR masks: `s_mov_b64` of a mask operand and the `s_*_saveexec` copy store each lane's own EXEC bit, and writing EXEC back from that copy uses it, so a restored helper is switched back on whatever the driver does with ballots. Other stages keep the word copy, because there the per-lane bit would hide that lanes 32-63 of a wave64 on a 32-lane host are 0, which the vertex half-wave reduction proof in `agc_shader_memory` relies on. - In a wave32 pixel program, `s_mov_b32` and the 32-bit scalar logic ops (`s_and_b32`, `s_or_b32`, `s_andn2_b32`, ...) on SGPR masks combine the sources' lane bits, as the 64-bit forms already did. So a `v_cmp` mask combined by `s_and_b32` and read by `v_cndmask_b32` (path 1 in the report) gives each lane its own compare bit. Before, wave32 rebuilt that bit from the ballot word, so on a driver that leaves helpers out of ballots a helper that `s_wqm` switched on read 0. That is the `agc_driver_pixel_helper_lane_masks` failure on CI's llvmpipe (983 wrong pixels, wave32 only). Compare-mask words keep the driver's own helper bits, as on `main`. Read per lane, a mask now holds the lane's own bit on every driver, and where helpers take part in ballots (NVIDIA) that is the bit it got before #11199. Tests: - `agc_driver_pixel_helper_waterfall` is back, with the pixel index computed after `s_wqm` so helpers carry their own key. It no longer requires helpers to be skipped: the console iterates the helpers whole-quad mode put into EXEC, NVIDIA does too, and AMD's driver cannot. It checks that the loop ends under the pass limit, that every live lane is picked exactly once, and that the pass count lies between the live lanes and the lanes of their quads. - New `agc_driver_pixel_helper_lane_masks`: implicit-LOD sampling on a 5-level mip chain, with every covered pixel checked against the expected level (6696 inside, 1121 in partly covered quads), for wave64 and wave32, native and emulated barycentrics, and mips 0-2. Three programs: two `v_cmp` masks combined by `s_and_b64`/`s_and_b32` and then `v_cndmask_b32` of the coordinate; EXEC copied to an SGPR and back without `s_wqm`; EXEC saved by `s_and_saveexec` and restored by `s_or`. Before the save, the coordinate registers hold 4.0 while helpers are on, so a helper that is switched off feeds a wrong derivative. - The `docs/dev/debt/shader.md` entry for EXEC read as a value now states what differs from the console on each kind of driver, and no longer lists the 32-bit scalar logic ops as keeping only the value. ### Tested <!-- OS, title or homebrew, what was checked. "Not tested" is a valid answer. A performance change: the summary lines of main and of this PR from the same machine and scene, with the traces attached, captured as the Performance report issue form describes. --> Windows 11 26200, AMD Radeon RX 9070 XT (driver 32.0.31021.1015), Vulkan SDK 1.4.363.0, GCC 15.2.0, Release. Same machine and GPU for every arm, `ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ctest --test-dir build -R <pattern> -V`. The `main` arm is this tree with `core/shader` and `docs/dev/debt/shader.md` from the branch's base `main` 6a11d88f70 and the two new tests kept. Tests (22): `agc_driver_pixel_helper_waterfall`, `agc_driver_pixel_helper_lane_masks`, `agc_driver_pixel_helper_lanes`, `agc_driver_pixel_implicit_derivatives`, `agc_driver_pixel_row_reduction`, `agc_driver_pixel_exec_interpolation`, `agc_driver_pixel_barycentric_emulation`, `agc_driver_mesh_barycentric_emulation`, `agc_shader_memory`, `agc_shader_entry_lane_proof_budget`, `agc_shader_quad_mask_no_demote`, `agc_shader_helpers`, `agc_subgroup_barrier`, `agc_dpp_write`, `agc_driver_dpp16_inactive_source`, `agc_driver_dpp16_operands`, `agc_driver_dpp16_row_share_xmask`, `agc_driver_dpp8`, `agc_driver_dpp8_pk_fmac`, `agc_driver_dpp_no_form`, `agc_driver_wave32_subgroup`, `agc_driver_graphics`. For head 9b2aea4955 both arms also ran every other `agc_driver_pixel*` test and `agc_driver_wave32_exec_lane_bits`, 36 in all. | | `main` | this branch (9b2aea4955) | |---|---|---| | Passed | 35 of 36 | 36 of 36 | | Failed | `agc_driver_pixel_helper_waterfall`: "the wave whose first lane is pixel 584 hit the pass limit" | none | | `VUID-` lines | 0 | 0 | | `was not found but was requested by env var VK_INSTANCE_LAYERS` | 0 | 0 | With `VK_LOADER_DEBUG=layer` the loader reports `Insert instance layer "VK_LAYER_KHRONOS_validation"`. `tools/check_conventions.py --base origin/main` passes, and the branch merges cleanly into current `main`. Narrow subgroups (CI's llvmpipe, subgroup size 8, failed `agc_driver_pixel_helper_lane_masks` on ec04b0cf52 with `compare masks combined by a scalar AND, emulate0 wave32 mip0: ... incorrect=983 incorrect_edge=983`; the test stops at its first failure, so the later cases did not run there): - The width is not what fails. A wave32 pixel program on an 8-lane host runs each subgroup as a partial wave with ballot bits 0-7, and the three programs read masks only per lane and through `s_wqm`, whose quads lie inside a subgroup. The failing case is the only one that rebuilt a lane's bit from a compare's ballot word, and the wave64 form already used lane bits and passed on llvmpipe. - To check the cause on this machine, I built a local, uncommitted variant that ANDs every pixel ballot predicate with `!OpIsHelperInvocationEXT`, so helpers are left out of ballots as on llvmpipe. On ec04b0cf52 it fails with exactly the CI line, `incorrect=983 incorrect_edge=983` in `emulate0 wave32 mip0`. On 9b2aea4955 `agc_driver_pixel_helper_lane_masks` passes all 36 cases, and `agc_driver_pixel_helper_waterfall`, `agc_driver_pixel_helper_lanes` and `agc_driver_pixel_implicit_derivatives` pass too. - I have no lavapipe here, so this head has not run on llvmpipe yet. The only other narrow device on this machine, SwiftShader (subgroup size 4), lacks `VK_KHR_8bit_storage`, so the test skips there. CI's Linux lane is the narrow-subgroup check for this head. In a title: @hugodearaujo ran CONTROL Resonant (PPSA34547 01.300.300) on Linux, RX 9070 XT, RADV (Mesa 26.2.6), with #11580 in every build ([comment](https://github.com/boykopovar/AnyPS5/pull/12458#issuecomment-6568503634)). On `main` the GPU hung about 115 s after New Game, inside a pixel shader's waterfall over EXEC (`s_mov_b32 s80, exec` before `s_wqm_b32`). With ec04b0cf52 and no `APS5_LOOP_GUARD`, it did not hang in 900 s. The change in 9b2aea4955 was not run in a title. Limits of this testing: - I have no NVIDIA GPU, so the PPSA21564 picture is not reproduced here. On this RX 9070 XT `agc_driver_pixel_helper_lane_masks` passes on `main`, on this branch, and also with #11199's original recompiler change, so this card does not show the derivative regression. SeaSunPT's RTX 5070 Ti runs show the same: it also passes there with #11199's change. So it checks the intended per-lane values, but it is not a guard for the NVIDIA picture regression; `agc_driver_pixel_helper_waterfall` still covers the hang. On ec04b0cf52, @oneandonlydean's RTX 4090 passes both new tests, and in PPSA21564 the cloud-sea lines do not come back (0.38 at +100 s, against 0.57 on `main` and 0.69 after #11199). TechLevelZero's RTX 2000 Ada run shows no new failures or validation IDs. These runs were not repeated on 9b2aea4955. - I ran no title here, and nothing was run on a PS5. ### Checklist <!-- Rules behind each item: https://github.com/boykopovar/AnyPS5/blob/main/CONTRIBUTING.md --> - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: #11052 - [x] Unblocks: none - [x] GPUs tested: AMD Radeon RX 9070 XT, driver 32.0.31021.1015, Windows 11 26200 - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
MarcZX10 commented 2026-10-28 14:43:56 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-28T14:43:56Z.

Review: COMMENTED


I reviewed the exact head ec04b0cf52 against current main 446bd8776c; the merge tree is clean and git diff --check passes. The translator changes keep the per-lane EXEC mask alongside the guest-visible words for pixel s_saveexec and exact-mask s_mov_b64, while other shader stages retain their existing word-copy behavior. The new waterfall and lane-mask tests exercise wave32/64 and barycentric modes; the author reports the focused Vulkan comparison on the RX 9070 XT with 0 validation errors. I could not run these GPU tests on this host (Matrox G200eW). Since #12298 records the derivative regression on RTX 4090 and the PR body asks for that cross-vendor run, I am leaving approval pending that evidence; the current CI run does not provide that GPU coverage.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5684535439 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12458#pullrequestreview-5684535439). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-28T14:43:56Z. **Review:** COMMENTED --- I reviewed the exact head `ec04b0cf52` against current `main` `446bd8776c`; the merge tree is clean and `git diff --check` passes. The translator changes keep the per-lane EXEC mask alongside the guest-visible words for pixel `s_saveexec` and exact-mask `s_mov_b64`, while other shader stages retain their existing word-copy behavior. The new waterfall and lane-mask tests exercise wave32/64 and barycentric modes; the author reports the focused Vulkan comparison on the RX 9070 XT with 0 validation errors. I could not run these GPU tests on this host (Matrox G200eW). Since #12298 records the derivative regression on RTX 4090 and the PR body asks for that cross-vendor run, I am leaving approval pending that evidence; the current CI run does not provide that GPU coverage.
MarcZX10 commented 2026-10-30 06:34:45 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-30T06:34:45Z.

Review: DISMISSED


Reviewed — changes requested

The new NVIDIA GPU report is useful, but the previously reported llvmpipe subgroup-size-8 failure remains unresolved and the current hosted Linux job is skipped.

What I ran

  • Exact PR head: ec04b0cf52642d9b169b0e69bfc5bb55e07a56b9; PR base: 04fefebe901d9ff4b29acc7d6c4c28d66643d86f; current main: 47cdccde40bca36c1203ec498d9ff47f23bc6537.
  • Merge preview against current main: clean, tree 4eed75f2fe8c52fcce82ef84c6f81135bcabbe6e.
  • Environment: Linux x86_64, Git 2.39.5. I did not build or run GPU tests locally.
  • Commands:
git merge-tree --write-tree refs/remotes/upstream/main refs/pr/12458
git diff --check refs/remotes/upstream/main...refs/pr/12458
python3 tools/check_conventions.py --base refs/remotes/upstream/main --head refs/pr/12458
gh pr checks 12458 --repo boykopovar/AnyPS5

Results

Check Result
Merge preview Clean.
Diff check Passed with no output.
Conventions Passed.
Hosted checks Windows and relinker jobs pass; the Linux job is skipped.
New NVIDIA report Reports 2,262 selected tests passing, 5 failing with zero new failures relative to main, and no new Vulkan validation IDs. This report is on the exact PR head but does not exercise llvmpipe's subgroup-size-8 path.
Unedited check output
4eed75f2fe8c52fcce82ef84c6f81135bcabbe6e
All conventions checks passed.
conventions	pass	14s	https://github.com/boykopovar/AnyPS5/actions/runs/40786762381/job/123161791712
eligibility	pass	7s	https://github.com/boykopovar/AnyPS5/actions/runs/40707491103/job/122883424407
intake	pass	20s	https://github.com/boykopovar/AnyPS5/actions/runs/40707486841/job/122883414478
labels	pass	7s	https://github.com/boykopovar/AnyPS5/actions/runs/40786762219/job/123161790792
relinker (macos-latest, clang++)	pass	5m26s	https://github.com/boykopovar/AnyPS5/actions/runs/40707491103/job/122884545137
relinker (macos-latest, clang++, x86_64)	pass	7m24s	https://github.com/boykopovar/AnyPS5/actions/runs/40707491103/job/122884545179
relinker (ubuntu-latest, g++)	pass	3m9s	https://github.com/boykopovar/AnyPS5/actions/runs/40707491103/job/122884544925
relinker (windows-latest, g++)	pass	5m59s	https://github.com/boykopovar/AnyPS5/actions/runs/40707491103/job/122884545213
relinker-asan	pass	1m56s	https://github.com/boykopovar/AnyPS5/actions/runs/40707491103/job/122884544919
linux	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/40707491103/job/122884548566
register-context	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/40707491103/job/122884548196
write-watch	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/40707491103/job/122884547459
report	pass	40s	https://github.com/boykopovar/AnyPS5/actions/runs/40707491065/job/122883422524
windows	pass	3m25s	https://github.com/boykopovar/AnyPS5/actions/runs/40707491103/job/122884544901

Findings

Blocking

The test unconditionally runs wave32 cases after checking only for geometryShader; it does not check whether the host subgroup can execute the requested wave width. An earlier test report in this thread says llvmpipe (subgroup size 8) ran agc_driver_pixel_helper_lane_masks and produced 983 incorrect pixels in a wave32 case. The new NVIDIA report is on a device with a different subgroup configuration and does not resolve that failure. Please determine whether this path is supported: fix the behavior if it is, or add a precise capability precondition and an explicit skip if it is not. Then report a focused lavapipe or other narrow-subgroup run on the updated head.

Sources

Not verified

I did not reproduce the llvmpipe failure or run a GPU test locally. The llvmpipe failure and NVIDIA results are contributor-reported; the current hosted Linux job is skipped.

To get this to a good state

Resolve the narrow-subgroup behavior or add a justified capability skip, then provide the focused low-subgroup result. I will rerun the same source checks and inspect the exact new head and CI.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5708856790 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12458#pullrequestreview-5708856790). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-30T06:34:45Z. **Review:** DISMISSED --- # Reviewed — changes requested The new NVIDIA GPU report is useful, but the previously reported llvmpipe subgroup-size-8 failure remains unresolved and the current hosted Linux job is skipped. ## What I ran - Exact PR head: `ec04b0cf52642d9b169b0e69bfc5bb55e07a56b9`; PR base: `04fefebe901d9ff4b29acc7d6c4c28d66643d86f`; current `main`: `47cdccde40bca36c1203ec498d9ff47f23bc6537`. - Merge preview against current `main`: clean, tree `4eed75f2fe8c52fcce82ef84c6f81135bcabbe6e`. - Environment: Linux x86_64, Git 2.39.5. I did not build or run GPU tests locally. - Commands: ```sh git merge-tree --write-tree refs/remotes/upstream/main refs/pr/12458 git diff --check refs/remotes/upstream/main...refs/pr/12458 python3 tools/check_conventions.py --base refs/remotes/upstream/main --head refs/pr/12458 gh pr checks 12458 --repo boykopovar/AnyPS5 ``` ## Results | Check | Result | |---|---| | Merge preview | Clean. | | Diff check | Passed with no output. | | Conventions | Passed. | | Hosted checks | Windows and relinker jobs pass; the Linux job is skipped. | | New NVIDIA report | Reports 2,262 selected tests passing, 5 failing with zero new failures relative to `main`, and no new Vulkan validation IDs. This report is on the exact PR head but does not exercise llvmpipe's subgroup-size-8 path. | <details> <summary>Unedited check output</summary> ```text 4eed75f2fe8c52fcce82ef84c6f81135bcabbe6e All conventions checks passed. conventions pass 14s https://github.com/boykopovar/AnyPS5/actions/runs/40786762381/job/123161791712 eligibility pass 7s https://github.com/boykopovar/AnyPS5/actions/runs/40707491103/job/122883424407 intake pass 20s https://github.com/boykopovar/AnyPS5/actions/runs/40707486841/job/122883414478 labels pass 7s https://github.com/boykopovar/AnyPS5/actions/runs/40786762219/job/123161790792 relinker (macos-latest, clang++) pass 5m26s https://github.com/boykopovar/AnyPS5/actions/runs/40707491103/job/122884545137 relinker (macos-latest, clang++, x86_64) pass 7m24s https://github.com/boykopovar/AnyPS5/actions/runs/40707491103/job/122884545179 relinker (ubuntu-latest, g++) pass 3m9s https://github.com/boykopovar/AnyPS5/actions/runs/40707491103/job/122884544925 relinker (windows-latest, g++) pass 5m59s https://github.com/boykopovar/AnyPS5/actions/runs/40707491103/job/122884545213 relinker-asan pass 1m56s https://github.com/boykopovar/AnyPS5/actions/runs/40707491103/job/122884544919 linux skipping 0 https://github.com/boykopovar/AnyPS5/actions/runs/40707491103/job/122884548566 register-context skipping 0 https://github.com/boykopovar/AnyPS5/actions/runs/40707491103/job/122884548196 write-watch skipping 0 https://github.com/boykopovar/AnyPS5/actions/runs/40707491103/job/122884547459 report pass 40s https://github.com/boykopovar/AnyPS5/actions/runs/40707491065/job/122883422524 windows pass 3m25s https://github.com/boykopovar/AnyPS5/actions/runs/40707491103/job/122884544901 ``` </details> ## Findings ### Blocking The test unconditionally runs wave32 cases after checking only for `geometryShader`; it does not check whether the host subgroup can execute the requested wave width. An earlier test report in this thread says llvmpipe (subgroup size 8) ran `agc_driver_pixel_helper_lane_masks` and produced 983 incorrect pixels in a wave32 case. The new NVIDIA report is on a device with a different subgroup configuration and does not resolve that failure. Please determine whether this path is supported: fix the behavior if it is, or add a precise capability precondition and an explicit skip if it is not. Then report a focused lavapipe or other narrow-subgroup run on the updated head. ## Sources - [Wave32/wave64 cases run without a subgroup-width precondition at head `ec04b0cf52642d9b169b0e69bfc5bb55e07a56b9`](https://github.com/boykopovar/AnyPS5/blob/ec04b0cf52642d9b169b0e69bfc5bb55e07a56b9/core/libs/prx/libSceAgcDriver/tests/execution/PixelHelperLaneMasks.cpp#L196-L208) - [Earlier llvmpipe failure report and requested follow-up](https://github.com/boykopovar/AnyPS5/pull/12458#issuecomment-6489990429) - [New NVIDIA run on the same head](https://github.com/boykopovar/AnyPS5/pull/12458#issuecomment-6516397488) - [Current hosted Linux job](https://github.com/boykopovar/AnyPS5/actions/runs/40707491103/job/122884548566) ## Not verified I did not reproduce the llvmpipe failure or run a GPU test locally. The llvmpipe failure and NVIDIA results are contributor-reported; the current hosted Linux job is skipped. ## To get this to a good state Resolve the narrow-subgroup behavior or add a justified capability skip, then provide the focused low-subgroup result. I will rerun the same source checks and inspect the exact new head and CI.
XairRrR commented 2026-11-03 11:14:36 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-11-03T11:14:36Z.

Review: APPROVED


Reviewed — approved

At head 9b2aea4955, agc_driver_pixel_helper_lane_masks passes all 36 cases on lavapipe (subgroup size 8). That is the narrow-subgroup run MarcZX10's change request asks for. With main's recompiler files the same test fails with the exact line CI reported, and I found nothing blocking.

What I ran

Head 9b2aea4955e187f6d3d3a29921b4abb167c3e6ab, main 4f41f4c375f5abb487dbd184fbc150f31994d762, merged tree 2ba05bd0dd7020e526016bf81a41e569ae4f970e. Debian 13 VM (Intel Xeon Gold 6136, AVX2/FMA), GCC 14.2.0, Release, Vulkan through lavapipe (Mesa 26.1.6, LLVM 19, subgroup size 8). No GPU.

git diff --check 4f41f4c375f5abb487dbd184fbc150f31994d762...9b2aea4955e187f6d3d3a29921b4abb167c3e6ab
python3 tools/check_conventions.py --base 4f41f4c375f5abb487dbd184fbc150f31994d762
env VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 VK_LOADER_DEBUG=error,warn,layer \
  ctest --test-dir build -V -j8 --test-load 32 --output-on-failure \
  -R "agc_driver_pixel_helper|agc_driver_pixel_implicit_derivatives|agc_driver_wave32_exec_lane_bits|agc_shader_memory|agc_shader_quad_mask_no_demote"
# negative control: the 4 core/shader files restored from main
ninja -C build -j32 -l32 agc_driver_pixel_helper_lane_masks_tests agc_driver_pixel_helper_waterfall_tests
ctest --test-dir build -R "agc_driver_pixel_helper_(lane_masks|waterfall)" --output-on-failure
# where the new VUID comes from: same test with main's recompiler files, then with the merged files
env VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 ctest --test-dir build -V -R "^agc_driver_native_depth_uniform_planes$"
git status --porcelain

Results

Check Result
Merge into main Clean (merged by the script)
git diff --check No output
check_conventions.py All conventions checks passed
Build (selected targets, libs) OK
Selected test run (2165 tests) No new failures and no timeouts. 7 known failures (denormal and division tests, one unwrap test) also fail on main
agc_driver_pixel_helper_lane_masks (lavapipe, layer loaded) Passed in 3.2 s. All 36 cases print inside=6696 edge=1121 incorrect=0 incorrect_edge=0, including compare masks combined by a scalar AND, emulate0 wave32 mip0
agc_driver_pixel_helper_waterfall, agc_driver_pixel_helper_lanes Skipped: subgroup size 8 cannot hold a wave32
agc_driver_pixel_implicit_derivatives, agc_driver_wave32_exec_lane_bits, agc_shader_memory, agc_shader_quad_mask_no_demote Passed
Validation layer Insert instance layer "VK_LAYER_KHRONOS_validation" in every Vulkan test; no was not found but was requested line; 0 VUID- lines in the focused set
build.json new_vuid: agc_driver_native_depth_uniform_planes (VUID-vkCmdDispatch-groupCountX-00386) Comes from main, not this PR. The test was added on main after the baseline, and the same 4 errors appear with main's recompiler files
Focused run, summary
1/7 Test #1405: agc_driver_pixel_helper_waterfall .......***Skipped   0.13 sec
2/7 Test #1404: agc_driver_pixel_helper_lanes ...........***Skipped   0.13 sec
3/7 Test #2169: agc_shader_quad_mask_no_demote ..........   Passed    0.14 sec
4/7 Test #1580: agc_driver_wave32_exec_lane_bits ........   Passed    0.16 sec
5/7 Test #1406: agc_driver_pixel_implicit_derivatives ...   Passed    1.27 sec
6/7 Test #1403: agc_driver_pixel_helper_lane_masks ......   Passed    3.23 sec
7/7 Test #2177: agc_shader_memory .......................   Passed    8.84 sec
100% tests passed, 0 tests failed out of 7

Negative control

I restored TranslationContext.hpp, ControlFlowInstructions.cpp, ScalarInstructions.cpp and TranslationContext/ExecMask.cpp from main, kept the two new tests, and rebuilt. agc_driver_pixel_helper_lane_masks fails:

compare masks combined by a scalar AND, emulate0 wave32 mip0: inside=6696 edge=1121 incorrect=983 incorrect_edge=983
AGC graphics: compare masks combined by a scalar AND, emulate0 wave32 mip0: implicit derivatives selected the wrong mip at 983 pixels, 983 of them in partly covered quads

This is the same line oneandonlydean reported from CI on ec04b0cf52. So the test catches the wave32 sU32Mask gap on a driver that leaves helpers out of ballots, and the second commit closes it. The author's cause analysis matches what I saw. agc_driver_pixel_helper_waterfall skips on this device, so I could not run a negative control for it here. After restoring the merged files and rebuilding, the lane-mask test passes again and git status --porcelain is empty.

On MarcZX10's blocking finding (no subgroup-width precondition): it was a real translator bug, not a missing skip, and on this head the test passes on a subgroup-size-8 device without a skip. I consider that finding resolved by this run.

Findings

Blocking

None.

Non-blocking

  • Debt entry slightly overstates s_mov_b32 for wave64 (docs/dev/debt/shader.md:119). The entry says that in a pixel program, copying EXEC to an SGPR with s_mov_b32 keeps each lane's bit. The lane-bit path in sU32Mask (core/shader/recompiler/Translation/src/ScalarInstructions.cpp:19) still requires program.WaveSize() == 32u. As I read it, a wave64 pixel program doing s_mov_b32 sN, exec_lo / s_mov_b32 exec_lo, sN still rebuilds the bits from the ballot-masked word. Suggested fix: say "in wave32" for s_mov_b32 and the 32-bit logic ops, or list the wave64 half-word copy among the paths that keep only the value.
  • Wider IR in every wave32 pixel program (core/shader/recompiler/Translation/src/ScalarInstructions.cpp:17). involved is now true for every pixel-stage s_mov_b32 and 32-bit logic op with SGPR or constant operands, including non-mask data such as descriptor words. The result stays correct, because an untagged register falls back to threadBit through SelectU1 with a false tag. But each such op now emits the per-lane mask bookkeeping. Presumably dead-code elimination removes the unused parts. No action needed unless shader size or compile time shows a regression.

Not verified

  • agc_driver_pixel_helper_waterfall and agc_driver_pixel_helper_lanes skip on lavapipe (subgroup size 8), so this machine did not check the waterfall hang fix (#11052). CI's lavapipe lane will skip them too. The coverage comes from the author's RX 9070 XT runs, TechLevelZero's RTX 2000 Ada report on this head, and earlier NVIDIA runs on ec04b0cf52.
  • No NVIDIA or AMD hardware here. I did not reproduce the PPSA21564 edge-line regression from #11199, and I ran no title. The CONTROL Resonant and PPSA21564 results are contributor reports, and the PPSA21564 one is on ec04b0cf52, not this head.
  • Nothing was checked on a PS5.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5751174374 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12458#pullrequestreview-5751174374). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-11-03T11:14:36Z. **Review:** APPROVED --- # Reviewed — approved At head `9b2aea4955`, `agc_driver_pixel_helper_lane_masks` passes all 36 cases on lavapipe (subgroup size 8). That is the narrow-subgroup run MarcZX10's change request asks for. With `main`'s recompiler files the same test fails with the exact line CI reported, and I found nothing blocking. ## What I ran Head `9b2aea4955e187f6d3d3a29921b4abb167c3e6ab`, `main` `4f41f4c375f5abb487dbd184fbc150f31994d762`, merged tree `2ba05bd0dd7020e526016bf81a41e569ae4f970e`. Debian 13 VM (Intel Xeon Gold 6136, AVX2/FMA), GCC 14.2.0, Release, Vulkan through lavapipe (Mesa 26.1.6, LLVM 19, subgroup size 8). No GPU. ```sh git diff --check 4f41f4c375f5abb487dbd184fbc150f31994d762...9b2aea4955e187f6d3d3a29921b4abb167c3e6ab python3 tools/check_conventions.py --base 4f41f4c375f5abb487dbd184fbc150f31994d762 env VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 VK_LOADER_DEBUG=error,warn,layer \ ctest --test-dir build -V -j8 --test-load 32 --output-on-failure \ -R "agc_driver_pixel_helper|agc_driver_pixel_implicit_derivatives|agc_driver_wave32_exec_lane_bits|agc_shader_memory|agc_shader_quad_mask_no_demote" # negative control: the 4 core/shader files restored from main ninja -C build -j32 -l32 agc_driver_pixel_helper_lane_masks_tests agc_driver_pixel_helper_waterfall_tests ctest --test-dir build -R "agc_driver_pixel_helper_(lane_masks|waterfall)" --output-on-failure # where the new VUID comes from: same test with main's recompiler files, then with the merged files env VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 ctest --test-dir build -V -R "^agc_driver_native_depth_uniform_planes$" git status --porcelain ``` ## Results | Check | Result | |---|---| | Merge into `main` | Clean (merged by the script) | | `git diff --check` | No output | | `check_conventions.py` | All conventions checks passed | | Build (selected targets, `libs`) | OK | | Selected test run (2165 tests) | No new failures and no timeouts. 7 known failures (denormal and division tests, one unwrap test) also fail on `main` | | `agc_driver_pixel_helper_lane_masks` (lavapipe, layer loaded) | Passed in 3.2 s. All 36 cases print `inside=6696 edge=1121 incorrect=0 incorrect_edge=0`, including `compare masks combined by a scalar AND, emulate0 wave32 mip0` | | `agc_driver_pixel_helper_waterfall`, `agc_driver_pixel_helper_lanes` | Skipped: `subgroup size 8 cannot hold a wave32` | | `agc_driver_pixel_implicit_derivatives`, `agc_driver_wave32_exec_lane_bits`, `agc_shader_memory`, `agc_shader_quad_mask_no_demote` | Passed | | Validation layer | `Insert instance layer "VK_LAYER_KHRONOS_validation"` in every Vulkan test; no `was not found but was requested` line; 0 `VUID-` lines in the focused set | | build.json `new_vuid`: `agc_driver_native_depth_uniform_planes` (`VUID-vkCmdDispatch-groupCountX-00386`) | Comes from `main`, not this PR. The test was added on `main` after the baseline, and the same 4 errors appear with `main`'s recompiler files | <details><summary>Focused run, summary</summary> ``` 1/7 Test #1405: agc_driver_pixel_helper_waterfall .......***Skipped 0.13 sec 2/7 Test #1404: agc_driver_pixel_helper_lanes ...........***Skipped 0.13 sec 3/7 Test #2169: agc_shader_quad_mask_no_demote .......... Passed 0.14 sec 4/7 Test #1580: agc_driver_wave32_exec_lane_bits ........ Passed 0.16 sec 5/7 Test #1406: agc_driver_pixel_implicit_derivatives ... Passed 1.27 sec 6/7 Test #1403: agc_driver_pixel_helper_lane_masks ...... Passed 3.23 sec 7/7 Test #2177: agc_shader_memory ....................... Passed 8.84 sec 100% tests passed, 0 tests failed out of 7 ``` </details> ## Negative control I restored `TranslationContext.hpp`, `ControlFlowInstructions.cpp`, `ScalarInstructions.cpp` and `TranslationContext/ExecMask.cpp` from `main`, kept the two new tests, and rebuilt. `agc_driver_pixel_helper_lane_masks` fails: ``` compare masks combined by a scalar AND, emulate0 wave32 mip0: inside=6696 edge=1121 incorrect=983 incorrect_edge=983 AGC graphics: compare masks combined by a scalar AND, emulate0 wave32 mip0: implicit derivatives selected the wrong mip at 983 pixels, 983 of them in partly covered quads ``` This is the same line oneandonlydean reported from CI on `ec04b0cf52`. So the test catches the wave32 `sU32Mask` gap on a driver that leaves helpers out of ballots, and the second commit closes it. The author's cause analysis matches what I saw. `agc_driver_pixel_helper_waterfall` skips on this device, so I could not run a negative control for it here. After restoring the merged files and rebuilding, the lane-mask test passes again and `git status --porcelain` is empty. On MarcZX10's blocking finding (no subgroup-width precondition): it was a real translator bug, not a missing skip, and on this head the test passes on a subgroup-size-8 device without a skip. I consider that finding resolved by this run. ## Findings ### Blocking None. ### Non-blocking - **Debt entry slightly overstates `s_mov_b32` for wave64** (`docs/dev/debt/shader.md:119`). The entry says that in a pixel program, copying EXEC to an SGPR with `s_mov_b32` keeps each lane's bit. The lane-bit path in `sU32Mask` (`core/shader/recompiler/Translation/src/ScalarInstructions.cpp:19`) still requires `program.WaveSize() == 32u`. As I read it, a wave64 pixel program doing `s_mov_b32 sN, exec_lo` / `s_mov_b32 exec_lo, sN` still rebuilds the bits from the ballot-masked word. Suggested fix: say "in wave32" for `s_mov_b32` and the 32-bit logic ops, or list the wave64 half-word copy among the paths that keep only the value. - **Wider IR in every wave32 pixel program** (`core/shader/recompiler/Translation/src/ScalarInstructions.cpp:17`). `involved` is now true for every pixel-stage `s_mov_b32` and 32-bit logic op with SGPR or constant operands, including non-mask data such as descriptor words. The result stays correct, because an untagged register falls back to `threadBit` through `SelectU1` with a false tag. But each such op now emits the per-lane mask bookkeeping. Presumably dead-code elimination removes the unused parts. No action needed unless shader size or compile time shows a regression. ## Not verified - `agc_driver_pixel_helper_waterfall` and `agc_driver_pixel_helper_lanes` skip on lavapipe (subgroup size 8), so this machine did not check the waterfall hang fix (#11052). CI's lavapipe lane will skip them too. The coverage comes from the author's RX 9070 XT runs, TechLevelZero's RTX 2000 Ada report on this head, and earlier NVIDIA runs on `ec04b0cf52`. - No NVIDIA or AMD hardware here. I did not reproduce the PPSA21564 edge-line regression from #11199, and I ran no title. The CONTROL Resonant and PPSA21564 results are contributor reports, and the PPSA21564 one is on `ec04b0cf52`, not this head. - Nothing was checked on a PS5. <!-- anyps5-bots job=2032 head=9b2aea4955e187f6d3d3a29921b4abb167c3e6ab -->
Sign in to join this conversation.
No reviewers
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!12458
No description provided.