fix(agc): store pending image results after the range's writers finish #6364

Merged
SleglJan merged 1 commit from upstream-pr/6364 into main 2026-10-19 01:27:49 +00:00
SleglJan commented 2026-10-15 13:11:41 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by SleglJan on 2026-10-15T13:11:41Z.


What

A flush stores a storage image's pending results to guest memory (StorageTexture::FlushPending). The store keeps the 64 KiB blocks that the write tracker shows written since the image was last in sync (writeBackLayers). An address-based dispatch marks the pages it stored to only when its batch's completion runs (BdaResources::markWrittenPages). A flush that runs after the GPU executed such a store, but before that completion, finds the blocks unwritten and stores the image's older texels over the newer bytes.

On our 007 stack (see Tested), PPSA11386 (007 First Light) stopped on this in its first cinematic, with Vulkan dispatch: workgroup count … exceeds device limits. The sequence:

  • an address-based pass writes an indirect dispatch's arguments into memory that a storage image with pending results also covers;
  • the CPU-resolved indirect dispatch flushes the argument dwords (decideIndirect) before that pass's completion has run;
  • the flush stores the image's older texels over the arguments, and the dispatch reads them as its workgroup counts.

Changes:

  • Recorder::PendingWriterSerial(address, bytes) returns the serial of the newest unfinished batch that writes the range or holds it in an address-based lease. A write is a noted pending write; a lease is an AddressBased in-place read, as a single range or in a read list (readOverlap takes an optional reader kind for this). The open batch reports OpenSerial(). The result is 0 when there is no such batch.
  • FlushPending checks for such a writer after it takes the GPU mutex, and does not wait inside a completion action (Recorder::InCompletion):
    • it first completes the batches that already finished (Reap, no GPU wait);
    • if the writer is still unfinished, it finishes the in-flight batches up to the writer (FinishUpTo), or syncs when the writer is in the open batch (Sync, counted as an address-based sync when the open batch only leases the range);
    • the writer's marks have then landed, and writeBackLayers keeps its blocks;
    • if the wait throws, the images the flush took are registered as pending again (reconcilePending), as after a failed store.
  • New execution test agc_driver_storage_flush_ordering, two cases on separate images in one guest block, which is write-watched where the host supports it:
    • a compute dispatch stores two texels of a 256x128 R32 storage image, one in each of its two 64 KiB blocks;
    • a second dispatch stores a dword into the image's first block through a global address;
    • writer in flight: the test waits for the GPU without running completions (SubmitAndEpoch, WaitRecorded) and flushes the image;
    • writer in the open batch: the test flushes the image without submitting;
    • before each flush it checks that the store's address-based lease is pending in the expected batch (in flight or open);
    • expected in both: the dword is kept and the texel in the second block is stored.
    • The two cases cover the reap and the Sync paths. FinishUpTo (a writer in flight whose fence has not signaled) is not covered: the test cannot keep a batch running on the GPU deterministically.
    • Without write watching, the in-flight case is skipped and the open-batch case still runs: the write-back then compares guest memory, which the GPU has not written yet at the flush. The in-flight case is also skipped when the recorder cannot wait for the GPU without running completions.

The reap runs completion actions on the flushing thread, as the Sync it can save would.

The wait holds the GPU mutex; on a game thread's flush hook it is a locked GPU wait where the hook's own pending-write wait runs unlocked. A kept block keeps all 64 KiB, so the image's results elsewhere in that block are not stored, as for a block the CPU wrote.

FlushAllPending flushes the whole address range, so the idle store now also waits for any unfinished writer. The idle store runs on queue 0 after all queues have been idle for 50 ms. The 007 runs below had it turned off with a switch of our stack that main does not have, so that path is not measured. The flip packet's store of small pending images (StoreSmallPending) flushes each one, so a flip can wait as well; the figures below include those.

Cost, measured on our 007 stack with this logic and a counter of these waits that this PR does not add (RTX 3080, Linux), per 10 s, summed over the threads that flush (with pipelined draws, the committer too):

  • First cinematic: 262–337 flushes per 10 s found a writer; the waits took 0.61 s per 10 s.
  • Gameplay: 570 such flushes per 10 s took 1.09 s per 10 s, about 11% of the wall time; queue 0's packet worker is about 99% busy there.
  • Most of these waits are for the open batch (257 of 301 in the cinematic, about 99% in gameplay): a submit plus a wait for all recorded work, about 2 ms each (0.62 s over 301 waits in the cinematic).
  • Menu, with the reap but before FinishUpTo: 469 waits per 10 s took 3.9 s, 342 of them for the open batch. The run that introduced a first version (always Sync) was about 7% slower in the menu than the run before (2.6–2.87 vs 2.85–3.2 FPS); it also added #4554's DCC-key wait (later measured as negligible), and no run with only this wait switched off was made.

The condition is broader than this bug needs: in one gameplay window on our stack, 97% of the waits had the driver's own unit-shadow publish as the newest overlapping writer, which is marked when it is recorded. A narrower rule would skip writers whose bytes are marked when they are recorded. That needs a source on each pending-write note and a check of every source (an alias copy between images, for one, notes a write that lands later through the image's write-back), so it is left for a follow-up. A writer's age is not a sound criterion on main: an older address-based store can sit in texels the newer results did not write, and only its marks keep that block.

Pipelined commits (#1201, #1202):

  • Queue 0's committer thread commits draws by default (depth 8; APS5_PIPELINED_DRAWS=0 turns it off), and DMA stores with APS5_PIPELINE_DMA. Its calls to FlushPending get the wait on the committer thread, under the GPU mutex.
  • The wait cannot wait for the committer:
    • it waits only on recorder fences, and the recorder's submissions wait on no semaphore;
    • DrawPipeline::Drain throws when the calling thread holds the GPU mutex, so neither the wait nor the completions it runs can drain the committer.
  • Our 007 runs used a cross-test of #1201 with APS5_PIPELINED_DRAWS=8, which is now main's default.

Overlap:

  • #5058 adds a FlushPending of the indirect arguments when an indirect dispatch picks its path. That flush would get this wait too. No shared lines.
  • #1747, #1896 and #6208 move more FlushPending callers onto the committer; #5867 changes how the committer waits for work.
  • #4654 (merged) stores pending images before a use whose written buffer ranges overlap them. An address-based store has no written ranges when it is recorded, so it is not covered there; the new test fails on main, which has #4654.

Tested

  • Linux build node: Arch Linux container on a 16-thread Xeon E5-2640 v3, GCC 16.2.1, Release with BUILD_TESTING=ON, lavapipe (Mesa 26.2.4, LLVM 23.1.1). ctest -R 'agc|shader|recompiler', on main 4e9a2a871:
    • This change: 589/596 pass.
    • main plus only the new test, built the same way: 587/596 pass.
    • Both fail agc_storage_kept_unit_settle, agc_driver_bc_block_copy, agc_driver_depth_compare_copy, agc_driver_native_multisample_depth, agc_driver_storage_write_back_overhang, agc_driver_staged_clear_sampled_read and agc_driver_native_depth_retirement, with the same messages.
    • agc_driver_storage_flush_ordering runs its open-batch case there (the container has no write watching, so the in-flight case is skipped). On main it fails with storage flush ordering, writer in the open batch: the pending image's store put its older texels over a newer address-based store; with this change it passes. Three more direct runs of each build gave the same results.
    • agc_pending_key_stores and agc_driver_preparation_scope_settle fail intermittently at the node's load (25–40) with and without this change; in this run only main failed the former. Neither test creates a storage image, so neither reaches the changed code.
  • On that node, a temporary variant of the test that runs both cases without write watching printed the precondition and the result instead of checking them:
    • Before each flush, the store's address-based lease was pending in the expected batch, so the precondition holds in both cases.
    • Writer in flight: the dword was kept on both builds, because the compare already sees the GPU's store; this case needs write watching to tell them apart. On main 8856f180c the same kind of variant showed the writer's batch still unfinished after main's flush and finished after this change's flush. No pending write covered the dword there, so the wait comes from the lease alone.
  • tools/check_conventions.py --base upstream/main and git diff --check pass.
  • NVIDIA GeForce RTX 3080 (615.78.08), CachyOS (Linux 7.2.10), GCC 16.2.1, Release with BUILD_TESTING=ON, write watching available, on main 4e9a2a871:
    • main plus only the new test: it fails in the in-flight case with storage flush ordering, writer in flight: the pending image's store put its older texels over a newer address-based store.
    • This change: the test passes. ctest -R 'agc|shader|recompiler|pm4|draw|position': 598 of 599 pass. The failure, agc_driver_store_over_untracked, fails on Linux main too (reported on #5671); agc_import_watch_other_family and agc_driver_stencil_ref_export skip.
  • Windows: Scramblrrrr ran an earlier version of this change and of its test natively, on his branch; that version synced on every overlap. The test passed, and failed with the older-texels message once the sync was removed: https://github.com/boykopovar/AnyPS5/issues/2523#issuecomment-6139337296. This version: Amoenus ran an independent red/green on this PR's head 9fffceaa9 (Windows 11, WinLibs GCC 15.2.0, Release; RTX 5080 with driver 610.62 and the Radeon iGPU of a Ryzen 9 9950X3D): main 2e5dd5aa1 (the head's parent) plus only the new test failed 5/5 per GPU with the older-texels message, the head passed 5/5 per GPU with both cases running, and the new test passed 20/20 per GPU: https://github.com/boykopovar/AnyPS5/pull/6364#issuecomment-6193265858
  • PPSA11386 v01.018.000, on our 007 stack (main 62f875871 plus local commits), RTX 3080, in a bubblewrap sandbox:
    • The run that stopped on this, at frame 1751, read the image's texels as workgroup counts. Two earlier runs had stopped on the same error, at frames 1730 and 2040.
    • The first version of this change took the next run past all three stop frames, to frame 2289, where we stopped it, with no out-of-range indirect argument line.
    • The reap and FinishUpTo came later on the same stack, and the later cinematic and gameplay runs above used them.
    • On that stack the check ran before FlushPending took the GPU mutex; here it runs under it.
    • This commit on main alone was not run on the title: main stops earlier (#5714).

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
  • Unblocks: PPSA11386 #5714
  • GPUs tested: lavapipe (Mesa 26.2.4, LLVM 23.1.1), Arch Linux container (the new test runs only its open-batch case there); NVIDIA GeForce RTX 3080, 615.78.08, CachyOS
  • AI-assisted: yes (Claude Code)

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4873814221 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6364). Originally posted by [SleglJan](https://github.com/SleglJan) on 2026-10-15T13:11:41Z. --- ### What A flush stores a storage image's pending results to guest memory (`StorageTexture::FlushPending`). The store keeps the 64 KiB blocks that the write tracker shows written since the image was last in sync (`writeBackLayers`). An address-based dispatch marks the pages it stored to only when its batch's completion runs (`BdaResources::markWrittenPages`). A flush that runs after the GPU executed such a store, but before that completion, finds the blocks unwritten and stores the image's older texels over the newer bytes. On our 007 stack (see Tested), PPSA11386 (007 First Light) stopped on this in its first cinematic, with `Vulkan dispatch: workgroup count … exceeds device limits`. The sequence: - an address-based pass writes an indirect dispatch's arguments into memory that a storage image with pending results also covers; - the CPU-resolved indirect dispatch flushes the argument dwords (`decideIndirect`) before that pass's completion has run; - the flush stores the image's older texels over the arguments, and the dispatch reads them as its workgroup counts. Changes: - `Recorder::PendingWriterSerial(address, bytes)` returns the serial of the newest unfinished batch that writes the range or holds it in an address-based lease. A write is a noted pending write; a lease is an `AddressBased` in-place read, as a single range or in a read list (`readOverlap` takes an optional reader kind for this). The open batch reports `OpenSerial()`. The result is 0 when there is no such batch. - `FlushPending` checks for such a writer after it takes the GPU mutex, and does not wait inside a completion action (`Recorder::InCompletion`): - it first completes the batches that already finished (`Reap`, no GPU wait); - if the writer is still unfinished, it finishes the in-flight batches up to the writer (`FinishUpTo`), or syncs when the writer is in the open batch (`Sync`, counted as an address-based sync when the open batch only leases the range); - the writer's marks have then landed, and `writeBackLayers` keeps its blocks; - if the wait throws, the images the flush took are registered as pending again (`reconcilePending`), as after a failed store. - New execution test `agc_driver_storage_flush_ordering`, two cases on separate images in one guest block, which is write-watched where the host supports it: - a compute dispatch stores two texels of a 256x128 R32 storage image, one in each of its two 64 KiB blocks; - a second dispatch stores a dword into the image's first block through a global address; - writer in flight: the test waits for the GPU without running completions (`SubmitAndEpoch`, `WaitRecorded`) and flushes the image; - writer in the open batch: the test flushes the image without submitting; - before each flush it checks that the store's address-based lease is pending in the expected batch (in flight or open); - expected in both: the dword is kept and the texel in the second block is stored. - The two cases cover the reap and the `Sync` paths. `FinishUpTo` (a writer in flight whose fence has not signaled) is not covered: the test cannot keep a batch running on the GPU deterministically. - Without write watching, the in-flight case is skipped and the open-batch case still runs: the write-back then compares guest memory, which the GPU has not written yet at the flush. The in-flight case is also skipped when the recorder cannot wait for the GPU without running completions. The reap runs completion actions on the flushing thread, as the `Sync` it can save would. The wait holds the GPU mutex; on a game thread's flush hook it is a locked GPU wait where the hook's own pending-write wait runs unlocked. A kept block keeps all 64 KiB, so the image's results elsewhere in that block are not stored, as for a block the CPU wrote. `FlushAllPending` flushes the whole address range, so the idle store now also waits for any unfinished writer. The idle store runs on queue 0 after all queues have been idle for 50 ms. The 007 runs below had it turned off with a switch of our stack that `main` does not have, so that path is not measured. The flip packet's store of small pending images (`StoreSmallPending`) flushes each one, so a flip can wait as well; the figures below include those. Cost, measured on our 007 stack with this logic and a counter of these waits that this PR does not add (RTX 3080, Linux), per 10 s, summed over the threads that flush (with pipelined draws, the committer too): - First cinematic: 262–337 flushes per 10 s found a writer; the waits took 0.61 s per 10 s. - Gameplay: 570 such flushes per 10 s took 1.09 s per 10 s, about 11% of the wall time; queue 0's packet worker is about 99% busy there. - Most of these waits are for the open batch (257 of 301 in the cinematic, about 99% in gameplay): a submit plus a wait for all recorded work, about 2 ms each (0.62 s over 301 waits in the cinematic). - Menu, with the reap but before `FinishUpTo`: 469 waits per 10 s took 3.9 s, 342 of them for the open batch. The run that introduced a first version (always `Sync`) was about 7% slower in the menu than the run before (2.6–2.87 vs 2.85–3.2 FPS); it also added #4554's DCC-key wait (later measured as negligible), and no run with only this wait switched off was made. The condition is broader than this bug needs: in one gameplay window on our stack, 97% of the waits had the driver's own unit-shadow publish as the newest overlapping writer, which is marked when it is recorded. A narrower rule would skip writers whose bytes are marked when they are recorded. That needs a source on each pending-write note and a check of every source (an alias copy between images, for one, notes a write that lands later through the image's write-back), so it is left for a follow-up. A writer's age is not a sound criterion on `main`: an older address-based store can sit in texels the newer results did not write, and only its marks keep that block. Pipelined commits (#1201, #1202): - Queue 0's committer thread commits draws by default (depth 8; `APS5_PIPELINED_DRAWS=0` turns it off), and DMA stores with `APS5_PIPELINE_DMA`. Its calls to `FlushPending` get the wait on the committer thread, under the GPU mutex. - The wait cannot wait for the committer: - it waits only on recorder fences, and the recorder's submissions wait on no semaphore; - `DrawPipeline::Drain` throws when the calling thread holds the GPU mutex, so neither the wait nor the completions it runs can drain the committer. - Our 007 runs used a cross-test of #1201 with `APS5_PIPELINED_DRAWS=8`, which is now `main`'s default. Overlap: - #5058 adds a `FlushPending` of the indirect arguments when an indirect dispatch picks its path. That flush would get this wait too. No shared lines. - #1747, #1896 and #6208 move more `FlushPending` callers onto the committer; #5867 changes how the committer waits for work. - #4654 (merged) stores pending images before a use whose written buffer ranges overlap them. An address-based store has no written ranges when it is recorded, so it is not covered there; the new test fails on `main`, which has #4654. ### Tested - Linux build node: Arch Linux container on a 16-thread Xeon E5-2640 v3, GCC 16.2.1, Release with `BUILD_TESTING=ON`, lavapipe (Mesa 26.2.4, LLVM 23.1.1). `ctest -R 'agc|shader|recompiler'`, on `main` 4e9a2a871: - This change: 589/596 pass. - `main` plus only the new test, built the same way: 587/596 pass. - Both fail `agc_storage_kept_unit_settle`, `agc_driver_bc_block_copy`, `agc_driver_depth_compare_copy`, `agc_driver_native_multisample_depth`, `agc_driver_storage_write_back_overhang`, `agc_driver_staged_clear_sampled_read` and `agc_driver_native_depth_retirement`, with the same messages. - `agc_driver_storage_flush_ordering` runs its open-batch case there (the container has no write watching, so the in-flight case is skipped). On `main` it fails with `storage flush ordering, writer in the open batch: the pending image's store put its older texels over a newer address-based store`; with this change it passes. Three more direct runs of each build gave the same results. - `agc_pending_key_stores` and `agc_driver_preparation_scope_settle` fail intermittently at the node's load (25–40) with and without this change; in this run only `main` failed the former. Neither test creates a storage image, so neither reaches the changed code. - On that node, a temporary variant of the test that runs both cases without write watching printed the precondition and the result instead of checking them: - Before each flush, the store's address-based lease was pending in the expected batch, so the precondition holds in both cases. - Writer in flight: the dword was kept on both builds, because the compare already sees the GPU's store; this case needs write watching to tell them apart. On `main` 8856f180c the same kind of variant showed the writer's batch still unfinished after `main`'s flush and finished after this change's flush. No pending write covered the dword there, so the wait comes from the lease alone. - `tools/check_conventions.py --base upstream/main` and `git diff --check` pass. - NVIDIA GeForce RTX 3080 (615.78.08), CachyOS (Linux 7.2.10), GCC 16.2.1, Release with `BUILD_TESTING=ON`, write watching available, on `main` 4e9a2a871: - `main` plus only the new test: it fails in the in-flight case with `storage flush ordering, writer in flight: the pending image's store put its older texels over a newer address-based store`. - This change: the test passes. `ctest -R 'agc|shader|recompiler|pm4|draw|position'`: 598 of 599 pass. The failure, `agc_driver_store_over_untracked`, fails on Linux `main` too (reported on #5671); `agc_import_watch_other_family` and `agc_driver_stencil_ref_export` skip. - Windows: Scramblrrrr ran an earlier version of this change and of its test natively, on his branch; that version synced on every overlap. The test passed, and failed with the older-texels message once the sync was removed: https://github.com/boykopovar/AnyPS5/issues/2523#issuecomment-6139337296. This version: Amoenus ran an independent red/green on this PR's head `9fffceaa9` (Windows 11, WinLibs GCC 15.2.0, Release; RTX 5080 with driver 610.62 and the Radeon iGPU of a Ryzen 9 9950X3D): `main` 2e5dd5aa1 (the head's parent) plus only the new test failed 5/5 per GPU with the older-texels message, the head passed 5/5 per GPU with both cases running, and the new test passed 20/20 per GPU: https://github.com/boykopovar/AnyPS5/pull/6364#issuecomment-6193265858 - PPSA11386 v01.018.000, on our 007 stack (`main` 62f875871 plus local commits), RTX 3080, in a bubblewrap sandbox: - The run that stopped on this, at frame 1751, read the image's texels as workgroup counts. Two earlier runs had stopped on the same error, at frames 1730 and 2040. - The first version of this change took the next run past all three stop frames, to frame 2289, where we stopped it, with no out-of-range indirect argument line. - The reap and `FinishUpTo` came later on the same stack, and the later cinematic and gameplay runs above used them. - On that stack the check ran before `FlushPending` took the GPU mutex; here it runs under it. - This commit on `main` alone was not run on the title: `main` stops earlier (#5714). ### Checklist - [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] Unblocks: PPSA11386 #5714 - [x] GPUs tested: lavapipe (Mesa 26.2.4, LLVM 23.1.1), Arch Linux container (the new test runs only its open-batch case there); NVIDIA GeForce RTX 3080, 615.78.08, CachyOS - [x] AI-assisted: yes (Claude Code) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
github-actions[bot] commented 2026-10-15 13:26:34 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-15T13:26:34Z.


Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.

Pull request Shared files not compared
PR 1368 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 1395 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 4448 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 5431 core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
PR 5609 core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6185 core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
PR 6186 core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
PR 6188 core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6192 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6197 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6202 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6280 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6360 core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
PR 6481 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6505 core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
PR 6539 core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6615 core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6718 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6820 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6946 core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6947 core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6960 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6971 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 6977 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 7154 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 7254 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 7256 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 7332 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 7604 core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
PR 7642 core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp
core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp
core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6193187501 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6364#issuecomment-6193187501). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-15T13:26:34Z. --- <!-- pr-overlap --> Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap. | Pull request | Shared files not compared | |---|---| | [PR 1368](https://www.github.com/boykopovar/AnyPS5/pull/1368) | `core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp` | | [PR 1395](https://www.github.com/boykopovar/AnyPS5/pull/1395) | `core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp` | | [PR 4448](https://www.github.com/boykopovar/AnyPS5/pull/4448) | `core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp` | | [PR 5431](https://www.github.com/boykopovar/AnyPS5/pull/5431) | `core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp` | | [PR 5609](https://www.github.com/boykopovar/AnyPS5/pull/5609) | `core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp` | | [PR 6185](https://www.github.com/boykopovar/AnyPS5/pull/6185) | `core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp` | | [PR 6186](https://www.github.com/boykopovar/AnyPS5/pull/6186) | `core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp` | | [PR 6188](https://www.github.com/boykopovar/AnyPS5/pull/6188) | `core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp` | | [PR 6192](https://www.github.com/boykopovar/AnyPS5/pull/6192) | `core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp` | | [PR 6197](https://www.github.com/boykopovar/AnyPS5/pull/6197) | `core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp` | | [PR 6202](https://www.github.com/boykopovar/AnyPS5/pull/6202) | `core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp` | | [PR 6280](https://www.github.com/boykopovar/AnyPS5/pull/6280) | `core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp` | | [PR 6360](https://www.github.com/boykopovar/AnyPS5/pull/6360) | `core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp` | | [PR 6481](https://www.github.com/boykopovar/AnyPS5/pull/6481) | `core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp` | | [PR 6505](https://www.github.com/boykopovar/AnyPS5/pull/6505) | `core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp` | | [PR 6539](https://www.github.com/boykopovar/AnyPS5/pull/6539) | `core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp` | | [PR 6615](https://www.github.com/boykopovar/AnyPS5/pull/6615) | `core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp` | | [PR 6718](https://www.github.com/boykopovar/AnyPS5/pull/6718) | `core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp` | | [PR 6820](https://www.github.com/boykopovar/AnyPS5/pull/6820) | `core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp` | | [PR 6946](https://www.github.com/boykopovar/AnyPS5/pull/6946) | `core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp` | | [PR 6947](https://www.github.com/boykopovar/AnyPS5/pull/6947) | `core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp` | | [PR 6960](https://www.github.com/boykopovar/AnyPS5/pull/6960) | `core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp` | | [PR 6971](https://www.github.com/boykopovar/AnyPS5/pull/6971) | `core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp` | | [PR 6977](https://www.github.com/boykopovar/AnyPS5/pull/6977) | `core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp` | | [PR 7154](https://www.github.com/boykopovar/AnyPS5/pull/7154) | `core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp` | | [PR 7254](https://www.github.com/boykopovar/AnyPS5/pull/7254) | `core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp` | | [PR 7256](https://www.github.com/boykopovar/AnyPS5/pull/7256) | `core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp` | | [PR 7332](https://www.github.com/boykopovar/AnyPS5/pull/7332) | `core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp` | | [PR 7604](https://www.github.com/boykopovar/AnyPS5/pull/7604) | `core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp` | | [PR 7642](https://www.github.com/boykopovar/AnyPS5/pull/7642) | `core/libs/prx/libSceAgcDriver/Graphics/include/Recorder.hpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Recorder.cpp`<br>`core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp` |
Amoenus commented 2026-10-15 13:30:23 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Amoenus on 2026-10-15T13:30:23Z.


@SleglJan Independent Windows red/green result on unchanged head 9fffceaa9a07a70d0fac7f8ad7a0af335343f412 / parent main 2e5dd5aa144af1bf90a214a6341bf3e1b4e6d47a:

  • Parent production plus only your unchanged fixture (control0091c0861): 5/5 fail per GPU at writer in flight: the pending image's store put its older texels over a newer address-based store.
  • Exact PR head: 5/5 pass per GPU. Both the in-flight and open-batch cases run; no internal case omissions or CTest skips/timeouts. Maximum0.504s.
  • Fixture blob is identical in both builds: ec90020045fadb43582ef3b03093e54f9a4990f1. Both checkouts stayed clean/pinned, target/dependencies rebuilt, fresh serial processes, AnyPS5 shader cache disabled and Vulkan required. Physical-device output checked in every run.

Windows11 Enterprise26200, WinLibs GCC15.2.0r7 Release, bundled dependencies/SPIRV-Tools: RTX5080 driver610.62/32.0.16.1062 and AMD Radeon(TM) Graphics (Ryzen9950X3D) driver32.0.21036.18.

Scope: this covers the two fixture paths, not a deliberately unsignaled FinishUpTo path, error-recovery injection, your title stack or performance. Full Windows app/libs build, patched-library validation, conventions and registration now pass. The new fixture additionally passes 20/20 per physical GPU, both cases run in every process, maximum0.61s NVIDIA/0.53s AMD.

Of26 selected nearby groups per selector,25 pass and agc_driver_store_over_untracked fails at the first result was not stored (#6347). That assertion was previously reproduced on unchanged main598 and has the separate fixture correction #6359; I have not rerun this entire26-group matrix on parent2e5. This is not a fully green matrix or a full-suite result. Maximum passing duration5.50s NVIDIA/5.33s AMD; no CTest skips/timeouts. Selector counts are not blanket per-vendor coverage for private recorder fixtures.

Cppcheck2.20 then clang-tidy23.1.3 parse the three changed translation units (66.192s analyzer time), without parser/configuration errors or timeouts. Existing copy/return advisories, the pre-existing destructor-to-SamplesTotal throw warning, guarded Context resolver and timer warnings, and old constructor dead-store warnings remain outside the changed logic; no new defect was established from them. The new fixture has no selected diagnostic. No blanket analyzer-clean claim. AI-assisted: Codex.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6193265858 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6364#issuecomment-6193265858). Originally posted by [Amoenus](https://github.com/Amoenus) on 2026-10-15T13:30:23Z. --- @SleglJan Independent Windows red/green result on unchanged head `9fffceaa9a07a70d0fac7f8ad7a0af335343f412` / parent main `2e5dd5aa144af1bf90a214a6341bf3e1b4e6d47a`: - Parent production plus only your unchanged fixture (control0091c0861): **5/5 fail per GPU** at `writer in flight: the pending image's store put its older texels over a newer address-based store`. - Exact PR head: **5/5 pass per GPU**. Both the in-flight and open-batch cases run; no internal case omissions or CTest skips/timeouts. Maximum0.504s. - Fixture blob is identical in both builds: `ec90020045fadb43582ef3b03093e54f9a4990f1`. Both checkouts stayed clean/pinned, target/dependencies rebuilt, fresh serial processes, AnyPS5 shader cache disabled and Vulkan required. Physical-device output checked in every run. Windows11 Enterprise26200, WinLibs GCC15.2.0r7 Release, bundled dependencies/SPIRV-Tools: RTX5080 driver610.62/32.0.16.1062 and AMD Radeon(TM) Graphics (Ryzen9950X3D) driver32.0.21036.18. Scope: this covers the two fixture paths, not a deliberately unsignaled `FinishUpTo` path, error-recovery injection, your title stack or performance. Full Windows app/libs build, patched-library validation, conventions and registration now pass. The new fixture additionally passes **20/20 per physical GPU**, both cases run in every process, maximum0.61s NVIDIA/0.53s AMD. Of26 selected nearby groups per selector,25 pass and `agc_driver_store_over_untracked` fails at `the first result was not stored` (#6347). That assertion was previously reproduced on unchanged main598 and has the separate fixture correction #6359; I have not rerun this entire26-group matrix on parent2e5. This is not a fully green matrix or a full-suite result. Maximum passing duration5.50s NVIDIA/5.33s AMD; no CTest skips/timeouts. Selector counts are not blanket per-vendor coverage for private recorder fixtures. Cppcheck2.20 then clang-tidy23.1.3 parse the three changed translation units (66.192s analyzer time), without parser/configuration errors or timeouts. Existing copy/return advisories, the pre-existing destructor-to-SamplesTotal throw warning, guarded Context resolver and timer warnings, and old constructor dead-store warnings remain outside the changed logic; no new defect was established from them. The new fixture has no selected diagnostic. No blanket analyzer-clean claim. AI-assisted: Codex. <!-- codex-pr6364-windows-validation-v1 -->
SleglJan commented 2026-10-15 21:41:17 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by SleglJan on 2026-10-15T21:41:17Z.


Thanks @Amoenus, that's the Windows run this version was missing (and on AMD too). I added your result to Tested.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6202867814 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6364#issuecomment-6202867814). Originally posted by [SleglJan](https://github.com/SleglJan) on 2026-10-15T21:41:17Z. --- Thanks @Amoenus, that's the Windows run this version was missing (and on AMD too). I added your result to Tested. AI-assisted: yes (Claude Code)
Scramblrrrr commented 2026-10-16 17:40:38 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Scramblrrrr on 2026-10-16T17:40:38Z.


Fresh Windows11/RTX5070Ti617.42 cross-test on current integrationc6bd8b539047dacb9ddc95b41c45e69b78d39f19 (main d9b696ddb + shared-table/007 boot stack + canonical #6679 36529f17d and #6364 9fffceaa9; #4339 excluded):30/30 selected native controls PASS15.94s, no skips. Includes storage_flush_ordering, storage_write_back_overhang, depth_storage_dispatch, tessellation, prepared_graphics and its unset/0/1 prebuild cases, serializer, shader memory/disk cache, shared tables and draw-cache checks.

6364 negative control: retained the new fixture and other integration code, removed only FlushPending's PendingWriterSerial/Reap/Sync/FinishUpTo wait block, rebuilt the unpatched driver and ran the fixture. It FAILS in0.37s with storage flush ordering, writer in flight: the pending image's store put its older texels over a newer address-based store. Restored the exact committed Texture.cpp, rebuilt patched modules, and30/30PASS14.53s. Source/conventions clean. This is a wait-only negative in our integration, not a standalone main red/green.

Public branch https://github.com/Scramblrrrr/AnyPS5/tree/codex/first-light-level-two-lane . Matched driver/Agc/VideoOut now staged together, same2GiBfree/28GiBprivate guard. Starting007; title level/cinematic outcome still pending, so the native pass is not claimed as playable gameplay. AI-assisted: Codex; title data local.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6221245050 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6364#issuecomment-6221245050). Originally posted by [Scramblrrrr](https://github.com/Scramblrrrr) on 2026-10-16T17:40:38Z. --- Fresh Windows11/RTX5070Ti617.42 cross-test on current integrationc6bd8b539047dacb9ddc95b41c45e69b78d39f19 (main d9b696ddb + shared-table/007 boot stack + canonical #6679 36529f17d and #6364 9fffceaa9; #4339 excluded):30/30 selected native controls PASS15.94s, no skips. Includes storage_flush_ordering, storage_write_back_overhang, depth_storage_dispatch, tessellation, prepared_graphics and its unset/0/1 prebuild cases, serializer, shader memory/disk cache, shared tables and draw-cache checks. 6364 negative control: retained the new fixture and other integration code, removed only FlushPending's PendingWriterSerial/Reap/Sync/FinishUpTo wait block, rebuilt the unpatched driver and ran the fixture. It FAILS in0.37s with `storage flush ordering, writer in flight: the pending image's store put its older texels over a newer address-based store`. Restored the exact committed Texture.cpp, rebuilt patched modules, and30/30PASS14.53s. Source/conventions clean. This is a wait-only negative in our integration, not a standalone main red/green. Public branch https://github.com/Scramblrrrr/AnyPS5/tree/codex/first-light-level-two-lane . Matched driver/Agc/VideoOut now staged together, same2GiBfree/28GiBprivate guard. Starting007; title level/cinematic outcome still pending, so the native pass is not claimed as playable gameplay. AI-assisted: Codex; title data local.
johnmaia commented 2026-10-16 18:54:03 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by johnmaia on 2026-10-16T18:54:03Z.


In-game run of head 9fffceaa9 on a title that loses file data to a late storage-image store: Epic Mickey: Rebrushed (PPSA15657, UE 4.27), short runs to the first level, Linux, RX 7600 (RADV, Mesa 25.2.8). Tree: main 5d9dcc42d + #6236 (needed to boot) + this head.

Tree Runs Failed before reaching the level
without this PR 8 3
without this PR, APS5_STORE_AT_FLIP=1 16 0
with this PR 16 3

With this PR, the failures were the same ObjectSerializationError on SM_MachineSet_01b as without it (1) and a SIGSEGV in the title's code (2). So this title's case isn't the one fixed here (details in #6636, comment 6221124027): an APR file read lands on a 64 KiB block that a storage image write-back stores to later, and the image isn't pending any more when the read starts. No new failure modes otherwise; the runs that got through reached the level and played.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6222536486 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6364#issuecomment-6222536486). Originally posted by [johnmaia](https://github.com/johnmaia) on 2026-10-16T18:54:03Z. --- In-game run of head 9fffceaa9 on a title that loses file data to a late storage-image store: Epic Mickey: Rebrushed (PPSA15657, UE 4.27), short runs to the first level, Linux, RX 7600 (RADV, Mesa 25.2.8). Tree: `main` 5d9dcc42d + #6236 (needed to boot) + this head. | Tree | Runs | Failed before reaching the level | |---|---|---| | without this PR | 8 | 3 | | without this PR, `APS5_STORE_AT_FLIP=1` | 16 | 0 | | with this PR | 16 | 3 | With this PR, the failures were the same `ObjectSerializationError` on `SM_MachineSet_01b` as without it (1) and a SIGSEGV in the title's code (2). So this title's case isn't the one fixed here (details in #6636, comment 6221124027): an APR file read lands on a 64 KiB block that a storage image write-back stores to later, and the image isn't pending any more when the read starts. No new failure modes otherwise; the runs that got through reached the level and played. AI-assisted: yes (Claude Code)
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!6364
No description provided.