fix(shader): keep pixel helper lanes out of guest lane masks #11199

Merged
QRMOE merged 1 commit from upstream-pr/11199 into main 2026-10-28 07:54:17 +00:00
QRMOE commented 2026-10-25 21:42:15 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by QRMOE on 2026-10-25T21:42:15Z.


What

A pixel program's waterfall loop over a saved whole-quad EXEC (s_wqm_b64, then s_ff1_i32_b64 / v_readlane_b32 / v_cmp_eq_u32 into an SGPR / s_andn2_b64 until the mask is empty) never ended on an RX 9070 XT, so RESIDENT EVIL requiem (PPSA31246) lost the device in its intro (#11052). hostExecWord expands pixel-stage EXEC reads to whole quads (#6291), so the saved mask held helper lanes. The host's subgroup ballot and shuffle leave helper invocations out, which Vulkan allows, and on this driver helper invocations did not run the shader's ordinary instructions at all. v_readlane_b32 of a helper lane returned no key, the compare matched no lane, and the helper's bit was never cleared.

Pixel-stage ballots and EXEC reads now count only lanes that are not helper invocations, so guest SGPR masks, lane picks and lane counts never name a helper lane. Writing EXEC from a value keeps a helper invocation active while a live lane of its quad is, so #6291's save/restore after s_wqm still runs the quad's helpers for implicit-LOD sampling. That rule is built as one lane mask (mask | (WQM(mask) & helper lanes)), so the row and half-wave reduction matcher still recognises an all-lane EXEC.

Unlike the console, a program that reads a helper lane's value or waterfalls over helper lanes now skips them; the shader debt entry says so.

Tried and dropped, both measured on the same GPU:

  • RequireFullQuadsKHR (VK_KHR_shader_quad_control, which this driver exposes) on pixel programs that ballot or shuffle: the same device loss with the mode in the compiled modules. In a shader without derivatives no helper lanes were launched with it.
  • Reading helper lanes through OpGroupNonUniformQuadBroadcast: helper lanes held 0 for values computed outside a derivative chain, so the compare cleared every helper bit in one pass.

Tested

Windows 11 Home 26200, Ryzen 7 9800X3D, AMD Radeon RX 9070 XT (AMD 32.0.31021.1015, Vulkan 1.4.349), WinLibs GCC 15.2.0 r7, Release, on main baabfbc204.

  • New agc_driver_pixel_helper_waterfall, wave64 and wave32: the pixel program samples a texture with implicit LOD, so the driver launches helper lanes. It copies EXEC after s_wqm_b64 and waterfalls over the copy with s_ff1_i32_b64, v_readlane_b32, v_cmp_eq_u32 and s_andn2_b64, with an 80-pass cap. Each live lane stores the pass count and the XOR of the keys it read; the check compares them with the wave's live pixels from coverage. Most selected lanes sit in another quad than the reader.
    • On main: 80 passes over a wave of 26 live lanes, the cap. Without the cap the loop does not end.
    • With this PR: one pass per live lane, and every live key read once.
  • #6291's agc_driver_pixel_implicit_derivatives passes, as do agc_driver_pixel_helper_lanes, agc_driver_pixel_row_reduction, agc_shader_memory and agc_shader_entry_lane_proof_budget. The s_wqm condition keeps EXEC writes exact in programs that never enter whole-quad mode; without it the last two lost their upper-lane proofs on a 32-lane host.
  • tools/select_tests.py selected 1479 of 2378 tests for this diff. Run on main and on this branch on the same machine with ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1, -j4:
    • main: 7 failures, the 6 below plus the new test.
    • This branch: 6 failures, all also failing on main: select_tests, nid_database_cache, agc_host_import_cut_lifetime, agc_driver_depth_plane_partial_store, agc_driver_sample_order_grid_reference, loadexec_arguments (timeout).
  • Title: RESIDENT EVIL requiem (PPSA31246, 01.200.000), on main 29ce6d87eb with #10935, #10304 and #9950 applied locally (without them it stops earlier).
    • Without this change, with APS5_LOOP_GUARD=100000, the guard trips at the waterfall exits of the intro scene's fragment programs; without the guard the device is lost (#11052).
    • With this change and the guard on, the guard never tripped. A run of the previous revision passed that scene and stopped later on guest writes over native multisample depth are not implemented; a run of this revision reached the title's main menu.
  • Khronos validation layer (Vulkan SDK 1.4.363.0), same machine and GPU, main baabfbc204 and this branch, ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, ctest --test-dir build -R <pattern> -V over 22 focused tests (the pixel helper, derivative, row reduction, EXEC interpolation, barycentric, DPP, subgroup and shader memory tests, and agc_driver_graphics; list in the comment below):
    • Neither log contains was not found but was requested by env var VK_INSTANCE_LAYERS; with VK_LOADER_DEBUG=layer the loader inserts VK_LAYER_KHRONOS_validation.
    • VUID- occurrences: 0 on main, 0 on this branch.
    • main: 21 of 22 pass (agc_driver_pixel_helper_waterfall fails). This branch: 22 of 22.
  • Not run: Linux, other vendors and the full CTest suite.
  • tools/check_conventions.py --base origin/main and tools/pr_overlap.py --branch fix/shader-pixel-helper-lane-masks pass (no overlap with open pull requests).

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: PPSA31246 #11599 (RESIDENT EVIL requiem)
  • GPUs tested: AMD Radeon RX 9070 XT, AMD driver 32.0.31021.1015 (Vulkan 1.4.349), Windows 11 Home 26200
  • AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5008996825 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11199). Originally posted by [QRMOE](https://github.com/QRMOE) on 2026-10-25T21:42:15Z. --- ### What A pixel program's waterfall loop over a saved whole-quad EXEC (`s_wqm_b64`, then `s_ff1_i32_b64` / `v_readlane_b32` / `v_cmp_eq_u32` into an SGPR / `s_andn2_b64` until the mask is empty) never ended on an RX 9070 XT, so RESIDENT EVIL requiem (PPSA31246) lost the device in its intro (#11052). `hostExecWord` expands pixel-stage EXEC reads to whole quads (#6291), so the saved mask held helper lanes. The host's subgroup ballot and shuffle leave helper invocations out, which Vulkan allows, and on this driver helper invocations did not run the shader's ordinary instructions at all. `v_readlane_b32` of a helper lane returned no key, the compare matched no lane, and the helper's bit was never cleared. Pixel-stage ballots and EXEC reads now count only lanes that are not helper invocations, so guest SGPR masks, lane picks and lane counts never name a helper lane. Writing EXEC from a value keeps a helper invocation active while a live lane of its quad is, so #6291's save/restore after `s_wqm` still runs the quad's helpers for implicit-LOD sampling. That rule is built as one lane mask (`mask | (WQM(mask) & helper lanes)`), so the row and half-wave reduction matcher still recognises an all-lane EXEC. Unlike the console, a program that reads a helper lane's value or waterfalls over helper lanes now skips them; the shader debt entry says so. Tried and dropped, both measured on the same GPU: - `RequireFullQuadsKHR` (VK_KHR_shader_quad_control, which this driver exposes) on pixel programs that ballot or shuffle: the same device loss with the mode in the compiled modules. In a shader without derivatives no helper lanes were launched with it. - Reading helper lanes through `OpGroupNonUniformQuadBroadcast`: helper lanes held 0 for values computed outside a derivative chain, so the compare cleared every helper bit in one pass. ### Tested Windows 11 Home 26200, Ryzen 7 9800X3D, AMD Radeon RX 9070 XT (AMD 32.0.31021.1015, Vulkan 1.4.349), WinLibs GCC 15.2.0 r7, Release, on `main` baabfbc204. - New `agc_driver_pixel_helper_waterfall`, wave64 and wave32: the pixel program samples a texture with implicit LOD, so the driver launches helper lanes. It copies EXEC after `s_wqm_b64` and waterfalls over the copy with `s_ff1_i32_b64`, `v_readlane_b32`, `v_cmp_eq_u32` and `s_andn2_b64`, with an 80-pass cap. Each live lane stores the pass count and the XOR of the keys it read; the check compares them with the wave's live pixels from coverage. Most selected lanes sit in another quad than the reader. - On `main`: 80 passes over a wave of 26 live lanes, the cap. Without the cap the loop does not end. - With this PR: one pass per live lane, and every live key read once. - #6291's `agc_driver_pixel_implicit_derivatives` passes, as do `agc_driver_pixel_helper_lanes`, `agc_driver_pixel_row_reduction`, `agc_shader_memory` and `agc_shader_entry_lane_proof_budget`. The `s_wqm` condition keeps EXEC writes exact in programs that never enter whole-quad mode; without it the last two lost their upper-lane proofs on a 32-lane host. - `tools/select_tests.py` selected 1479 of 2378 tests for this diff. Run on `main` and on this branch on the same machine with `ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1`, `-j4`: - `main`: 7 failures, the 6 below plus the new test. - This branch: 6 failures, all also failing on `main`: `select_tests`, `nid_database_cache`, `agc_host_import_cut_lifetime`, `agc_driver_depth_plane_partial_store`, `agc_driver_sample_order_grid_reference`, `loadexec_arguments` (timeout). - Title: RESIDENT EVIL requiem (PPSA31246, 01.200.000), on `main` 29ce6d87eb with #10935, #10304 and #9950 applied locally (without them it stops earlier). - Without this change, with `APS5_LOOP_GUARD=100000`, the guard trips at the waterfall exits of the intro scene's fragment programs; without the guard the device is lost (#11052). - With this change and the guard on, the guard never tripped. A run of the previous revision passed that scene and stopped later on `guest writes over native multisample depth are not implemented`; a run of this revision reached the title's main menu. - Khronos validation layer (Vulkan SDK 1.4.363.0), same machine and GPU, `main` baabfbc204 and this branch, `ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`, `ctest --test-dir build -R <pattern> -V` over 22 focused tests (the pixel helper, derivative, row reduction, EXEC interpolation, barycentric, DPP, subgroup and shader memory tests, and `agc_driver_graphics`; list in the comment below): - Neither log contains `was not found but was requested by env var VK_INSTANCE_LAYERS`; with `VK_LOADER_DEBUG=layer` the loader inserts `VK_LAYER_KHRONOS_validation`. - `VUID-` occurrences: 0 on `main`, 0 on this branch. - `main`: 21 of 22 pass (`agc_driver_pixel_helper_waterfall` fails). This branch: 22 of 22. - Not run: Linux, other vendors and the full CTest suite. - `tools/check_conventions.py --base origin/main` and `tools/pr_overlap.py --branch fix/shader-pixel-helper-lane-masks` pass (no overlap with open pull requests). ### 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: PPSA31246 #11599 (RESIDENT EVIL requiem) - [x] GPUs tested: AMD Radeon RX 9070 XT, AMD driver 32.0.31021.1015 (Vulkan 1.4.349), Windows 11 Home 26200 - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
MarcZX10 commented 2026-10-25 21:50:45 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-25T21:50:45Z.

Review: CHANGES_REQUESTED


The same-GPU functional runs are useful, including the title repro and baseline comparison. However, CONTRIBUTING.md requires shader-recompiler changes to rerun the focused tests on both main and the change with VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, ANYPS5_NO_SHADER_CACHE=1 and ANYPS5_REQUIRE_VULKAN=1, then compare the logs for newly introduced VUID- errors. The report says the validation layer was unavailable and no VUID comparison was run. Please provide that required same-machine/GPU comparison before this is ready for approval; the skipped hosted product jobs do not cover it.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5645504698 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11199#pullrequestreview-5645504698). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-25T21:50:45Z. **Review:** CHANGES_REQUESTED --- The same-GPU functional runs are useful, including the title repro and baseline comparison. However, `CONTRIBUTING.md` requires shader-recompiler changes to rerun the focused tests on both `main` and the change with `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`, `ANYPS5_NO_SHADER_CACHE=1` and `ANYPS5_REQUIRE_VULKAN=1`, then compare the logs for newly introduced `VUID-` errors. The report says the validation layer was unavailable and no VUID comparison was run. Please provide that required same-machine/GPU comparison before this is ready for approval; the skipped hosted product jobs do not cover it.
MarcZX10 commented 2026-10-26 05:51:55 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-26T05:51:55Z.

Review: DISMISSED


The required validation comparison has now been supplied on the same RX 9070 XT machine: the loader confirms the Khronos layer loaded, neither log contains the missing-layer message, and both report zero VUID- occurrences. agc_driver_pixel_helper_waterfall fails on the reported main and passes on the PR; the 22-test comparison is 21/22 on main and 22/22 on the change. The separate multivendor suite and controlled baseline also support the fix. I audited the changed helper filtering, EXEC mask reconstruction, and focused test; I found no remaining functional blocker.

I cannot approve this integration point yet. tools/check_main_sync.py --base upstream/main --head 08dfcc028d47c9f38fb4faabb65e2106ea1ca5a0 reports 1 ahead and 477 behind current main (14c99b52ac); the merge preview is clean, with docs/dev/debt/shader.md changed on both sides. There are also textual conflicts with #11265 in TranslationContext.hpp and InstructionTranslator.cpp; both patches make adjacent translator-setup edits that appear composable, so I do not infer a functional dependency. Please refresh on current main, preserve both edits when resolving the open-PR overlap, and rerun the focused helper-waterfall test plus the required validation comparison on the resulting exact tree.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5647905324 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11199#pullrequestreview-5647905324). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-26T05:51:55Z. **Review:** DISMISSED --- The required validation comparison has now been supplied on the same RX 9070 XT machine: the loader confirms the Khronos layer loaded, neither log contains the missing-layer message, and both report zero `VUID-` occurrences. `agc_driver_pixel_helper_waterfall` fails on the reported main and passes on the PR; the 22-test comparison is 21/22 on main and 22/22 on the change. The separate multivendor suite and controlled baseline also support the fix. I audited the changed helper filtering, EXEC mask reconstruction, and focused test; I found no remaining functional blocker. I cannot approve this integration point yet. `tools/check_main_sync.py --base upstream/main --head 08dfcc028d47c9f38fb4faabb65e2106ea1ca5a0` reports 1 ahead and 477 behind current `main` (`14c99b52ac`); the merge preview is clean, with `docs/dev/debt/shader.md` changed on both sides. There are also textual conflicts with #11265 in `TranslationContext.hpp` and `InstructionTranslator.cpp`; both patches make adjacent translator-setup edits that appear composable, so I do not infer a functional dependency. Please refresh on current main, preserve both edits when resolving the open-PR overlap, and rerun the focused helper-waterfall test plus the required validation comparison on the resulting exact tree.
jotitadev commented 2026-10-27 07:53:35 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-27T07:53:35Z.

Review: COMMENTED


Linux NVIDIA and lavapipe run. The existing runs are RX 9070 XT on Windows, RDNA and lavapipe on Linux, and NVIDIA on Windows.

Setup: Ubuntu 26.04, GCC 15.2, Release. RTX 3070 (NVIDIA 595.99.02, subgroup 32) and lavapipe (Mesa 26.0.3, LLVM 21.1.8, subgroup 8), each selected with VK_DRIVER_FILES. Head 5f10d0a22 merged with --no-commit onto main b7105f728 (clean; it also merges cleanly onto 8df2c3ed0). Focused runs use ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation (Khronos layer 1.4.341). VK_LOADER_DEBUG=layer shows the layer inserted, and no log has the missing-layer message.

  • Control (main + only PixelHelperWaterfall.cpp): on the 3070, agc_driver_pixel_helper_waterfall fails differently from the RX 9070 XT. The loop ends, but makes one pass too many: pixel helper waterfall wave64: pixel 584 of the wave whose first lane is pixel 584 made 26 passes over 25 live lanes. That fits helper lanes that run the ordinary instructions on this driver: the helper's key is read once, the compare clears its bit, and the loop ends one pass late. The test still catches the bug there, as a wrong pass count rather than the cap. On lavapipe the test skips (subgroup size 8 cannot hold a wave32), so lavapipe gives no red/green signal for this PR. The same holds for agc_driver_pixel_helper_lanes.
  • With the PR, 3070: the 22 focused tests pass 3/3 (^agc_driver_pixel_, agc_driver_quad_pixel_mask, agc_shader_memory, agc_shader_entry_lane_proof_budget, agc_driver_graphics), including agc_driver_pixel_helper_waterfall, pixel_implicit_derivatives and pixel_row_reduction. 0 VUID-.
  • With the PR, lavapipe: 22/22 3/3 (the waterfall, helper-lane, LDS and valid-mask cases skip on subgroup size). 0 VUID-.
  • ^agc suite (without display/flip/lds_atomics64, -j1 --timeout 30), compared with the same main:
    • 3070: 1043/1043. main was 1041/1042 here, with one agc_submit_progress_no_timeline failure that passed 3/3 alone right after. It looks flaky on a GPU shared with another run, and this PR doesn't touch it.
    • lavapipe: 1042/1043. The one failure is agc_driver_multisample_retirement, which fails the same way on main on this host.
  • Builds clean on Linux, so the sizeof asserts in ShaderDiskCache.cpp and PipelineJournal.cpp hold. public_headers passes with main 8df2c3ed0 (it fails on b7105f728 itself, which #11718 fixed).

GPUs tested: NVIDIA RTX 3070 (Linux), lavapipe

Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5663743195 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11199#pullrequestreview-5663743195). Originally posted by [jotitadev](https://github.com/jotitadev) on 2026-10-27T07:53:35Z. **Review:** COMMENTED --- Linux NVIDIA and lavapipe run. The existing runs are RX 9070 XT on Windows, RDNA and lavapipe on Linux, and NVIDIA on Windows. **Setup:** Ubuntu 26.04, GCC 15.2, Release. RTX 3070 (NVIDIA 595.99.02, subgroup 32) and lavapipe (Mesa 26.0.3, LLVM 21.1.8, subgroup 8), each selected with `VK_DRIVER_FILES`. Head `5f10d0a22` merged with `--no-commit` onto `main` `b7105f728` (clean; it also merges cleanly onto `8df2c3ed0`). Focused runs use `ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation` (Khronos layer 1.4.341). `VK_LOADER_DEBUG=layer` shows the layer inserted, and no log has the missing-layer message. - **Control (`main` + only `PixelHelperWaterfall.cpp`):** on the 3070, `agc_driver_pixel_helper_waterfall` fails differently from the RX 9070 XT. The loop ends, but makes one pass too many: `pixel helper waterfall wave64: pixel 584 of the wave whose first lane is pixel 584 made 26 passes over 25 live lanes`. That fits helper lanes that run the ordinary instructions on this driver: the helper's key is read once, the compare clears its bit, and the loop ends one pass late. The test still catches the bug there, as a wrong pass count rather than the cap. On lavapipe the test skips (`subgroup size 8 cannot hold a wave32`), so lavapipe gives no red/green signal for this PR. The same holds for `agc_driver_pixel_helper_lanes`. - **With the PR, 3070:** the 22 focused tests pass 3/3 (`^agc_driver_pixel_`, `agc_driver_quad_pixel_mask`, `agc_shader_memory`, `agc_shader_entry_lane_proof_budget`, `agc_driver_graphics`), including `agc_driver_pixel_helper_waterfall`, `pixel_implicit_derivatives` and `pixel_row_reduction`. 0 `VUID-`. - **With the PR, lavapipe:** 22/22 3/3 (the waterfall, helper-lane, LDS and valid-mask cases skip on subgroup size). 0 `VUID-`. - **`^agc` suite** (without display/flip/lds_atomics64, `-j1 --timeout 30`), compared with the same `main`: - 3070: 1043/1043. `main` was 1041/1042 here, with one `agc_submit_progress_no_timeline` failure that passed 3/3 alone right after. It looks flaky on a GPU shared with another run, and this PR doesn't touch it. - lavapipe: 1042/1043. The one failure is `agc_driver_multisample_retirement`, which fails the same way on `main` on this host. - Builds clean on Linux, so the `sizeof` asserts in `ShaderDiskCache.cpp` and `PipelineJournal.cpp` hold. `public_headers` passes with `main` `8df2c3ed0` (it fails on `b7105f728` itself, which #11718 fixed). GPUs tested: NVIDIA RTX 3070 (Linux), lavapipe Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
jotitadev commented 2026-10-27 09:32:27 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-27T09:32:27Z.

Review: COMMENTED


Apple GPU run of head 5f10d0a229: the new test catches the bug on MoltenVK too, but there it shows up as an extra waterfall pass, not a hang.

Setup: Apple M2 Max, macOS 27.2, x86-64 Release under Rosetta 2. main doesn't build and run on macOS, so this is main b87d3d87e2 + the macOS port PRs (#7631 #11249 #11358 #10669 #10552 #7804 #11447 #11437 #11554) + one local patch (#11705's), with this PR merged on top (clean). Two drivers: MoltenVK 1.4.2 from Vulkan SDK 1.4.363.0, and MoltenVK main with KhronosGroup/SPIRV-Cross#2704. ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1, ctest -j1 --timeout 30.

With this PR: the 22 tests from QRMOE's validation comparison pass 3 of 3 on both drivers. agc_driver_mesh_barycentric_emulation (no VK_EXT_mesh_shader) and agc_driver_pixel_implicit_derivatives (no geometryShader) skip on MoltenVK. With VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, the layer is inserted, nothing reports was not found but was requested, and there are 0 VUID- lines.

Red (this PR's tests, with the 6 non-test source files under core/shader taken back to the base): agc_driver_pixel_helper_waterfall fails 3 of 3 on both drivers and with the layer. The failure is the same every time:

pixel helper waterfall wave64: pixel 584 of the wave whose first lane is pixel 776 made 26 passes over 25 live lanes

There's no device loss and no timeout. On this GPU the loop ends, but it takes one pass more than there are live lanes. That fits helper invocations running the shader's ordinary instructions on Apple, unlike the RX 9070 XT: v_readlane_b32 of the helper lane returns a key, so the helper's bit gets cleared, but only after an extra pass. The test's pass count catches that case as well as the hang. agc_driver_pixel_helper_lanes passes on both sides.

Suite: ^agc (1041 tests, flip/display/lds_atomics64 excluded) gives the same failures as the base on both drivers: 41 with the SDK MoltenVK and 40 with MoltenVK main. Those are known macOS failures, and none of them involves pixel helpers or subgroups.

GPUs tested: Apple M2 Max (MoltenVK 1.4.2 / MoltenVK main + SPIRV-Cross#2704), macOS 27.2

Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5664913339 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11199#pullrequestreview-5664913339). Originally posted by [jotitadev](https://github.com/jotitadev) on 2026-10-27T09:32:27Z. **Review:** COMMENTED --- Apple GPU run of head `5f10d0a229`: the new test catches the bug on MoltenVK too, but there it shows up as an extra waterfall pass, not a hang. **Setup:** Apple M2 Max, macOS 27.2, x86-64 Release under Rosetta 2. `main` doesn't build and run on macOS, so this is `main` `b87d3d87e2` + the macOS port PRs (#7631 #11249 #11358 #10669 #10552 #7804 #11447 #11437 #11554) + one local patch (#11705's), with this PR merged on top (clean). Two drivers: MoltenVK 1.4.2 from Vulkan SDK 1.4.363.0, and MoltenVK `main` with KhronosGroup/SPIRV-Cross#2704. `ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1`, `ctest -j1 --timeout 30`. **With this PR:** the 22 tests from QRMOE's validation comparison pass 3 of 3 on both drivers. `agc_driver_mesh_barycentric_emulation` (no `VK_EXT_mesh_shader`) and `agc_driver_pixel_implicit_derivatives` (no `geometryShader`) skip on MoltenVK. With `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`, the layer is inserted, nothing reports `was not found but was requested`, and there are 0 `VUID-` lines. **Red** (this PR's tests, with the 6 non-test source files under `core/shader` taken back to the base): `agc_driver_pixel_helper_waterfall` fails 3 of 3 on both drivers and with the layer. The failure is the same every time: ``` pixel helper waterfall wave64: pixel 584 of the wave whose first lane is pixel 776 made 26 passes over 25 live lanes ``` There's no device loss and no timeout. On this GPU the loop ends, but it takes one pass more than there are live lanes. That fits helper invocations running the shader's ordinary instructions on Apple, unlike the RX 9070 XT: `v_readlane_b32` of the helper lane returns a key, so the helper's bit gets cleared, but only after an extra pass. The test's pass count catches that case as well as the hang. `agc_driver_pixel_helper_lanes` passes on both sides. **Suite:** `^agc` (1041 tests, flip/display/`lds_atomics64` excluded) gives the same failures as the base on both drivers: 41 with the SDK MoltenVK and 40 with MoltenVK `main`. Those are known macOS failures, and none of them involves pixel helpers or subgroups. GPUs tested: Apple M2 Max (MoltenVK 1.4.2 / MoltenVK main + SPIRV-Cross#2704), macOS 27.2 Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
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!11199
No description provided.