fix(agc): do not wait for a storage image's own stamped writes before flushing it #12070

Merged
imellag merged 9 commits from upstream-pr/12070 into main 2026-11-15 02:24:06 +00:00
imellag commented 2026-10-27 18:41:04 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by imellag on 2026-10-27T18:41:04Z.


What

StorageTexture::FlushPending syncs when an unfinished batch writes the flushed range (#6364, 9fffceaa9a): a writer that stamps guest memory only when its batch completes (an address-based dispatch) must have its marks land before the write-back decides which 64 KiB blocks to keep. When the writer is in the open batch, that is a full Recorder::Sync.

Some writers need no such wait: storage image write-backs (writeBackLayers, writeBackWindows) call GuestMemory::MarkWritten for what they store while they are recorded, and a unit shadow publish copies bytes those write-backs already stamped. The next write-back of the same range is recorded after them in the same queue, so it lands after them on the GPU anyway. Today the flush still waits for them. Example: an image is written back at one label, written again by a dispatch, then flushed again at the next label; the second flush finds the first one's publish in the open batch and drains the queue.

  • Recorder::NoteStampedWrites notes such ranges like NotePendingWrites and also keeps their write notes in the batch (stampedNotes). The two write-back paths and recordCopies in UnitShadow.cpp note their writes this way. The staged publish (the copy into a host buffer that writes guest memory at completion) does not.
  • When a flush stores a single image, FlushPending keeps the stamped notes that flush recorded (the image's write-backs and its publish), from Recorder::StampedNotesSince, in the image's flushNotes (the last 32). A flush that stores several images keeps none, so no image takes another's notes.
  • The next flush adds the image's flushNotes to the existing ownNotes exception of #9685, so it applies only where that one does: the flush stores a single image and that image has a host import. Otherwise ownNotes is cleared as on main. Any other writer over the range (another image's write-back or publish, a dispatch, draw, fill, label, CPU-resolved copy, address-based lease) still makes the flush wait, and CPU readers still sync on these writes through the pending-write snapshot as before.

tests/execution/StorageFlushOrdering.cpp gains a stored-again case: images are stored, written again by a dispatch and flushed again in the same open batch, and the newer texels must land. With one image and a host import the second flush must not submit the open batch. It must wait with two adjacent images flushed together, without a host import, when another stamped write that is not the image's own (noted with NoteStampedWrites over the image) is in the open batch, or when the image is flushed alone after a joint flush with its neighbour. A second registration, agc_driver_storage_flush_ordering_no_import, runs the stored-again cases with APS5_NO_HOST_IMPORT=1. main fails the one-image case (it waits), the first head of this PR failed the two-image case, the second head failed the unrelated stamped write case and the third the alone-after-joint case (they did not wait), the current head passes all of them. The two existing cases (writer in flight, writer in the open batch) still pass.

Overlaps:

  • #8887 (SleglJan) narrows the same check to the blocks of the stored layers. Complementary: here the writer is over the image's own blocks, so #8887 still waits for it. Same lines in FlushPending and in this test. #8887 merged on 2026-11-02 and this branch contains it (main merge 41f3e3c20e).
  • #6186 (ee6aba54) tags the publish note in recordCopies with a write kind (ShadowPublishWrite) and conflicts with this PR in Recorder.hpp, UnitShadow.cpp, the AGC CMakeLists.txt and the AGC debt file. Order agreed with ee6aba54 on #6186 (2026-10-31): this PR first, then #6186 rebases onto it and carries the stamped flag through its write kind. This PR does not need #6186, so it is not in Depends on.
  • #11694 (droid2299, merged) sends small tiled write-backs to the import instead of the unit shadow; that path (writeBackWindows' imported pieces) is noted as stamped here too.

Tested

No performance claim: main cannot run titles or the AGC execution tests on macOS yet, and I have no other platform for a main-vs-change capture.

@chitters2004 measured it on GTA V (PPSA04263, RTX 3080, Windows, main plus open GTA performance PRs, comment): the committer Recorder::Sync from FlushPending went from 2.24 per frame (6.87 ms per frame) to 0, and every wait it removed came from the flushed image's own write-back notes.

Current head 7d6f6c27cf: main d4efd8b82e merged in. One conflict, in Recorder.hpp: main added ReachValue and NotePendingReach next to this PR's NoteStampedWrites; both are kept. Reach notes are never stamped, so a flush still waits for them. macOS 27.2, Apple M4 Pro, MoltenVK 1.4.2, x86_64 Release under Rosetta 2, now on plain main (its AGC test targets build on macOS): ctest -R '^agc_driver_storage_flush_ordering' with ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation. main: 1 of 1 passes; this head: 2 of 2 (storage flush ordering tests passed, storage flush ordering stored-again tests passed). No VUID- and no missing-layer line in either log.

Previous head a8306d56f5: 41f3e3c20e merged main 88e804b0a7 with #8887 (combined results in this comment), 2b211c7231 merged main 5b1d381d5a, and a8306d56f5 fixes the test's expectation on hosts that compare host imports instead of watching them (details). The runs below are of the earlier heads.

Head e7e78cff0e, rebased onto main 98ddd9c179. One conflict, in the AGC CMakeLists.txt: main registers agc_driver_registration_prepare_budget where this PR registers agc_driver_storage_flush_ordering_no_import; both are kept. The other files merged without conflicts, and what this PR builds on is unchanged on main: noteWrite and NotePendingWrites still give each range its own write note, and PendingWriterSerial with ownNotes still skips a write by its note. With #8887's head 1f15e200f7 the only conflict is in StorageFlushOrdering.cpp, where both add cases.

macOS 27.2, Apple M4 Pro, MoltenVK 1.4.2 (Vulkan SDK 1.4.363.0), x86_64 Release under Rosetta. Support branch, not main: fork branch support/macos-boot-1030 (6747733e89) = main 98ddd9c179 + only the open macOS PRs #11447 #11554 #10552 #7631 #7804 #4630 and #13220 (the duplicate write_watch test registration that stops main's CMake on macOS), plus one local line that reads environ through _NSGetEnviron() in HostReportSources.cpp (main doesn't compile it on macOS; no open PR covers it yet). The conflicts of #11554, #10552, #7631, #7804 and #4630 with main are resolved in the merge commits. Change: fork branch support/macos-boot-1030-pr12070 (f426fc662b) = that branch + the four commits of this PR.

Focused tests on both with ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer, ctest -R 'storage_flush_ordering|linear_readback_label|linear_target|agc_driver_storage_(cache_budget|one_slice_alias|read_during_idle_store|write_back)|storage_cache_retained|depth_storage_reuse|flip_stores_small' -V:

  • base: 25 of 25 pass;
  • change: 26 of 26 pass, the extra one being this PR's agc_driver_storage_flush_ordering_no_import. Both storage_flush_ordering registrations pass (storage flush ordering tests passed, storage flush ordering stored-again tests passed);
  • in both logs the loader lists VK_LAYER_KHRONOS_validation as enabled by VK_INSTANCE_LAYERS, there is no was not found but was requested by env var VK_INSTANCE_LAYERS, and no VUID- line.

The 10 failures of the previous run (the "two different device resolvers" abort) are gone: #11705 has merged. Logs attached.

Previous head 3b3cd7377f (support branch support/macos-boot-1027, main d13b3d7c55): the same tests failed the same 10 tests on both sides for the resolver abort and passed otherwise, both storage_flush_ordering registrations passed on the change, no VUID-. God of War (PPSA28997) ran through the Cyclops fight on the second head with no crash or device loss; not rerun since.

python3 tools/check_conventions.py --base upstream/main (98ddd9c179): passed. tools/pr_overlap.py: conflicting lines only with #8887 (StorageFlushOrdering.cpp).

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: Apple M4 Pro, MoltenVK 1.4.2, macOS 27.2
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5039261077 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12070). Originally posted by [imellag](https://github.com/imellag) on 2026-10-27T18:41:04Z. --- ### What `StorageTexture::FlushPending` syncs when an unfinished batch writes the flushed range (#6364, 9fffceaa9a): a writer that stamps guest memory only when its batch completes (an address-based dispatch) must have its marks land before the write-back decides which 64 KiB blocks to keep. When the writer is in the open batch, that is a full `Recorder::Sync`. Some writers need no such wait: storage image write-backs (`writeBackLayers`, `writeBackWindows`) call `GuestMemory::MarkWritten` for what they store while they are recorded, and a unit shadow publish copies bytes those write-backs already stamped. The next write-back of the same range is recorded after them in the same queue, so it lands after them on the GPU anyway. Today the flush still waits for them. Example: an image is written back at one label, written again by a dispatch, then flushed again at the next label; the second flush finds the first one's publish in the open batch and drains the queue. - `Recorder::NoteStampedWrites` notes such ranges like `NotePendingWrites` and also keeps their write notes in the batch (`stampedNotes`). The two write-back paths and `recordCopies` in UnitShadow.cpp note their writes this way. The staged publish (the copy into a host buffer that writes guest memory at completion) does not. - When a flush stores a single image, `FlushPending` keeps the stamped notes that flush recorded (the image's write-backs and its publish), from `Recorder::StampedNotesSince`, in the image's `flushNotes` (the last 32). A flush that stores several images keeps none, so no image takes another's notes. - The next flush adds the image's `flushNotes` to the existing `ownNotes` exception of #9685, so it applies only where that one does: the flush stores a single image and that image has a host import. Otherwise `ownNotes` is cleared as on `main`. Any other writer over the range (another image's write-back or publish, a dispatch, draw, fill, label, CPU-resolved copy, address-based lease) still makes the flush wait, and CPU readers still sync on these writes through the pending-write snapshot as before. `tests/execution/StorageFlushOrdering.cpp` gains a stored-again case: images are stored, written again by a dispatch and flushed again in the same open batch, and the newer texels must land. With one image and a host import the second flush must not submit the open batch. It must wait with two adjacent images flushed together, without a host import, when another stamped write that is not the image's own (noted with `NoteStampedWrites` over the image) is in the open batch, or when the image is flushed alone after a joint flush with its neighbour. A second registration, `agc_driver_storage_flush_ordering_no_import`, runs the stored-again cases with `APS5_NO_HOST_IMPORT=1`. `main` fails the one-image case (it waits), the first head of this PR failed the two-image case, the second head failed the unrelated stamped write case and the third the alone-after-joint case (they did not wait), the current head passes all of them. The two existing cases (writer in flight, writer in the open batch) still pass. Overlaps: - #8887 (SleglJan) narrows the same check to the blocks of the stored layers. Complementary: here the writer is over the image's own blocks, so #8887 still waits for it. Same lines in `FlushPending` and in this test. #8887 merged on 2026-11-02 and this branch contains it (`main` merge `41f3e3c20e`). - #6186 (ee6aba54) tags the publish note in `recordCopies` with a write kind (`ShadowPublishWrite`) and conflicts with this PR in `Recorder.hpp`, `UnitShadow.cpp`, the AGC `CMakeLists.txt` and the AGC debt file. Order agreed with ee6aba54 on #6186 ([2026-10-31](https://github.com/boykopovar/AnyPS5/pull/6186#issuecomment-6547621563)): this PR first, then #6186 rebases onto it and carries the stamped flag through its write kind. This PR does not need #6186, so it is not in Depends on. - #11694 (droid2299, merged) sends small tiled write-backs to the import instead of the unit shadow; that path (`writeBackWindows`' imported pieces) is noted as stamped here too. ### Tested No performance claim: `main` cannot run titles or the AGC execution tests on macOS yet, and I have no other platform for a `main`-vs-change capture. @chitters2004 measured it on GTA V (PPSA04263, RTX 3080, Windows, `main` plus open GTA performance PRs, [comment](https://github.com/boykopovar/AnyPS5/pull/12070#issuecomment-6766766757)): the committer `Recorder::Sync` from `FlushPending` went from 2.24 per frame (6.87 ms per frame) to 0, and every wait it removed came from the flushed image's own write-back notes. **Current head `7d6f6c27cf`**: `main` `d4efd8b82e` merged in. One conflict, in `Recorder.hpp`: `main` added `ReachValue` and `NotePendingReach` next to this PR's `NoteStampedWrites`; both are kept. Reach notes are never stamped, so a flush still waits for them. macOS 27.2, Apple M4 Pro, MoltenVK 1.4.2, x86_64 Release under Rosetta 2, now on plain `main` (its AGC test targets build on macOS): `ctest -R '^agc_driver_storage_flush_ordering'` with `ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`. `main`: 1 of 1 passes; this head: 2 of 2 (`storage flush ordering tests passed`, `storage flush ordering stored-again tests passed`). No `VUID-` and no missing-layer line in either log. **Previous head `a8306d56f5`**: `41f3e3c20e` merged `main` `88e804b0a7` with #8887 (combined results in [this comment](https://github.com/boykopovar/AnyPS5/pull/12070#issuecomment-6573317789)), `2b211c7231` merged `main` `5b1d381d5a`, and `a8306d56f5` fixes the test's expectation on hosts that compare host imports instead of watching them ([details](https://github.com/boykopovar/AnyPS5/pull/12070#issuecomment-6630280381)). The runs below are of the earlier heads. **Head `e7e78cff0e`, rebased onto `main` `98ddd9c179`.** One conflict, in the AGC `CMakeLists.txt`: `main` registers `agc_driver_registration_prepare_budget` where this PR registers `agc_driver_storage_flush_ordering_no_import`; both are kept. The other files merged without conflicts, and what this PR builds on is unchanged on `main`: `noteWrite` and `NotePendingWrites` still give each range its own write note, and `PendingWriterSerial` with `ownNotes` still skips a write by its note. With #8887's head `1f15e200f7` the only conflict is in `StorageFlushOrdering.cpp`, where both add cases. macOS 27.2, Apple M4 Pro, MoltenVK 1.4.2 (Vulkan SDK 1.4.363.0), x86_64 Release under Rosetta. Support branch, not `main`: fork branch [`support/macos-boot-1030`](https://github.com/imellag/AnyPS5/commits/support/macos-boot-1030) (`6747733e89`) = `main` `98ddd9c179` + only the open macOS PRs #11447 #11554 #10552 #7631 #7804 #4630 and #13220 (the duplicate `write_watch` test registration that stops `main`'s CMake on macOS), plus one local line that reads `environ` through `_NSGetEnviron()` in `HostReportSources.cpp` (`main` doesn't compile it on macOS; no open PR covers it yet). The conflicts of #11554, #10552, #7631, #7804 and #4630 with `main` are resolved in the merge commits. Change: fork branch [`support/macos-boot-1030-pr12070`](https://github.com/imellag/AnyPS5/commits/support/macos-boot-1030-pr12070) (`f426fc662b`) = that branch + the four commits of this PR. Focused tests on both with `ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer`, `ctest -R 'storage_flush_ordering|linear_readback_label|linear_target|agc_driver_storage_(cache_budget|one_slice_alias|read_during_idle_store|write_back)|storage_cache_retained|depth_storage_reuse|flip_stores_small' -V`: - base: 25 of 25 pass; - change: 26 of 26 pass, the extra one being this PR's `agc_driver_storage_flush_ordering_no_import`. Both `storage_flush_ordering` registrations pass (`storage flush ordering tests passed`, `storage flush ordering stored-again tests passed`); - in both logs the loader lists `VK_LAYER_KHRONOS_validation` as enabled by `VK_INSTANCE_LAYERS`, there is no `was not found but was requested by env var VK_INSTANCE_LAYERS`, and no `VUID-` line. The 10 failures of the previous run (the "two different device resolvers" abort) are gone: #11705 has merged. Logs attached. **Previous head `3b3cd7377f`** (support branch `support/macos-boot-1027`, `main` `d13b3d7c55`): the same tests failed the same 10 tests on both sides for the resolver abort and passed otherwise, both `storage_flush_ordering` registrations passed on the change, no `VUID-`. God of War (PPSA28997) ran through the Cyclops fight on the second head with no crash or device loss; not rerun since. `python3 tools/check_conventions.py --base upstream/main` (`98ddd9c179`): passed. `tools/pr_overlap.py`: conflicting lines only with #8887 (`StorageFlushOrdering.cpp`). ### 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: Apple M4 Pro, MoltenVK 1.4.2, macOS 27.2 - [x] AI-assisted: yes
MarcZX10 commented 2026-10-27 18:58:34 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-27T18:58:34Z.

Review: CHANGES_REQUESTED


I reviewed the recorder changes and the new ordering test, and I agree with the concern already raised by the collaborator: PendingUnstampedWriterSerial skips every stamped note before FlushPending can apply the existing ownNotes exception, which is deliberately restricted to a single image with an existing host import. The new test covers a repeated store for one image, but not multiple flushed images or an image without a host import. Please explain why the #9685 restriction does not apply to those stamped writes, or constrain the skip to the same safe cases and add the requested multi-image/no-import regression case. I am not treating the current test as evidence for those cases.

The performance report also does not use the repository main baseline: it names a custom tree containing open macOS boot PRs and #11705. Please rerun the matched capture against current main and this exact change, and refresh the attached digest/traces as requested by the performance-report check. Finally, coordinate the same-line/test overlap with open #8887 and record the agreed ordering in Depends on per CONTRIBUTING; the overlap section currently says either PR may land second while the checklist says none.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5672703742 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12070#pullrequestreview-5672703742). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-27T18:58:34Z. **Review:** CHANGES_REQUESTED --- I reviewed the recorder changes and the new ordering test, and I agree with the concern already raised by the collaborator: `PendingUnstampedWriterSerial` skips every stamped note before `FlushPending` can apply the existing `ownNotes` exception, which is deliberately restricted to a single image with an existing host import. The new test covers a repeated store for one image, but not multiple flushed images or an image without a host import. Please explain why the #9685 restriction does not apply to those stamped writes, or constrain the skip to the same safe cases and add the requested multi-image/no-import regression case. I am not treating the current test as evidence for those cases. The performance report also does not use the repository `main` baseline: it names a custom tree containing open macOS boot PRs and #11705. Please rerun the matched capture against current `main` and this exact change, and refresh the attached digest/traces as requested by the performance-report check. Finally, coordinate the same-line/test overlap with open #8887 and record the agreed ordering in `Depends on` per CONTRIBUTING; the overlap section currently says either PR may land second while the checklist says `none`.
MarcZX10 commented 2026-10-27 19:32:38 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-27T19:32:38Z.

Review: CHANGES_REQUESTED


Re-reviewed exact head 156bbaaaba0ebdf4f647df103377874358c38b29. The new guard and the no-import/multi-image regression cases address the broad skip outside the existing single-image, host-import case. I found three remaining blockers:

  1. When ownStoresSkipped is true, PendingUnstampedWriterSerial ignores every overlapping note in batch.stampedNotes, not only this flush's ownNotes. NoteStampedWrites is used both for storage write-backs and UnitShadow::recordCopies. The single-image/host-import guard does not establish that every overlapping stamped note belongs to the image being flushed; a pending unit-shadow publish or another overlapping stamped writer can still be skipped. Please narrow the exception to the flush's own writes, or document the invariant that rules out unrelated stamped writers and add a regression with an unrelated stamped publish overlapping a single imported image.

  2. The current heads of #8887 and #6186 both conflict with this head in shared AGC code. Pairwise merge-tree reports conflicts for #8887 in Recorder.hpp, Recorder.cpp, Texture.cpp and StorageFlushOrdering.cpp; for #6186 it reports conflicts in CMakeLists.txt, Recorder.hpp, UnitShadow.cpp and the debt file. The PR describes these overlaps but still says Depends on: none. CONTRIBUTING requires agreement on order and a declared dependency for same-line overlaps. Please coordinate and declare the agreed order. I checked #11694 as well; its current head merges cleanly with this PR, so I do not see a required ordering there.

  3. The updated report includes matched traces and digests, but its baseline is e5d3b0097f from a custom tree with macOS boot PRs and #11705, rather than current upstream main d13b3d7c55. The perf contribution rule requires a current-main/change comparison on the same machine and scene. Please provide that comparison on a supported platform or remove the performance claim and label.

The current-main merge preview for this head is clean. I am requesting these specific corrections; this is not an approval of the performance or ordering claims.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5673104884 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12070#pullrequestreview-5673104884). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-27T19:32:38Z. **Review:** CHANGES_REQUESTED --- Re-reviewed exact head 156bbaaaba0ebdf4f647df103377874358c38b29. The new guard and the no-import/multi-image regression cases address the broad skip outside the existing single-image, host-import case. I found three remaining blockers: 1. When ownStoresSkipped is true, PendingUnstampedWriterSerial ignores every overlapping note in batch.stampedNotes, not only this flush's ownNotes. NoteStampedWrites is used both for storage write-backs and UnitShadow::recordCopies. The single-image/host-import guard does not establish that every overlapping stamped note belongs to the image being flushed; a pending unit-shadow publish or another overlapping stamped writer can still be skipped. Please narrow the exception to the flush's own writes, or document the invariant that rules out unrelated stamped writers and add a regression with an unrelated stamped publish overlapping a single imported image. 2. The current heads of #8887 and #6186 both conflict with this head in shared AGC code. Pairwise merge-tree reports conflicts for #8887 in Recorder.hpp, Recorder.cpp, Texture.cpp and StorageFlushOrdering.cpp; for #6186 it reports conflicts in CMakeLists.txt, Recorder.hpp, UnitShadow.cpp and the debt file. The PR describes these overlaps but still says Depends on: none. CONTRIBUTING requires agreement on order and a declared dependency for same-line overlaps. Please coordinate and declare the agreed order. I checked #11694 as well; its current head merges cleanly with this PR, so I do not see a required ordering there. 3. The updated report includes matched traces and digests, but its baseline is e5d3b0097f from a custom tree with macOS boot PRs and #11705, rather than current upstream main d13b3d7c55. The perf contribution rule requires a current-main/change comparison on the same machine and scene. Please provide that comparison on a supported platform or remove the performance claim and label. The current-main merge preview for this head is clean. I am requesting these specific corrections; this is not an approval of the performance or ordering claims.
adriadam10 commented 2026-10-28 10:31:43 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-28T10:31:43Z.

Review: DISMISSED


Thanks for narrowing the skip to the image's own notes. One ownership problem remains, confirmed in the source (same point @mashingaan raised):

  • core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp:4319-4328: StampedNotesSince(firstNote) returns every stamped note recorded during the whole flush, and the same vector is appended to flushNotes of every texture in flush. After a joint A+B flush, A's flushNotes contain B's write-back/publish notes. A later flush of A alone with a host import adds them to ownNotes (line 4253-4254), so B's write over an overlapping range is treated as A's own and the flush does not wait. Keep per-texture notes (collect them around each texture's own write-back, and decide how a shared unit-shadow publish is attributed), or only record flushNotes when the flush stored a single image.
  • tests/execution/StorageFlushOrdering.cpp: add the sequence joint A+B flush, then A dirtied and flushed alone with a host import, with B's range overlapping A's flush range. It must wait. The current "unrelated" case notes the foreign write after the first flush, so it does not cover this.
  • Depends on #8887, which is still open; rebase on it once it lands (the same lines in FlushPending and in this test will conflict).
  • The perf label asks for the main vs change summary lines and tools/trace_digest.py output (or drop the label/perf framing if this is a correctness-only change, as the body says "No performance claim").
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5681211686 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12070#pullrequestreview-5681211686). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-28T10:31:43Z. **Review:** DISMISSED --- Thanks for narrowing the skip to the image's own notes. One ownership problem remains, confirmed in the source (same point @mashingaan raised): - `core/libs/prx/libSceAgcDriver/Graphics/src/Texture.cpp:4319-4328`: `StampedNotesSince(firstNote)` returns every stamped note recorded during the whole flush, and the same vector is appended to `flushNotes` of every texture in `flush`. After a joint A+B flush, A's `flushNotes` contain B's write-back/publish notes. A later flush of A alone with a host import adds them to `ownNotes` (line 4253-4254), so B's write over an overlapping range is treated as A's own and the flush does not wait. Keep per-texture notes (collect them around each texture's own write-back, and decide how a shared unit-shadow publish is attributed), or only record `flushNotes` when the flush stored a single image. - `tests/execution/StorageFlushOrdering.cpp`: add the sequence joint A+B flush, then A dirtied and flushed alone with a host import, with B's range overlapping A's flush range. It must wait. The current "unrelated" case notes the foreign write after the first flush, so it does not cover this. - Depends on #8887, which is still open; rebase on it once it lands (the same lines in `FlushPending` and in this test will conflict). - The `perf` label asks for the `main` vs change summary lines and `tools/trace_digest.py` output (or drop the label/perf framing if this is a correctness-only change, as the body says "No performance claim").
MarcZX10 commented 2026-10-29 06:18:21 +00:00 (Migrated from github.com)

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

Review: CHANGES_REQUESTED


Re-checked — changes requested

The latest head 3b3cd7377fa40e6d98828bfcbf877feca04fe96a addresses the stamped-note ownership blocker: only single-image flushes retain their own notes, while multi-image flushes retain none, and the author added the joint A+B then single-A regression. The author also removed the performance claim and records Depends on: #8887; I verified #8887 is still open.

One integration blocker remains. A pairwise merge preview with open #6186 still conflicts in CMakeLists.txt, Recorder.hpp, UnitShadow.cpp, and the AGC debt file. The #6186 author has not recorded an agreed landing order, and this PR does not list it as a dependency. Please coordinate that order and update the checklist/branch accordingly. This branch is also 1,367 commits behind current main 2960e9a6e7e1fc99c4ed180c71495b5eb83464c7; five touched paths changed on main since its base, so please integrate current main and rerun the focused storage-flush ordering tests after resolving the stack.

The author reports both storage-flush CTest registrations passing on the updated head in a support branch; I did not run GPU tests locally. The performance comparison has been removed, so I am not requiring a performance report.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5693633621 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12070#pullrequestreview-5693633621). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-29T06:18:21Z. **Review:** CHANGES_REQUESTED --- ## Re-checked — changes requested The latest head `3b3cd7377fa40e6d98828bfcbf877feca04fe96a` addresses the stamped-note ownership blocker: only single-image flushes retain their own notes, while multi-image flushes retain none, and the author added the joint A+B then single-A regression. The author also removed the performance claim and records `Depends on: #8887`; I verified #8887 is still open. One integration blocker remains. A pairwise merge preview with open #6186 still conflicts in `CMakeLists.txt`, `Recorder.hpp`, `UnitShadow.cpp`, and the AGC debt file. The #6186 author has not recorded an agreed landing order, and this PR does not list it as a dependency. Please coordinate that order and update the checklist/branch accordingly. This branch is also 1,367 commits behind current `main` `2960e9a6e7e1fc99c4ed180c71495b5eb83464c7`; five touched paths changed on main since its base, so please integrate current main and rerun the focused storage-flush ordering tests after resolving the stack. The author reports both storage-flush CTest registrations passing on the updated head in a support branch; I did not run GPU tests locally. The performance comparison has been removed, so I am not requiring a performance report.
MarcZX10 commented 2026-11-14 06:54:34 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-14T06:54:34Z.

Review: APPROVED


Reviewed — looks good

The change tracks stamped writes created by a single-image flush and exempts those notes from the next eligible wait; I found no concrete correctness defect in the inspected code.

What I ran

Reviewed head 7d6f6c27cf18c5171220cb223acfd0646e4aa464. No commands or tests were run by me; test results below are author-reported in the PR description.

Results

Check Result Note
Targeted source review passed Flush ordering and note tracking inspected
Execution tests not run Author reports 2 of 2 focused tests passed
Build and conventions not run Author-reported results only

Findings

Blocking

None.

Non-blocking

None.

Sources

Reviewed changed code in Recorder.hpp, Texture.hpp, Recorder.cpp, Texture.cpp, UnitShadow.cpp, agc_driver_storage_flush_ordering_tests.cmake, and StorageFlushOrdering.cpp at the pinned head.

Not verified

I did not run tests, build, or convention checks. Author-reported macOS focused test results and Windows performance measurements were not independently verified. Texture.cpp was read through the repository reader because its full text was excluded from the review folder; review/files.json was not available from the reader, so the complete exclusion inventory could not be confirmed. Other repository files and behavior outside the targeted ranges were not reviewed.

To get this to a good state

Nothing is required.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5902445689 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12070#pullrequestreview-5902445689). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-11-14T06:54:34Z. **Review:** APPROVED --- # Reviewed — looks good The change tracks stamped writes created by a single-image flush and exempts those notes from the next eligible wait; I found no concrete correctness defect in the inspected code. ## What I ran Reviewed head `7d6f6c27cf18c5171220cb223acfd0646e4aa464`. No commands or tests were run by me; test results below are author-reported in the PR description. ## Results | Check | Result | Note | |---|---|---| | Targeted source review | passed | Flush ordering and note tracking inspected | | Execution tests | not run | Author reports 2 of 2 focused tests passed | | Build and conventions | not run | Author-reported results only | ## Findings ### Blocking None. ### Non-blocking None. ## Sources Reviewed changed code in `Recorder.hpp`, `Texture.hpp`, `Recorder.cpp`, `Texture.cpp`, `UnitShadow.cpp`, `agc_driver_storage_flush_ordering_tests.cmake`, and `StorageFlushOrdering.cpp` at the pinned head. ## Not verified I did not run tests, build, or convention checks. Author-reported macOS focused test results and Windows performance measurements were not independently verified. `Texture.cpp` was read through the repository reader because its full text was excluded from the review folder; `review/files.json` was not available from the reader, so the complete exclusion inventory could not be confirmed. Other repository files and behavior outside the targeted ranges were not reviewed. ## To get this to a good state Nothing is required.
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!12070
No description provided.