fix(agc): stop resolveGroupAhead on unknown writes and reopen gate after HLE #11439

Merged
hamb3r merged 8 commits from upstream-pr/11439 into main 2026-11-02 10:27:57 +00:00
hamb3r commented 2026-10-26 13:27:43 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by hamb3r on 2026-10-26T13:27:43Z.


What

When Driver::resolveGroupAhead scans a compute command buffer ahead of an in-flight WAIT_REG_MEM gate, it captures SRT/BDA memory for upcoming dispatches so their shaders and resources are ready before the gate opens. Four issues in the ahead-resolution path caused it to either capture stale pre-write descriptors across earlier GPU writes, pollute the global dispatchCache with rejected captures, or stop ahead resolution prematurely:

  • Keep FaultBuffer-only shaders bounded in DispatchWriteRanges (WrittenBuffers.cpp):
    • DispatchWriteRanges treated binding.kind == BufferBindingKind::FaultBuffer the same as Gds and BdaPagetable (bounded = false). However, FaultBuffer is an internal fault-reporting buffer added by the recompiler to specialized descriptor-indexed atomic shaders and does not write to arbitrary guest memory addresses. Treating FaultBuffer as bounded (unless Gds or BdaPagetable is present) prevents specialized compute shaders from prematurely terminating ahead group resolution.
  • Match fill kernels during resolvingAhead(), record unvalued GPU copies, and reopen gateOpened() after HLE (Dispatch.cpp, BufferCopy.cpp):
    • During resolvingAhead(), tryDwordPatternFillBuffer, tryConstantDwordFillBuffer, tryClampedGlobalFillBuffer, and tryMemoryValueFillBuffer were bypassed (!resolvingAhead()), causing buffer-fill dispatches to be captured as regular compute shaders instead of stopping ahead resolution at the HLE fill boundary.
    • When an HLE clear, fill, or copy dispatch executed while resolvedAhead() was empty, closeGate() closed the ahead gate without reopening it for the dispatches that follow the HLE operation in the same group; reopening openGate() when resolvedAhead_.empty() allows subsequent dispatches in the submission to be resolved ahead against the updated post-HLE state.
    • In Driver::noteCopyWriter, GPU-backed HLE copies (!cpuDone) that did not populate knownCopyValues (e.g., when the source range had a pending GPU write) only called recorder->notePendingWrite without recording a writer in writtenBuffers, so DispatchWriteRanges and pendingWrite treated the destination as having no writer. Recording writtenBuffers->noteWrite(destination, size, 0) marks the destination under foreign writer policy (program == 0).
  • Stop Driver::resolveGroupAhead on unknown writes and defer dispatchCache insertion (Driver.hpp, Dispatch.cpp, DispatchAhead.cpp):
    • Switched Driver::resolveGroupAhead from WrittenBufferRanges (which only inspects direct SRT V# buffers and misses BDA table buffers, StorageImage writes, and unbounded flags) to DispatchWriteRanges. When a dispatch is not resolved or DispatchWriteRanges reports !bounded, resolveGroupAhead increments stats.unknownWrites and breaks immediately (break;) instead of continuing to capture later dispatches that may depend on the unknown write.
    • Added bool cacheInserted = false to Driver::CaptureResult and deferred insertDispatch during resolvingAhead() until resolveGroupAhead verifies !OverlapsLabel and !OverlapsRange, preventing rejected ahead captures from polluting the global dispatchCache with stale pre-write snapshots.
  • Regression tests (WriteDataWrittenAhead.cpp):
    • Extended agc_driver_write_data_written_ahead to verify that rejected ahead captures do not insert into dispatchCache, that CPU-backed and GPU-backed HLE StreamCopy, FillKernel, and DwordPatternFill update descriptors before subsequent direct and IndirectGpu dispatches, and that StorageImage write overlap and unbounded Gds writes stop ahead resolution cleanly.

Tested

  • Windows 10 (10.0.19045), NVIDIA GeForce RTX 3080 (driver 617.14, Vulkan 1.4.351):
    • ctest --test-dir build-portable -R "^(agc_shader_table_snapshot_reuse|agc_shader_table_snapshot_reuse_unmasked|agc_shader_type_zero_image_materialization|agc_shader_memory|agc_shader_result_memo_budget|agc_shader_result_memo_budget_threads|agc_shader_result_memo_budget_masked|agc_driver_constant_dword_fill|agc_driver_dispatch_ahead_adopt_check|agc_driver_gated_dispatch_capture|agc_driver_gpu_indirect_arguments_written_ahead|agc_driver_indirect_arguments_written_ahead|agc_driver_pipelined_dispatch|agc_driver_stream_copy|agc_driver_write_data_written_ahead|agc_driver_write_data_written_ahead_draw_pipeline|agc_driver_gated_dispatch_capture_draw_pipeline|agc_driver_gated_dispatch_capture_short_timeout|agc_driver_pipelined_dispatch_item)$" -V with ANYPS5_REQUIRE_VULKAN=1, ANYPS5_NO_SHADER_CACHE=1, and VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation on both main (08a10d225306) and this branch (cb5d7fe3ef74) — all 19 tests pass, neither log contains was not found but was requested by env var VK_INSTANCE_LAYERS, and 0 VUID- validation errors are logged.
    • Verified that the new regression cases in agc_driver_write_data_written_ahead fail deterministically on main (rejected ahead capture polluted global dispatchCache with an extra insert and HLE StreamCopy (CPU-backed): dispatches after descriptor update used stale descriptor (stale 2, fresh 0)) and pass on this branch (Fresh[0] == 2..3, Stale[0] == 0).
  • Windows 10, PPSA01341 (Demon's Souls v1.07): verified that Driver::resolveGroupAhead no longer captures stale pre-copy/pre-fill descriptors (fixing VUID-vkCmdCopyBuffer-size-00115 and intermittent EXCEPTION_ACCESS_VIOLATION crashes in INTRO), stops on unknown writes, and reopens ahead resolution after HLE copies/fills.

Before (main):

[vulkan] validation: Validation Error: [ VUID-vkCmdCopyBuffer-size-00115 ] | MessageID = 0x99ef6537
vkCmdCopyBuffer(): pRegions[0].size is 0.
The Vulkan spec states: The size member of each element of pRegions must be greater than 0
Unhandled exception 0xC0000005 (EXCEPTION_ACCESS_VIOLATION) at 0x000000014330DC96
RIP = 0x000000014330DC96 (eboot.bin + 0x330DC96), RAX = 0x0000000000000000
[groupcap] queue 0x20 (10 s): 591 runs resolved 147 dispatches (71 cache hits) in 13.6 ms (max 2.26 ms); 148 adopted 0.01 ms after the resolve on average, max 0.83 ms; mismatches: address 0 key 0; 0 resolve failures, 0 stale, 0 label overlaps, 0 read an earlier dispatch's output, 0 rejected by the device, 0 dropped because the argument re-read differed
[groupcap] queue 0x38 (10 s): 207 runs resolved 146 dispatches (43 cache hits) in 37.1 ms (max 23.00 ms); 146 adopted 0.53 ms after the resolve on average, max 31.82 ms; mismatches: address 0 key 0; 0 resolve failures, 0 stale, 0 label overlaps, 0 read an earlier dispatch's output, 0 rejected by the device, 0 dropped because the argument re-read differed
[groupcap] queue 0x50 (10 s): 73 runs resolved 292 dispatches (264 cache hits) in 52.9 ms (max 22.04 ms); 292 adopted 7.86 ms after the resolve on average, max 132.53 ms; mismatches: address 0 key 0; 0 resolve failures, 0 stale, 0 label overlaps, 0 read an earlier dispatch's output, 0 rejected by the device, 0 dropped because the argument re-read differed

After (this PR):

[groupcap] queue 0x20 (10 s): 1908 runs resolved 869 dispatches (545 cache hits) in 26.4 ms (max 1.21 ms); 869 adopted 1.06 ms after the resolve on average, max 14.65 ms; mismatches: address 0 key 0; 0 resolve failures, 0 stale, 0 label overlaps, 0 read an earlier dispatch's output, 1671 stopped at unknown writes, 0 rejected by the device, 0 dropped because the argument re-read differed
[groupcap] queue 0x38 (10 s): 696 runs resolved 464 dispatches (229 cache hits) in 26.3 ms (max 2.14 ms); 464 adopted 0.01 ms after the resolve on average, max 0.84 ms; mismatches: address 0 key 0; 0 resolve failures, 0 stale, 0 label overlaps, 0 read an earlier dispatch's output, 232 stopped at unknown writes, 0 rejected by the device, 0 dropped because the argument re-read differed
[groupcap] queue 0x50 (10 s): 231 runs resolved 924 dispatches (827 cache hits) in 21.2 ms (max 6.81 ms); 924 adopted 0.35 ms after the resolve on average, max 12.82 ms; mismatches: address 0 key 0; 0 resolve failures, 0 stale, 0 label overlaps, 0 read an earlier dispatch's output, 0 stopped at unknown writes, 0 rejected by the device, 0 dropped because the argument re-read differed

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: none
  • Unblocks: none
  • GPUs tested: NVIDIA GeForce RTX 3080, driver 617.14 (Vulkan 1.4.351), Windows 10 (10.0.19045)
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5018227741 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11439). Originally posted by [hamb3r](https://github.com/hamb3r) on 2026-10-26T13:27:43Z. --- ### What When `Driver::resolveGroupAhead` scans a compute command buffer ahead of an in-flight `WAIT_REG_MEM` gate, it captures SRT/BDA memory for upcoming dispatches so their shaders and resources are ready before the gate opens. Four issues in the ahead-resolution path caused it to either capture stale pre-write descriptors across earlier GPU writes, pollute the global `dispatchCache` with rejected captures, or stop ahead resolution prematurely: - **Keep `FaultBuffer`-only shaders bounded in `DispatchWriteRanges` (`WrittenBuffers.cpp`)**: - `DispatchWriteRanges` treated `binding.kind == BufferBindingKind::FaultBuffer` the same as `Gds` and `BdaPagetable` (`bounded = false`). However, `FaultBuffer` is an internal fault-reporting buffer added by the recompiler to specialized descriptor-indexed atomic shaders and does not write to arbitrary guest memory addresses. Treating `FaultBuffer` as bounded (unless `Gds` or `BdaPagetable` is present) prevents specialized compute shaders from prematurely terminating ahead group resolution. - **Match fill kernels during `resolvingAhead()`, record unvalued GPU copies, and reopen `gateOpened()` after HLE (`Dispatch.cpp`, `BufferCopy.cpp`)**: - During `resolvingAhead()`, `tryDwordPatternFillBuffer`, `tryConstantDwordFillBuffer`, `tryClampedGlobalFillBuffer`, and `tryMemoryValueFillBuffer` were bypassed (`!resolvingAhead()`), causing buffer-fill dispatches to be captured as regular compute shaders instead of stopping ahead resolution at the HLE fill boundary. - When an HLE clear, fill, or copy dispatch executed while `resolvedAhead()` was empty, `closeGate()` closed the ahead gate without reopening it for the dispatches that follow the HLE operation in the same group; reopening `openGate()` when `resolvedAhead_.empty()` allows subsequent dispatches in the submission to be resolved ahead against the updated post-HLE state. - In `Driver::noteCopyWriter`, GPU-backed HLE copies (`!cpuDone`) that did not populate `knownCopyValues` (e.g., when the source range had a pending GPU write) only called `recorder->notePendingWrite` without recording a writer in `writtenBuffers`, so `DispatchWriteRanges` and `pendingWrite` treated the destination as having no writer. Recording `writtenBuffers->noteWrite(destination, size, 0)` marks the destination under foreign writer policy (`program == 0`). - **Stop `Driver::resolveGroupAhead` on unknown writes and defer `dispatchCache` insertion (`Driver.hpp`, `Dispatch.cpp`, `DispatchAhead.cpp`)**: - Switched `Driver::resolveGroupAhead` from `WrittenBufferRanges` (which only inspects direct SRT `V#` buffers and misses BDA table buffers, `StorageImage` writes, and unbounded flags) to `DispatchWriteRanges`. When a dispatch is not resolved or `DispatchWriteRanges` reports `!bounded`, `resolveGroupAhead` increments `stats.unknownWrites` and breaks immediately (`break;`) instead of continuing to capture later dispatches that may depend on the unknown write. - Added `bool cacheInserted = false` to `Driver::CaptureResult` and deferred `insertDispatch` during `resolvingAhead()` until `resolveGroupAhead` verifies `!OverlapsLabel` and `!OverlapsRange`, preventing rejected ahead captures from polluting the global `dispatchCache` with stale pre-write snapshots. - **Regression tests (`WriteDataWrittenAhead.cpp`)**: - Extended `agc_driver_write_data_written_ahead` to verify that rejected ahead captures do not insert into `dispatchCache`, that CPU-backed and GPU-backed HLE `StreamCopy`, `FillKernel`, and `DwordPatternFill` update descriptors before subsequent direct and `IndirectGpu` dispatches, and that `StorageImage` write overlap and unbounded `Gds` writes stop ahead resolution cleanly. ### Tested - Windows 10 (10.0.19045), NVIDIA GeForce RTX 3080 (driver 617.14, Vulkan 1.4.351): - `ctest --test-dir build-portable -R "^(agc_shader_table_snapshot_reuse|agc_shader_table_snapshot_reuse_unmasked|agc_shader_type_zero_image_materialization|agc_shader_memory|agc_shader_result_memo_budget|agc_shader_result_memo_budget_threads|agc_shader_result_memo_budget_masked|agc_driver_constant_dword_fill|agc_driver_dispatch_ahead_adopt_check|agc_driver_gated_dispatch_capture|agc_driver_gpu_indirect_arguments_written_ahead|agc_driver_indirect_arguments_written_ahead|agc_driver_pipelined_dispatch|agc_driver_stream_copy|agc_driver_write_data_written_ahead|agc_driver_write_data_written_ahead_draw_pipeline|agc_driver_gated_dispatch_capture_draw_pipeline|agc_driver_gated_dispatch_capture_short_timeout|agc_driver_pipelined_dispatch_item)$" -V` with `ANYPS5_REQUIRE_VULKAN=1`, `ANYPS5_NO_SHADER_CACHE=1`, and `VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation` on both `main` (`08a10d225306`) and this branch (`cb5d7fe3ef74`) — all 19 tests pass, neither log contains `was not found but was requested by env var VK_INSTANCE_LAYERS`, and 0 `VUID-` validation errors are logged. - Verified that the new regression cases in `agc_driver_write_data_written_ahead` fail deterministically on `main` (`rejected ahead capture polluted global dispatchCache with an extra insert` and `HLE StreamCopy (CPU-backed): dispatches after descriptor update used stale descriptor (stale 2, fresh 0)`) and pass on this branch (`Fresh[0] == 2..3, Stale[0] == 0`). - Windows 10, `PPSA01341` (*Demon's Souls* v1.07): verified that `Driver::resolveGroupAhead` no longer captures stale pre-copy/pre-fill descriptors (fixing `VUID-vkCmdCopyBuffer-size-00115` and intermittent `EXCEPTION_ACCESS_VIOLATION` crashes in `INTRO`), stops on unknown writes, and reopens ahead resolution after HLE copies/fills. Before (`main`): ```text [vulkan] validation: Validation Error: [ VUID-vkCmdCopyBuffer-size-00115 ] | MessageID = 0x99ef6537 vkCmdCopyBuffer(): pRegions[0].size is 0. The Vulkan spec states: The size member of each element of pRegions must be greater than 0 Unhandled exception 0xC0000005 (EXCEPTION_ACCESS_VIOLATION) at 0x000000014330DC96 RIP = 0x000000014330DC96 (eboot.bin + 0x330DC96), RAX = 0x0000000000000000 [groupcap] queue 0x20 (10 s): 591 runs resolved 147 dispatches (71 cache hits) in 13.6 ms (max 2.26 ms); 148 adopted 0.01 ms after the resolve on average, max 0.83 ms; mismatches: address 0 key 0; 0 resolve failures, 0 stale, 0 label overlaps, 0 read an earlier dispatch's output, 0 rejected by the device, 0 dropped because the argument re-read differed [groupcap] queue 0x38 (10 s): 207 runs resolved 146 dispatches (43 cache hits) in 37.1 ms (max 23.00 ms); 146 adopted 0.53 ms after the resolve on average, max 31.82 ms; mismatches: address 0 key 0; 0 resolve failures, 0 stale, 0 label overlaps, 0 read an earlier dispatch's output, 0 rejected by the device, 0 dropped because the argument re-read differed [groupcap] queue 0x50 (10 s): 73 runs resolved 292 dispatches (264 cache hits) in 52.9 ms (max 22.04 ms); 292 adopted 7.86 ms after the resolve on average, max 132.53 ms; mismatches: address 0 key 0; 0 resolve failures, 0 stale, 0 label overlaps, 0 read an earlier dispatch's output, 0 rejected by the device, 0 dropped because the argument re-read differed ``` After (this PR): ```text [groupcap] queue 0x20 (10 s): 1908 runs resolved 869 dispatches (545 cache hits) in 26.4 ms (max 1.21 ms); 869 adopted 1.06 ms after the resolve on average, max 14.65 ms; mismatches: address 0 key 0; 0 resolve failures, 0 stale, 0 label overlaps, 0 read an earlier dispatch's output, 1671 stopped at unknown writes, 0 rejected by the device, 0 dropped because the argument re-read differed [groupcap] queue 0x38 (10 s): 696 runs resolved 464 dispatches (229 cache hits) in 26.3 ms (max 2.14 ms); 464 adopted 0.01 ms after the resolve on average, max 0.84 ms; mismatches: address 0 key 0; 0 resolve failures, 0 stale, 0 label overlaps, 0 read an earlier dispatch's output, 232 stopped at unknown writes, 0 rejected by the device, 0 dropped because the argument re-read differed [groupcap] queue 0x50 (10 s): 231 runs resolved 924 dispatches (827 cache hits) in 21.2 ms (max 6.81 ms); 924 adopted 0.35 ms after the resolve on average, max 12.82 ms; mismatches: address 0 key 0; 0 resolve failures, 0 stale, 0 label overlaps, 0 read an earlier dispatch's output, 0 stopped at unknown writes, 0 rejected by the device, 0 dropped because the argument re-read differed ``` ### 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: none - [x] Unblocks: none - [x] GPUs tested: NVIDIA GeForce RTX 3080, driver 617.14 (Vulkan 1.4.351), Windows 10 (10.0.19045) - [x] AI-assisted: yes
MarcZX10 commented 2026-10-26 13:40:03 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-26T13:40:03Z.

Review: CHANGES_REQUESTED


Reviewed the rebased head c53c696e97cb7b27c12081f9c28f877689b18160 against current main bf77a9e9cba4b02c358779b35295176dd9cae164. The code changes are consistent with the stated ahead-capture safeguards, and I found no additional functional defect in the inspected hunks. However, the PR’s reported 15-test Vulkan comparison uses main acb900c19432 and the prior PR head dd3a169b5682. Current main includes accae4b62d, which changes dispatch adoption and DispatchAhead.cpp in the same paths this PR modifies; the hosted product jobs are skipped. Please rerun the documented focused tests on current main and this rebased head with the stated Vulkan validation settings, compare the logs for new VUID- errors, and update the report before requesting approval.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5652856774 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11439#pullrequestreview-5652856774). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-26T13:40:03Z. **Review:** CHANGES_REQUESTED --- Reviewed the rebased head `c53c696e97cb7b27c12081f9c28f877689b18160` against current `main` `bf77a9e9cba4b02c358779b35295176dd9cae164`. The code changes are consistent with the stated ahead-capture safeguards, and I found no additional functional defect in the inspected hunks. However, the PR’s reported 15-test Vulkan comparison uses `main` `acb900c19432` and the prior PR head `dd3a169b5682`. Current `main` includes `accae4b62d`, which changes dispatch adoption and `DispatchAhead.cpp` in the same paths this PR modifies; the hosted product jobs are skipped. Please rerun the documented focused tests on current `main` and this rebased head with the stated Vulkan validation settings, compare the logs for new `VUID-` errors, and update the report before requesting approval.
MarcZX10 commented 2026-10-26 14:07:59 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-26T14:07:59Z.

Review: CHANGES_REQUESTED


The new head and test report address my earlier request: the PR now tests against main at 9656d366be90 and reports all 16 focused Vulkan tests passing on both main and the change, with no missing-layer messages or VUID- output. I have not independently reproduced the Windows/NVIDIA run.

One merge-order item remains. I ran a three-way comparison with open #8105 from their common base; it has a content conflict in Dispatch.cpp at the declaration after htileClearCompletion: this PR adds codeSpan and #8105 adds Graphics::HtileMaskClear htileMask. CONTRIBUTING.md requires authors to agree on order and declare it with Depends on. Please coordinate with #8105's author and update this PR before merge. I manually checked #7201's Dispatch.cpp hunk (NoteRecentWork near the function start); it is separate from this conflict.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5653264651 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11439#pullrequestreview-5653264651). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-26T14:07:59Z. **Review:** CHANGES_REQUESTED --- The new head and test report address my earlier request: the PR now tests against `main` at `9656d366be90` and reports all 16 focused Vulkan tests passing on both `main` and the change, with no missing-layer messages or `VUID-` output. I have not independently reproduced the Windows/NVIDIA run. One merge-order item remains. I ran a three-way comparison with open #8105 from their common base; it has a content conflict in `Dispatch.cpp` at the declaration after `htileClearCompletion`: this PR adds `codeSpan` and #8105 adds `Graphics::HtileMaskClear htileMask`. CONTRIBUTING.md requires authors to agree on order and declare it with `Depends on`. Please coordinate with #8105's author and update this PR before merge. I manually checked #7201's `Dispatch.cpp` hunk (`NoteRecentWork` near the function start); it is separate from this conflict.
MarcZX10 commented 2026-10-26 15:11:36 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-26T15:11:36Z.

Review: CHANGES_REQUESTED


I rechecked head 0f8b37f008e3e58d3d0307f353caf2c59481f79d. The previous Dispatch.cpp overlap with #8105 is resolved: I confirmed the merge-tree is clean in both merge orders. The hosted conventions, eligibility and report checks pass; AGC product jobs are skipped by path policy.

Two follow-ups remain before approval:

  • git diff --check upstream/main...upstream/pr-11439 reports a new blank line at EOF in core/libs/prx/libSceAgcDriver/tests/execution/WriteDataWrittenAhead.cpp:408.
  • The branch's merge base and the Vulkan comparison base are 9656d366be90, while current main is 7903201bb426. I found no intervening changes to this PR's touched source/test paths, but CONTRIBUTING requires branches to stay current. Please sync to current main and rerun the documented focused Vulkan-validation comparison on the same GPU, including the no-missing-layer and no-new-VUID- checks.

I did not independently run the Windows/NVIDIA suite. The previous dependency-order finding is withdrawn because the current heads merge cleanly in either order.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5654309930 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11439#pullrequestreview-5654309930). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-26T15:11:36Z. **Review:** CHANGES_REQUESTED --- I rechecked head `0f8b37f008e3e58d3d0307f353caf2c59481f79d`. The previous `Dispatch.cpp` overlap with #8105 is resolved: I confirmed the merge-tree is clean in both merge orders. The hosted conventions, eligibility and report checks pass; AGC product jobs are skipped by path policy. Two follow-ups remain before approval: - `git diff --check upstream/main...upstream/pr-11439` reports a new blank line at EOF in `core/libs/prx/libSceAgcDriver/tests/execution/WriteDataWrittenAhead.cpp:408`. - The branch's merge base and the Vulkan comparison base are `9656d366be90`, while current `main` is `7903201bb426`. I found no intervening changes to this PR's touched source/test paths, but CONTRIBUTING requires branches to stay current. Please sync to current `main` and rerun the documented focused Vulkan-validation comparison on the same GPU, including the no-missing-layer and no-new-`VUID-` checks. I did not independently run the Windows/NVIDIA suite. The previous dependency-order finding is withdrawn because the current heads merge cleanly in either order.
jotitadev commented 2026-10-27 10:17:36 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by jotitadev on 2026-10-27T10:17:36Z.

Review: COMMENTED


First NVIDIA run on Linux for this head fb6613fa5.

Linux run: Ubuntu 26.04, GCC 15.2, Release. RTX 3070 (NVIDIA 595.99.02) and lavapipe (Mesa 26.0.3), one at a time via VK_DRIVER_FILES. Khronos validation layer 1.4.341 with ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1; VK_LOADER_DEBUG=layer shows the layer inserted, no "was not found but was requested", 0 VUID- lines.

Base main 808a557ac; the merge is clean.

  • Red: main + only this PR's WriteDataWrittenAhead.cpp: agc_driver_write_data_written_ahead and _draw_pipeline fail on both devices with normal dispatch after rejected ahead capture received the rejected stale variant from global dispatchCache (stale 3, fresh 0).
  • Green: 16 of the description's 19 focal tests pass 3/3 on each device. I left out the three agc_shader_result_memo_budget* tests. 0 VUID-.
  • ^agc suite (no flip/display/lds64, -j1): 3070 1052/1052, lavapipe 1051/1052. The one failure is agc_driver_multisample_retirement, which also fails on main. On main, agc_submit_progress_no_timeline failed once on the 3070. The GPU was shared, and that test passed with this PR.
  • Builds on Linux/GCC; public_headers passes.

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:5665454902 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11439#pullrequestreview-5665454902). Originally posted by [jotitadev](https://github.com/jotitadev) on 2026-10-27T10:17:36Z. **Review:** COMMENTED --- First NVIDIA run on Linux for this head `fb6613fa5`. Linux run: Ubuntu 26.04, GCC 15.2, Release. RTX 3070 (NVIDIA 595.99.02) and lavapipe (Mesa 26.0.3), one at a time via `VK_DRIVER_FILES`. Khronos validation layer 1.4.341 with `ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1`; `VK_LOADER_DEBUG=layer` shows the layer inserted, no "was not found but was requested", 0 `VUID-` lines. Base `main` `808a557ac`; the merge is clean. - Red: `main` + only this PR's `WriteDataWrittenAhead.cpp`: `agc_driver_write_data_written_ahead` and `_draw_pipeline` fail on both devices with `normal dispatch after rejected ahead capture received the rejected stale variant from global dispatchCache (stale 3, fresh 0)`. - Green: 16 of the description's 19 focal tests pass 3/3 on each device. I left out the three `agc_shader_result_memo_budget*` tests. 0 `VUID-`. - `^agc` suite (no flip/display/lds64, `-j1`): 3070 1052/1052, lavapipe 1051/1052. The one failure is `agc_driver_multisample_retirement`, which also fails on `main`. On `main`, `agc_submit_progress_no_timeline` failed once on the 3070. The GPU was shared, and that test passed with this PR. - Builds on Linux/GCC; `public_headers` passes. GPUs tested: NVIDIA RTX 3070 (Linux), lavapipe. Written with AI assistance (Claude Code). I ran the builds and tests above on my machine.
MarcZX10 commented 2026-10-29 10:55:48 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T10:55:48Z.

Review: CHANGES_REQUESTED


<!-- greyfinch-sync:boykopovar/AnyPS5:review:5696572767 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11439#pullrequestreview-5696572767). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-29T10:55:48Z. **Review:** CHANGES_REQUESTED --- ## Re-check — changes requested for current-main integration\n\nThe author’s 19/19 focused Vulkan-validation result on both `main` and the PR head addresses the previous test-evidence request. The validation-layer load and zero-`VUID` reporting are also documented.\n\nThe comparison now uses `main` `1b580f13cf`, while current upstream `main` is `d2b15d8802`. Since that base, `core/libs/prx/libSceAgcDriver/CMakeLists.txt` and `docs/dev/debt/libSceAgcDriver.md` changed, along with related AGC tests. The merge preview against current main is clean, and I independently confirmed `git diff --check` and `check_conventions.py` pass. CONTRIBUTING requires the branch to stay current; please refresh onto `d2b15d8802` and rerun the focused comparison on the merge-ready head so the updated registration and debt context are covered.\n\nI did not run the Vulkan tests locally; product GPU checks are path-skipped by hosted CI.
MarcZX10 commented 2026-10-29 21:18:42 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T21:18:42Z.

Review: CHANGES_REQUESTED


Re-checked — new head, changes requested

The branch now merges current main, but the focused Vulkan comparison still covers the prior integration, including three source files changed by the new base.

What I ran

Reviewed exact head 5cc2975a20f7beb519a072fa14a34e60999be417, whose second parent is current main 9624d8c6bb9e96b7aa92b815f55690f69b0a88d5. I compared the tested main 1b580f13cf7e with current main and inspected the overlap in Driver.hpp, BufferCopy.cpp, and WrittenBuffers.cpp. Environment: Linux x86-64, Git and GitHub CLI; no build or GPU test was run locally.

git diff --check 9624d8c6bb9e96b7aa92b815f55690f69b0a88d5 refs/review/pr-11439-head
git merge-base --is-ancestor 9624d8c6bb9e96b7aa92b815f55690f69b0a88d5 refs/review/pr-11439-head
git diff --name-only 1b580f13cf7e 9624d8c6bb9e96b7aa92b815f55690f69b0a88d5 -- core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp core/libs/prx/libSceAgcDriver/Execution/src/Driver/Memory/BufferCopy.cpp core/libs/prx/libSceAgcDriver/Execution/src/Driver/Memory/WrittenBuffers.cpp

Results

Check Result
Patch whitespace Pass
Current-main ancestry Pass; current main is the merge commit's second parent
Changes since the reported test base Driver.hpp, BufferCopy.cpp, and WrittenBuffers.cpp changed on main; those are also modified by this PR
Focused Vulkan comparison Author reports 19/19 tests and negative controls on main 1b580f13cf7e and head c4ddc2d40465; this is before the current-main merge and does not cover the three overlapping main updates
Hosted exact-head jobs Windows in progress; conventions and labels queued; report and eligibility pass; Linux/product and other specialized jobs skipped
Local build/GPU tests Not run
Unedited local command output
diffcheck-exit=0
current-main-is-ancestor-exit=0
c4ddc2d404657c35b6822c37dc3c4311edf76872 9624d8c6bb9e96b7aa92b815f55690f69b0a88d5

Findings

Blocking

  • The current-main merge changes the WrittenBufferIndex storage and writer-recording paths in files this PR modifies. The previous 19-test comparison used main 1b580f13cf7e and head c4ddc2d40465, so it does not validate the combined behavior now submitted at 5cc2975a20f7. Please rerun the focused Vulkan suite and the relevant negative controls on current main 9624d8c6bb9e and this exact merged head, with validation-layer load and VUID results recorded.

I found no additional source-level defect in the rechecked diff.

Sources

Not verified

I did not build or run the current merged head locally or on a GPU. The exact-head Windows job was still running; conventions and labels were queued. Linux product and specialized jobs were skipped.

To get this to a good state

Rerun the same 19 focused tests and issue-specific negative controls against current main and exact head 5cc2975a20f7, recording the required Vulkan layer and VUID checks. I will recheck the resulting head and hosted statuses.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5705102210 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11439#pullrequestreview-5705102210). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-29T21:18:42Z. **Review:** CHANGES_REQUESTED --- # Re-checked — new head, changes requested The branch now merges current `main`, but the focused Vulkan comparison still covers the prior integration, including three source files changed by the new base. ## What I ran Reviewed exact head `5cc2975a20f7beb519a072fa14a34e60999be417`, whose second parent is current `main` `9624d8c6bb9e96b7aa92b815f55690f69b0a88d5`. I compared the tested main `1b580f13cf7e` with current main and inspected the overlap in `Driver.hpp`, `BufferCopy.cpp`, and `WrittenBuffers.cpp`. Environment: Linux x86-64, Git and GitHub CLI; no build or GPU test was run locally. ```sh git diff --check 9624d8c6bb9e96b7aa92b815f55690f69b0a88d5 refs/review/pr-11439-head git merge-base --is-ancestor 9624d8c6bb9e96b7aa92b815f55690f69b0a88d5 refs/review/pr-11439-head git diff --name-only 1b580f13cf7e 9624d8c6bb9e96b7aa92b815f55690f69b0a88d5 -- core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp core/libs/prx/libSceAgcDriver/Execution/src/Driver/Memory/BufferCopy.cpp core/libs/prx/libSceAgcDriver/Execution/src/Driver/Memory/WrittenBuffers.cpp ``` ## Results | Check | Result | |---|---| | Patch whitespace | Pass | | Current-main ancestry | Pass; current `main` is the merge commit's second parent | | Changes since the reported test base | `Driver.hpp`, `BufferCopy.cpp`, and `WrittenBuffers.cpp` changed on main; those are also modified by this PR | | Focused Vulkan comparison | Author reports 19/19 tests and negative controls on main `1b580f13cf7e` and head `c4ddc2d40465`; this is before the current-main merge and does not cover the three overlapping main updates | | Hosted exact-head jobs | Windows in progress; conventions and labels queued; report and eligibility pass; Linux/product and other specialized jobs skipped | | Local build/GPU tests | Not run | <details> <summary>Unedited local command output</summary> ```text diffcheck-exit=0 current-main-is-ancestor-exit=0 c4ddc2d404657c35b6822c37dc3c4311edf76872 9624d8c6bb9e96b7aa92b815f55690f69b0a88d5 ``` </details> ## Findings ### Blocking - The current-main merge changes the `WrittenBufferIndex` storage and writer-recording paths in files this PR modifies. The previous 19-test comparison used main `1b580f13cf7e` and head `c4ddc2d40465`, so it does not validate the combined behavior now submitted at `5cc2975a20f7`. Please rerun the focused Vulkan suite and the relevant negative controls on current main `9624d8c6bb9e` and this exact merged head, with validation-layer load and `VUID` results recorded. I found no additional source-level defect in the rechecked diff. ## Sources - [Current-main testing and branch requirements](https://github.com/boykopovar/AnyPS5/blob/9624d8c6bb9e96b7aa92b815f55690f69b0a88d5/CONTRIBUTING.md) - [Exact current-main changes in the overlapping AGC files](https://github.com/boykopovar/AnyPS5/compare/1b580f13cf7e...9624d8c6bb9e96b7aa92b815f55690f69b0a88d5) - [PR head](https://github.com/boykopovar/AnyPS5/commit/5cc2975a20f7beb519a072fa14a34e60999be417) ## Not verified I did not build or run the current merged head locally or on a GPU. The exact-head Windows job was still running; conventions and labels were queued. Linux product and specialized jobs were skipped. ## To get this to a good state Rerun the same 19 focused tests and issue-specific negative controls against current `main` and exact head `5cc2975a20f7`, recording the required Vulkan layer and `VUID` checks. I will recheck the resulting head and hosted statuses.
MarcZX10 commented 2026-10-29 21:51:54 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T21:51:54Z.

Review: CHANGES_REQUESTED


Re-checked — new head, changes requested

The exact-head regression evidence and current-base merge are satisfactory, but the branch conflicts with two open PRs and its dependency checklist still says none.

What I ran

  • PR head: 0711645eef72b5e26934a6245c417bfe52bd5b2f.
  • Base: upstream/main at d820fef1827f27247cd28da7b4eec7891904bae5; the merge preview was clean (99eca890510413d8115e076ea406fec1aa377cba). No files touched by this PR changed on main after the tested base c40cef843681.
  • Environment: Linux x86_64; no compiler, build, or GPU tests run locally.
git diff --check upstream/main...refs/review/pr-11439-head
git merge-tree --write-tree upstream/main refs/review/pr-11439-head
python tools/check_conventions.py --base upstream/main --head refs/review/pr-11439-head
git merge-tree --write-tree refs/review/pr-11439-head refs/review/pr-12147-head
git merge-tree --write-tree refs/review/pr-11439-head refs/review/pr-12657-head

Results

Check Result
Patch whitespace Pass; command exited 0 with no output.
Current-main merge preview Pass; clean tree 99eca890510413d8115e076ea406fec1aa377cba.
Repository conventions Pass.
Pairwise integration with #12147 Conflict in core/libs/prx/libSceAgcDriver/Execution/src/Driver/Dispatch/Dispatch.cpp.
Pairwise integration with #12657 Conflict in the same Dispatch.cpp. Both PRs remain open; #12657's description says it depends on #12147.
Hosted CI Windows product job passed; eligibility, conventions, labels, and report checks passed. Linux and specialized jobs were skipped.
Focused Vulkan tests The PR description reports 19/19 focused Vulkan validation tests on both main c40cef843681 and this head, with the validation layer loaded and zero VUID errors. This is author-reported; I did not run the GPU tests.
Unedited local command output

python tools/check_conventions.py --base upstream/main --head refs/review/pr-11439-head

All conventions checks passed.

git merge-tree --write-tree upstream/main refs/review/pr-11439-head

99eca890510413d8115e076ea406fec1aa377cba

git diff --check upstream/main...refs/review/pr-11439-head exited 0 and produced no output.

Both pairwise merge previews exited 1 and reported:

CONFLICT (content): Merge conflict in core/libs/prx/libSceAgcDriver/Execution/src/Driver/Dispatch/Dispatch.cpp

Findings

Blocking

  • Unresolved PR overlap and merge order: Pairwise merge previews conflict in Dispatch.cpp with open #12147 and #12657. The PR currently lists Depends on: none. CONTRIBUTING.md requires authors to agree on which overlapping PR goes first and declare that order with Depends on (pinned contribution rule). Please coordinate the order with the affected authors and update the dependency line; then I can recheck the combined merge.

Non-blocking

  • No additional functional issue was identified in this source-level recheck. The reported GPU test comparison is author-provided, not independently reproduced here.

Not verified

  • I did not build or run tests locally; this environment has no verified Vulkan device. Linux, macOS, and specialized hosted jobs were skipped.

To get this to a good state

Please record the agreed order for the overlapping PRs in Depends on. I will rerun the merge checks and review the updated head.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5705460707 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11439#pullrequestreview-5705460707). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-29T21:51:54Z. **Review:** CHANGES_REQUESTED --- # Re-checked — new head, changes requested The exact-head regression evidence and current-base merge are satisfactory, but the branch conflicts with two open PRs and its dependency checklist still says `none`. ## What I ran - PR head: `0711645eef72b5e26934a6245c417bfe52bd5b2f`. - Base: `upstream/main` at `d820fef1827f27247cd28da7b4eec7891904bae5`; the merge preview was clean (`99eca890510413d8115e076ea406fec1aa377cba`). No files touched by this PR changed on `main` after the tested base `c40cef843681`. - Environment: Linux x86_64; no compiler, build, or GPU tests run locally. ```sh git diff --check upstream/main...refs/review/pr-11439-head git merge-tree --write-tree upstream/main refs/review/pr-11439-head python tools/check_conventions.py --base upstream/main --head refs/review/pr-11439-head git merge-tree --write-tree refs/review/pr-11439-head refs/review/pr-12147-head git merge-tree --write-tree refs/review/pr-11439-head refs/review/pr-12657-head ``` ## Results | Check | Result | |---|---| | Patch whitespace | Pass; command exited 0 with no output. | | Current-main merge preview | Pass; clean tree `99eca890510413d8115e076ea406fec1aa377cba`. | | Repository conventions | Pass. | | Pairwise integration with #12147 | Conflict in `core/libs/prx/libSceAgcDriver/Execution/src/Driver/Dispatch/Dispatch.cpp`. | | Pairwise integration with #12657 | Conflict in the same `Dispatch.cpp`. Both PRs remain open; #12657's description says it depends on #12147. | | Hosted CI | Windows product job passed; eligibility, conventions, labels, and report checks passed. Linux and specialized jobs were skipped. | | Focused Vulkan tests | The PR description reports 19/19 focused Vulkan validation tests on both `main` `c40cef843681` and this head, with the validation layer loaded and zero VUID errors. This is author-reported; I did not run the GPU tests. | <details> <summary>Unedited local command output</summary> `python tools/check_conventions.py --base upstream/main --head refs/review/pr-11439-head` ```text All conventions checks passed. ``` `git merge-tree --write-tree upstream/main refs/review/pr-11439-head` ```text 99eca890510413d8115e076ea406fec1aa377cba ``` `git diff --check upstream/main...refs/review/pr-11439-head` exited 0 and produced no output. Both pairwise merge previews exited 1 and reported: ```text CONFLICT (content): Merge conflict in core/libs/prx/libSceAgcDriver/Execution/src/Driver/Dispatch/Dispatch.cpp ``` </details> ## Findings ### Blocking - **Unresolved PR overlap and merge order:** Pairwise merge previews conflict in `Dispatch.cpp` with open #12147 and #12657. The PR currently lists `Depends on: none`. `CONTRIBUTING.md` requires authors to agree on which overlapping PR goes first and declare that order with `Depends on` ([pinned contribution rule](https://github.com/boykopovar/AnyPS5/blob/d820fef1827f27247cd28da7b4eec7891904bae5/CONTRIBUTING.md#L69)). Please coordinate the order with the affected authors and update the dependency line; then I can recheck the combined merge. ### Non-blocking - No additional functional issue was identified in this source-level recheck. The reported GPU test comparison is author-provided, not independently reproduced here. ## Not verified - I did not build or run tests locally; this environment has no verified Vulkan device. Linux, macOS, and specialized hosted jobs were skipped. ## To get this to a good state Please record the agreed order for the overlapping PRs in `Depends on`. I will rerun the merge checks and review the updated head.
MarcZX10 commented 2026-10-30 04:23:29 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-30T04:23:29Z.

Review: APPROVED


Re-checked — new head, looks good

The update preserves the unrelated prebuild block, and I confirmed the branch combines cleanly with current main and both cited PRs in either merge order.

What I ran

Reviewed head cb5d7fe3ef741780004cfd8e4e677d1b033e7311 against current main 5ecef095b61e7a406b279c97896f3a8a6fbd6353; current-main merge tree is 907b51b66dc5a7a17e45994202854189394b9941.

git merge-tree --write-tree refs/remotes/upstream/main refs/remotes/upstream/pr-11439
git diff --check refs/remotes/upstream/main...refs/remotes/upstream/pr-11439
git merge-tree --write-tree refs/remotes/upstream/pr-11439 refs/remotes/upstream/pr-12147
git merge-tree --write-tree refs/remotes/upstream/pr-12147 refs/remotes/upstream/pr-11439
git merge-tree --write-tree refs/remotes/upstream/pr-11439 refs/remotes/upstream/pr-12657
git merge-tree --write-tree refs/remotes/upstream/pr-12657 refs/remotes/upstream/pr-11439

Results

Check Result
Current-main merge preview Clean
Diff check Passed; no output
Merge with #12147 Clean in both orders
Merge with #12657 Clean in both orders
Hosted conventions and Windows Passed
Focused Vulkan tests Author reports 19/19 on the updated head, with validation enabled and zero VUIDs; not independently run

Not verified

I did not run a local build or Vulkan tests. Product Linux and specialized hosted checks were skipped for this change.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5708054490 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11439#pullrequestreview-5708054490). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-30T04:23:29Z. **Review:** APPROVED --- # Re-checked — new head, looks good The update preserves the unrelated prebuild block, and I confirmed the branch combines cleanly with current main and both cited PRs in either merge order. ## What I ran Reviewed head `cb5d7fe3ef741780004cfd8e4e677d1b033e7311` against current main `5ecef095b61e7a406b279c97896f3a8a6fbd6353`; current-main merge tree is `907b51b66dc5a7a17e45994202854189394b9941`. ```sh git merge-tree --write-tree refs/remotes/upstream/main refs/remotes/upstream/pr-11439 git diff --check refs/remotes/upstream/main...refs/remotes/upstream/pr-11439 git merge-tree --write-tree refs/remotes/upstream/pr-11439 refs/remotes/upstream/pr-12147 git merge-tree --write-tree refs/remotes/upstream/pr-12147 refs/remotes/upstream/pr-11439 git merge-tree --write-tree refs/remotes/upstream/pr-11439 refs/remotes/upstream/pr-12657 git merge-tree --write-tree refs/remotes/upstream/pr-12657 refs/remotes/upstream/pr-11439 ``` ## Results | Check | Result | |---|---| | Current-main merge preview | Clean | | Diff check | Passed; no output | | Merge with #12147 | Clean in both orders | | Merge with #12657 | Clean in both orders | | Hosted conventions and Windows | Passed | | Focused Vulkan tests | Author reports 19/19 on the updated head, with validation enabled and zero VUIDs; not independently run | ## Not verified I did not run a local build or Vulkan tests. Product Linux and specialized hosted checks were skipped for this change.
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!11439
No description provided.