fix(shader): keep waves that end early at their workgroup's later barriers #26756

Open
androidbaklava wants to merge 3 commits from upstream-pr/26756 into main
androidbaklava commented 2026-11-24 20:09:12 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by androidbaklava on 2026-11-24T20:09:12Z.


What

In a guest compute program, a wave can branch to s_endpgm while the other waves of its workgroup still reach an s_barrier. On AMD hardware the ended wave simply stops counting at the barrier. The recompiler emits that branch as a structured selection whose merge is the program exit, so the later OpControlBarrier sits in control flow that only some invocations reach. Vulkan leaves that undefined. NVIDIA's and AMD's drivers happen to tolerate it, but Intel's Windows driver waits for the invocations that left: the device is lost about 3 s later (vkWaitSemaphoresKHR ...: Vulkan result -4).

This change keeps such a wave in the program instead. When a compute program with more than one wave per workgroup has a branch whose one side is the merge of its selection, the merge ends the program (no writes, no barrier), and the other side reaches an s_barrier, the branch always enters the body and records the leaving waves in a per-invocation flag. Every LDS, GDS, buffer, image and memory write is then emitted under that flag through the existing EmitUnlessInvocationFaulted path, so an ended wave changes nothing but reaches each barrier at the same instruction as the other waves. Programs without that pattern compile exactly as before. The new debt entry lists what this does not cover (an exit from inside a loop, or one reached through other blocks).

Found with Photo Splat VR (PPSA99770, from the homebrew catalog). On main it loses the device in every run at compute shader 0x200540500, the prefix scan of its splat radix sort: after its loop, s_cbranch_execz sends waves 4 to 7 to s_endpgm and waves 0 to 3 run two more barriers. Replaying that shader alone in a local test hung with one workgroup too. Edits to its SPIR-V showed that making all waves run the post-loop section, or removing both of its barriers, stops the hang, while giving the leaving waves the same number of barriers at a different instruction does not, so the waves have to reach the same barriers.

Tested

Windows 11 Home 10.0.26300, i7-13620H, Intel UHD Graphics 8086:a7a8 (Raptor Lake), driver 101.7084, WinLibs GCC 15.2.0 r7 UCRT, Release. main 2711791787 against this change from the same build tree.

New test agc_driver_ended_wave_barrier: eight waves (wave32, then wave64), waves 4 to 7 branch to s_endpgm, waves 0 to 3 write LDS, pass a barrier, read it back, pass a barrier and store. It checks the live threads' values and that the ended waves' outputs stay untouched. On main it loses the device in every run (3 of 3, plus the A/B run below); with this change it passes 3 of 3, both wave sizes.

Focused tests with ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation and VK_LOADER_DEBUG=layer (Khronos validation 1.4.363), ctest -R '^agc_driver_(ended_wave_barrier|lds_.*|ds_.*|wave.*|divergent_device_atomic_barrier|look_back_scan|relative_dpp|presentation_fsr|runtime_buffer_spans_fault_barrier)$' -V:

32 tests main this change
result 31 passed, ended_wave_barrier failed (Vulkan result -4) 32 passed
VUID- / SYNC-HAZARD lines 0 / 0 0 / 0

Both logs show Insert instance layer "VK_LAYER_KHRONOS_validation" for all 32 tests and neither shows was not found but was requested.

Full ctest -R ^agc -j 4 with this change: 2117 tests, 12 failed. Eleven are the Intel failures a full main run (5e9ad5f57b) has on this machine, covered by #20831, #21683, #21713, #21741, #21749, #24072 and #25608, plus host_import_failure_handles, which fails there too under parallel load. The twelfth, agc_driver_presentation_fsr, timed out once in that run; it passed 7 of 7 alone and 2 of 2 next to the heaviest AGC tests, and none of its shaders takes the new path (checked with a local print, not committed). The 29 non-GPU recompiler tests pass.

Photo Splat VR with this change: the radix sort runs and no device loss occurs. The title then stops at the known missing-barycentrics limit of this GPU (a pixel shader on the mesh path reads barycentrics, and this device has neither VK_KHR_fragment_shader_barycentric nor mesh shaders), so it is not playable here.

Not tested on NVIDIA or AMD, where the old SPIR-V did not hang. A program with this pattern now runs the rest of the program for the ended waves with their writes masked, which costs some time in those programs only.

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 and the licence notice of code adapted from upstream (see AGENTS.md)
  • 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: none
  • Unblocks: none
  • GPUs tested: Intel UHD Graphics (Raptor Lake, 8086:a7a8), driver 101.7084, Windows 11
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5479507783 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/26756). Originally posted by [androidbaklava](https://github.com/androidbaklava) on 2026-11-24T20:09:12Z. --- ### What In a guest compute program, a wave can branch to `s_endpgm` while the other waves of its workgroup still reach an `s_barrier`. On AMD hardware the ended wave simply stops counting at the barrier. The recompiler emits that branch as a structured selection whose merge is the program exit, so the later `OpControlBarrier` sits in control flow that only some invocations reach. Vulkan leaves that undefined. NVIDIA's and AMD's drivers happen to tolerate it, but Intel's Windows driver waits for the invocations that left: the device is lost about 3 s later (`vkWaitSemaphoresKHR ...: Vulkan result -4`). This change keeps such a wave in the program instead. When a compute program with more than one wave per workgroup has a branch whose one side is the merge of its selection, the merge ends the program (no writes, no barrier), and the other side reaches an `s_barrier`, the branch always enters the body and records the leaving waves in a per-invocation flag. Every LDS, GDS, buffer, image and memory write is then emitted under that flag through the existing `EmitUnlessInvocationFaulted` path, so an ended wave changes nothing but reaches each barrier at the same instruction as the other waves. Programs without that pattern compile exactly as before. The new debt entry lists what this does not cover (an exit from inside a loop, or one reached through other blocks). Found with Photo Splat VR (PPSA99770, from the homebrew catalog). On `main` it loses the device in every run at compute shader `0x200540500`, the prefix scan of its splat radix sort: after its loop, `s_cbranch_execz` sends waves 4 to 7 to `s_endpgm` and waves 0 to 3 run two more barriers. Replaying that shader alone in a local test hung with one workgroup too. Edits to its SPIR-V showed that making all waves run the post-loop section, or removing both of its barriers, stops the hang, while giving the leaving waves the same number of barriers at a different instruction does not, so the waves have to reach the same barriers. ### Tested Windows 11 Home 10.0.26300, i7-13620H, Intel UHD Graphics `8086:a7a8` (Raptor Lake), driver 101.7084, WinLibs GCC 15.2.0 r7 UCRT, Release. `main` `2711791787` against this change from the same build tree. New test `agc_driver_ended_wave_barrier`: eight waves (wave32, then wave64), waves 4 to 7 branch to `s_endpgm`, waves 0 to 3 write LDS, pass a barrier, read it back, pass a barrier and store. It checks the live threads' values and that the ended waves' outputs stay untouched. On `main` it loses the device in every run (3 of 3, plus the A/B run below); with this change it passes 3 of 3, both wave sizes. Focused tests with `ANYPS5_REQUIRE_VULKAN=1`, `ANYPS5_NO_SHADER_CACHE=1`, `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation` and `VK_LOADER_DEBUG=layer` (Khronos validation 1.4.363), `ctest -R '^agc_driver_(ended_wave_barrier|lds_.*|ds_.*|wave.*|divergent_device_atomic_barrier|look_back_scan|relative_dpp|presentation_fsr|runtime_buffer_spans_fault_barrier)$' -V`: | 32 tests | `main` | this change | |---|---|---| | result | 31 passed, `ended_wave_barrier` failed (`Vulkan result -4`) | 32 passed | | `VUID-` / `SYNC-HAZARD` lines | 0 / 0 | 0 / 0 | Both logs show `Insert instance layer "VK_LAYER_KHRONOS_validation"` for all 32 tests and neither shows `was not found but was requested`. Full `ctest -R ^agc -j 4` with this change: 2117 tests, 12 failed. Eleven are the Intel failures a full `main` run (`5e9ad5f57b`) has on this machine, covered by #20831, #21683, #21713, #21741, #21749, #24072 and #25608, plus `host_import_failure_handles`, which fails there too under parallel load. The twelfth, `agc_driver_presentation_fsr`, timed out once in that run; it passed 7 of 7 alone and 2 of 2 next to the heaviest AGC tests, and none of its shaders takes the new path (checked with a local print, not committed). The 29 non-GPU recompiler tests pass. Photo Splat VR with this change: the radix sort runs and no device loss occurs. The title then stops at the known missing-barycentrics limit of this GPU (`a pixel shader on the mesh path reads barycentrics, and this device has neither VK_KHR_fragment_shader_barycentric nor mesh shaders`), so it is not playable here. Not tested on NVIDIA or AMD, where the old SPIR-V did not hang. A program with this pattern now runs the rest of the program for the ended waves with their writes masked, which costs some time in those programs only. ### 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) and the licence notice of code adapted from upstream (see AGENTS.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: none - [x] Unblocks: none - [x] GPUs tested: Intel UHD Graphics (Raptor Lake, 8086:a7a8), driver 101.7084, Windows 11 - [x] AI-assisted: yes
mihiii1337 commented 2026-11-24 20:59:07 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by mihiii1337 on 2026-11-24T20:59:07Z.

Review: CHANGES_REQUESTED


The production change is strongly supported by a physical Intel/NVIDIA A/B, but the new fixture should dispatch one workgroup before it can be relied on as a deterministic regression test.

EndedWaveBarrier.cpp allocates Output[Waves * 64], derives every store address only from LocalInvocationId, and disables all workgroup-ID inputs. With Groups = 16, all 16 workgroups therefore perform non-atomic stores to the same single-group output slots. The test only needs one group: Threads = 512 still gives eight waves and both workgroup barriers, including the early-ended waves. Please change Groups to 1 (or give each group a disjoint output region and validate all groups).

I tested exact head d1532fdeeb8fbcc820eb782b33d0c145c6d2e2b3, cleanly merged onto then-live main 61cce6e86b9bbafa91551f7eb46af8f94f00bcc4, with a local test-only one-line Groups=1 fixture applied identically to main and the candidate. Windows 11 build 26300, WinLibs GCC 15.2.0 r7, Release, shader cache disabled, pinned physical ICD, Khronos validation 1.4.369 with synchronization validation:

  • Intel UHD 8086:a78b, driver 101.6127 / Vulkan 1.3.295: main failed Wave32 in 3/3 fresh processes at round 0, thread 0 (0xdeadbeef, expected 1). The candidate passed Wave32 and Wave64 in 3/3 processes, including all live values and inactive sentinels.
  • A separate Wave64-only control (same Groups=1 fixture, only the Wave32 call omitted so fail-fast could not hide Wave64) failed on main in 3/3 processes at the same first live value and passed the candidate in 3/3, all 16 rounds.
  • NVIDIA RTX 4070 Laptop 10de:2860, driver 621.01 / Vulkan 1.4.357: main and candidate both passed Wave32 and Wave64 in 3/3 processes, providing the no-regression control.

Across the 18 primary and Wave64-control processes, the intended physical device and validation layer were confirmed, with no skips, fallback, VUID-, SYNC-HAZARD, missing-layer, or device-loss result. The newer main commits after 61cce6e8 do not touch AGC, shaders, or this fixture, and the head remains unchanged.

The stock Groups=16 binary was built and archived but is not counted in this A/B because of the shared-output race. After the one-line fixture correction, the hardware evidence supports the production fix.

No PS5/title run was performed.

AI-assisted: yes (OpenAI Codex); exact heads/merge trees, fixture blobs, binary hashes, device/layer selection, every CTest/JUnit result, live values, and sentinels were checked directly.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6047303051 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/26756#pullrequestreview-6047303051). Originally posted by [mihiii1337](https://github.com/mihiii1337) on 2026-11-24T20:59:07Z. **Review:** CHANGES_REQUESTED --- The production change is strongly supported by a physical Intel/NVIDIA A/B, but the new fixture should dispatch one workgroup before it can be relied on as a deterministic regression test. `EndedWaveBarrier.cpp` allocates `Output[Waves * 64]`, derives every store address only from `LocalInvocationId`, and disables all workgroup-ID inputs. With `Groups = 16`, all 16 workgroups therefore perform non-atomic stores to the same single-group output slots. The test only needs one group: `Threads = 512` still gives eight waves and both workgroup barriers, including the early-ended waves. Please change `Groups` to 1 (or give each group a disjoint output region and validate all groups). I tested exact head `d1532fdeeb8fbcc820eb782b33d0c145c6d2e2b3`, cleanly merged onto then-live `main` `61cce6e86b9bbafa91551f7eb46af8f94f00bcc4`, with a local test-only one-line `Groups=1` fixture applied identically to main and the candidate. Windows 11 build 26300, WinLibs GCC 15.2.0 r7, Release, shader cache disabled, pinned physical ICD, Khronos validation 1.4.369 with synchronization validation: - Intel UHD `8086:a78b`, driver 101.6127 / Vulkan 1.3.295: main failed Wave32 in 3/3 fresh processes at round 0, thread 0 (`0xdeadbeef`, expected 1). The candidate passed Wave32 and Wave64 in 3/3 processes, including all live values and inactive sentinels. - A separate Wave64-only control (same `Groups=1` fixture, only the Wave32 call omitted so fail-fast could not hide Wave64) failed on main in 3/3 processes at the same first live value and passed the candidate in 3/3, all 16 rounds. - NVIDIA RTX 4070 Laptop `10de:2860`, driver 621.01 / Vulkan 1.4.357: main and candidate both passed Wave32 and Wave64 in 3/3 processes, providing the no-regression control. Across the 18 primary and Wave64-control processes, the intended physical device and validation layer were confirmed, with no skips, fallback, `VUID-`, `SYNC-HAZARD`, missing-layer, or device-loss result. The newer main commits after `61cce6e8` do not touch AGC, shaders, or this fixture, and the head remains unchanged. The stock `Groups=16` binary was built and archived but is not counted in this A/B because of the shared-output race. After the one-line fixture correction, the hardware evidence supports the production fix. No PS5/title run was performed. AI-assisted: yes (OpenAI Codex); exact heads/merge trees, fixture blobs, binary hashes, device/layer selection, every CTest/JUnit result, live values, and sentinels were checked directly.
MarcZX10 commented 2026-11-25 14:18:49 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-25T14:18:49Z.

Review: APPROVED


Reviewed — looks good

Nothing in the inspected change blocks merging; the behavior is narrowly gated and the author reports focused Intel Vulkan validation coverage.

What I ran

Reviewed head d1532fdeeb8fbcc820eb782b33d0c145c6d2e2b3 against the prepared diff. I did not run commands or tests. Read the description, commits, manifest, diff, and all six changed files; no changed files were excluded in the manifest.

Results

Check Result Note
Code review passed Changed paths and relevant logic inspected
Tests not run Focused runs are author-reported
Negative control not run No local test execution

Findings

Blocking

None.

Non-blocking

None.

Not verified

The author-reported tests and Intel device behavior were not independently reproduced. NVIDIA and AMD behavior was not tested, as the description also notes. No files were excluded by rule.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6059318358 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/26756#pullrequestreview-6059318358). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-25T14:18:49Z. **Review:** APPROVED --- # Reviewed — looks good Nothing in the inspected change blocks merging; the behavior is narrowly gated and the author reports focused Intel Vulkan validation coverage. ## What I ran Reviewed head `d1532fdeeb8fbcc820eb782b33d0c145c6d2e2b3` against the prepared diff. I did not run commands or tests. Read the description, commits, manifest, diff, and all six changed files; no changed files were excluded in the manifest. ## Results | Check | Result | Note | |---|---|---| | Code review | passed | Changed paths and relevant logic inspected | | Tests | not run | Focused runs are author-reported | | Negative control | not run | No local test execution | ## Findings ### Blocking None. ### Non-blocking None. ## Not verified The author-reported tests and Intel device behavior were not independently reproduced. NVIDIA and AMD behavior was not tested, as the description also notes. No files were excluded by rule. ## To get this to a good state Nothing is required.
MarcZX10 commented 2026-11-25 15:16:27 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-25T15:16:27Z.

Review: COMMENTED


Reviewed — no blocking findings

The reviewed diff has no verified blocking defect; the reported test results are author supplied, and I did not run checks or read every changed file in full.

What I ran

Reviewed head ead3617311702434bece640927611dd8d150b1e9 using the prepared diff and repo_read.py. No commands or tests were run. The description reports Windows 11 and Intel UHD Graphics test results; these were not independently verified.

Results

Check Result Note
Diff and targeted source review passed No verified blocking defect
Tests not run Results in the description are author supplied
Full changed-file review not run Some changed files were not read in full

Findings

Blocking

None.

Non-blocking

None.

Sources

Reviewed the prepared diff and repository context at the pinned head. Behavior claims about the implementation are limited to the code inspected; no external sources were used.

Not verified

Did not independently verify the reported test runs or console behavior. Read the full new test file and targeted ranges in SpirvFlowEmitter.cpp, SpirvEmitter.cpp, and SpirvBdaFault.cpp. Reviewed the diff for all seven changed files. Did not read the full text of SpirvEmitterState.hpp, SpirvFlowEmitter.hpp, SpirvFlowEmitter.cpp, or the debt document.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6060307122 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/26756#pullrequestreview-6060307122). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-25T15:16:27Z. **Review:** COMMENTED --- # Reviewed — no blocking findings The reviewed diff has no verified blocking defect; the reported test results are author supplied, and I did not run checks or read every changed file in full. ## What I ran Reviewed head `ead3617311702434bece640927611dd8d150b1e9` using the prepared diff and `repo_read.py`. No commands or tests were run. The description reports Windows 11 and Intel UHD Graphics test results; these were not independently verified. ## Results | Check | Result | Note | |---|---|---| | Diff and targeted source review | passed | No verified blocking defect | | Tests | not run | Results in the description are author supplied | | Full changed-file review | not run | Some changed files were not read in full | ## Findings ### Blocking None. ### Non-blocking None. ## Sources Reviewed the prepared diff and repository context at the pinned head. Behavior claims about the implementation are limited to the code inspected; no external sources were used. ## Not verified Did not independently verify the reported test runs or console behavior. Read the full new test file and targeted ranges in `SpirvFlowEmitter.cpp`, `SpirvEmitter.cpp`, and `SpirvBdaFault.cpp`. Reviewed the diff for all seven changed files. Did not read the full text of `SpirvEmitterState.hpp`, `SpirvFlowEmitter.hpp`, `SpirvFlowEmitter.cpp`, or the debt document. ## To get this to a good state Nothing is required.
mihiii1337 commented 2026-11-25 15:58:06 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by mihiii1337 on 2026-11-25T15:58:06Z.

Review: CHANGES_REQUESTED


I re-reviewed exact head ead3617311702434bece640927611dd8d150b1e9. The three points from my previous review are addressed: the fixture uses one workgroup, ended invocations no longer publish ordinary record_bda_fault records, and loop headers make the transformation ineligible.

Focused Windows verification on the physical notebook adapters:

  • Intel Raptor Lake-S Mobile (8086:a78b, driver 32.0.101.6127): agc_driver_ended_wave_barrier passed, including Wave32 and Wave64;
  • NVIDIA RTX 4070 Laptop (10de:2860, driver 32.0.16.2101): the same test passed, including Wave32 and Wave64;
  • Vulkan was required, shader caching and the pipeline journal were disabled, and each manufacturer ICD was pinned;
  • with Khronos Validation 1.4.369 inserted, both runs had 0 VUID- and 0 SYNC-HAZARD lines;
  • the same focused test also passed on both adapters without Validation;
  • the current fixture with main's recompiler still fails on Intel, while the previous PR head d1532fde fails on both adapters with the expected deferred BDA access failed: address=0x0 instruction=0x2c record. This confirms the new ordinary-fault gate, not just a no-regression run.

I found two remaining control-flow blockers.

  1. The new ended-invocation check is confined to record_bda_fault in SpirvBdaFault.cpp. Guarded scalar SRT reads do not use that function: EmitReadConst writes BdaAbi::SrtGuardWord directly with OpAtomicStore or OpAtomicCompareExchange in SpirvMemoryInstructions.cpp:1705-1716, then calls StopBdaInvocationIf. BdaResources.cpp:483-486 checks that guard even when the ordinary fault record is empty. Existing ShaderMemory.cpp assertions at 11984 and 12071 explicitly confirm that this path latches without calling record_bda_fault. Therefore a wave kept after an early s_endpgm can still publish a host-visible SRT guard fault if it reaches a poisoned guarded scalar read. Please gate this path with the ended-wave state as well, or conservatively reject programs with such reads, and add a regression. This is a static emitter/control-flow finding; I did not claim a hardware reproduction of the poisoned-SRT variant.

  2. ReachesBarrierWithoutLoopBefore sets one barrier flag while traversing every successor and returns true when any reachable block contains a barrier. A nested conditional may therefore have one arm that reaches the barrier and another that reaches the merge without it. The transformed early-ended waves retain their old SCC/VCC state and can take the no-barrier arm while live waves take the barrier arm, so the debt statement that every invocation reaches each OpControlBarrier is not guaranteed. Please either require every reachable path to encounter the relevant barrier before the merge, or keep this transformation to genuinely straight-line regions by rejecting nested conditional/indirect branching. A regression with a nested branch that bypasses the barrier would distinguish the two cases.

AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6060856149 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/26756#pullrequestreview-6060856149). Originally posted by [mihiii1337](https://github.com/mihiii1337) on 2026-11-25T15:58:06Z. **Review:** CHANGES_REQUESTED --- I re-reviewed exact head `ead3617311702434bece640927611dd8d150b1e9`. The three points from my previous review are addressed: the fixture uses one workgroup, ended invocations no longer publish ordinary `record_bda_fault` records, and loop headers make the transformation ineligible. Focused Windows verification on the physical notebook adapters: - Intel Raptor Lake-S Mobile (`8086:a78b`, driver 32.0.101.6127): `agc_driver_ended_wave_barrier` passed, including Wave32 and Wave64; - NVIDIA RTX 4070 Laptop (`10de:2860`, driver 32.0.16.2101): the same test passed, including Wave32 and Wave64; - Vulkan was required, shader caching and the pipeline journal were disabled, and each manufacturer ICD was pinned; - with Khronos Validation 1.4.369 inserted, both runs had 0 `VUID-` and 0 `SYNC-HAZARD` lines; - the same focused test also passed on both adapters without Validation; - the current fixture with `main`'s recompiler still fails on Intel, while the previous PR head `d1532fde` fails on both adapters with the expected deferred `BDA access failed: address=0x0 instruction=0x2c` record. This confirms the new ordinary-fault gate, not just a no-regression run. I found two remaining control-flow blockers. 1. The new ended-invocation check is confined to `record_bda_fault` in `SpirvBdaFault.cpp`. Guarded scalar SRT reads do not use that function: `EmitReadConst` writes `BdaAbi::SrtGuardWord` directly with `OpAtomicStore` or `OpAtomicCompareExchange` in `SpirvMemoryInstructions.cpp:1705-1716`, then calls `StopBdaInvocationIf`. `BdaResources.cpp:483-486` checks that guard even when the ordinary fault record is empty. Existing `ShaderMemory.cpp` assertions at 11984 and 12071 explicitly confirm that this path latches without calling `record_bda_fault`. Therefore a wave kept after an early `s_endpgm` can still publish a host-visible SRT guard fault if it reaches a poisoned guarded scalar read. Please gate this path with the ended-wave state as well, or conservatively reject programs with such reads, and add a regression. This is a static emitter/control-flow finding; I did not claim a hardware reproduction of the poisoned-SRT variant. 2. `ReachesBarrierWithoutLoopBefore` sets one `barrier` flag while traversing every successor and returns true when any reachable block contains a barrier. A nested conditional may therefore have one arm that reaches the barrier and another that reaches the merge without it. The transformed early-ended waves retain their old SCC/VCC state and can take the no-barrier arm while live waves take the barrier arm, so the debt statement that every invocation reaches each `OpControlBarrier` is not guaranteed. Please either require every reachable path to encounter the relevant barrier before the merge, or keep this transformation to genuinely straight-line regions by rejecting nested conditional/indirect branching. A regression with a nested branch that bypasses the barrier would distinguish the two cases. AI-assisted: yes.
MarcZX10 commented 2026-11-25 21:43:31 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-25T21:43:31Z.

Review: APPROVED


Reviewed — looks good

The targeted review of head e61e854e5a7d27dcdfe5de1ed2b6598fb32fcb3c found no verified blocking defect; reported test results are author supplied and were not run here.

What I ran

Read the prepared diff and all changed files at the pinned head using repo_read.py. No commands or tests were run.

Results

Check Result Note
Changed code review passed All eight changed files read
Tests in this review not run Results in the PR description are author reported

Findings

Blocking

None.

Non-blocking

None.

Not verified

No tests were run. The prepared bundle's files.json was not available through the reader; the file listing and manifest show all eight changed files as included, and each was read. No additional files were excluded according to the prepared manifest.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6065386223 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/26756#pullrequestreview-6065386223). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-25T21:43:31Z. **Review:** APPROVED --- # Reviewed — looks good The targeted review of head `e61e854e5a7d27dcdfe5de1ed2b6598fb32fcb3c` found no verified blocking defect; reported test results are author supplied and were not run here. ## What I ran Read the prepared diff and all changed files at the pinned head using `repo_read.py`. No commands or tests were run. ## Results | Check | Result | Note | |---|---|---| | Changed code review | passed | All eight changed files read | | Tests in this review | not run | Results in the PR description are author reported | ## Findings ### Blocking None. ### Non-blocking None. ## Not verified No tests were run. The prepared bundle's `files.json` was not available through the reader; the file listing and manifest show all eight changed files as included, and each was read. No additional files were excluded according to the prepared manifest. ## To get this to a good state Nothing is required.
ligmaSec commented 2026-12-03 21:18:16 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ligmaSec on 2026-12-03T21:18:16Z.

Review: COMMENTED


The new test checks early-ended waves, a guarded read and a CFG shape where a branch can bypass the barrier. Could it also run a partially populated final wave through the same fixture? endedWavesStay tracks the logical end per invocation, and that case would exercise participation of the host lanes that represent the tail of a guest workgroup.

Source review at e61e854e5a. The head trial-merges onto 192c4e45a0. Paired Linux checks are queued.

AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:6178734730 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/26756#pullrequestreview-6178734730). Originally posted by [ligmaSec](https://github.com/ligmaSec) on 2026-12-03T21:18:16Z. **Review:** COMMENTED --- The new test checks early-ended waves, a guarded read and a CFG shape where a branch can bypass the barrier. Could it also run a partially populated final wave through the same fixture? `endedWavesStay` tracks the logical end per invocation, and that case would exercise participation of the host lanes that represent the tail of a guest workgroup. Source review at `e61e854e5a`. The head trial-merges onto `192c4e45a0`. Paired Linux checks are queued. AI-assisted: yes.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/26756:upstream-pr/26756'
git switch 'upstream-pr/26756'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/26756'
git switch 'upstream-pr/26756'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/26756'
git switch 'upstream-pr/26756'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/26756'
git switch 'main'
git merge --squash 'upstream-pr/26756'
git switch 'main'
git merge --ff-only 'upstream-pr/26756'
git switch 'main'
git merge 'upstream-pr/26756'
git push origin 'main'
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!26756
No description provided.