perf(agc): memoize untracked texture comparisons by the stores that reach the surface #2802

Merged
ThatsLeo merged 1 commit from upstream-pr/2802 into main 2026-10-12 14:42:28 +00:00
ThatsLeo commented 2026-10-10 15:30:24 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ThatsLeo on 2026-10-10T15:30:24Z.


What

StorageTexture::compareUntracked skips the byte comparison of an untracked surface while its memo stamp is unchanged. The stamp held TrackerGeneration, which every collect and every driver store anywhere advances, so it almost never matched. On Linux with Intel Arc (Meteor Lake, Mesa 26.2.3 ANV), host imports resolve write protection and imported ranges are compared; in Dreaming Sarah (PPSA02929) 43,999 of 44,000 comparisons found the surface unchanged, TrackerGeneration caused 90% of the memo misses, and perf put 58% of the graphics worker's samples in their memcmp.

  • Driver stores (MarkWritten, StoreOwnBytes) into ranges the tracker does not cover, which leave no block stamp, record their generation per 64 KiB block.
  • GuestMemory::NewestStamp returns the newest of those generations and of the block stamps over the covered part of a range.
  • compareUntracked keys its memo on NewestStamp of the surface instead of TrackerGeneration. CollectEpoch, ForgetSerial and NewestWriteNote stay.
  • Those records live in a fixed table of 65,536 slots indexed by 64 KiB block number modulo the table size, each holding the newest generation stored to any of its blocks. A collision can only raise a surface's stamp, which costs one comparison and never skips one.
  • docs/dev/ARCHITECTURE.md describes the memo stamp and the table.

Tested

Rebased onto main e7c70a2d. Fedora 44, GCC 16.2.1, Release, Intel Arc (Meteor Lake, Mesa 26.2.3 ANV).

  • Full ctest on Intel Arc and lavapipe: 942 of 942 pass on both.
  • agc_write_tracking gains CheckNewestStamp: a driver store into unwatched memory advances its stamp and not another range's, a collected CPU store elsewhere leaves it, and a collected store into the watched part of a partly watched range advances it. It fails without the store records.
  • A CPU store into an unwatched surface is still compared again at the next collect epoch: RunUntrackedReuse in agc_driver_dcc_keys_first_write covers it, and it fails with an untracked CPU edit was missed when the epoch is taken out of the stamp.
  • On Linux with ANV, current main already memoizes as often as this branch: Dreaming Sarah (PPSA02929) and Stray (PPSA02101) show the same hit rate and frame rate on both, see the measurements in the comments.
  • On Windows, where render targets are outside the write tracker, it still matters: tibzejoker's GTA V (PPSA04264) measurements on an RTX 4090 in the comments show main at 0.2 to 0.6 FPS with about 0.57 ms per whole-surface comparison and this branch at 1.1 FPS with about 0.21 ms.

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 in TechnicalDebt
  • 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
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4812334423 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2802). Originally posted by [ThatsLeo](https://github.com/ThatsLeo) on 2026-10-10T15:30:24Z. --- ### What `StorageTexture::compareUntracked` skips the byte comparison of an untracked surface while its memo stamp is unchanged. The stamp held `TrackerGeneration`, which every collect and every driver store anywhere advances, so it almost never matched. On Linux with Intel Arc (Meteor Lake, Mesa 26.2.3 ANV), host imports resolve write protection and imported ranges are compared; in Dreaming Sarah (PPSA02929) 43,999 of 44,000 comparisons found the surface unchanged, `TrackerGeneration` caused 90% of the memo misses, and `perf` put 58% of the graphics worker's samples in their `memcmp`. - Driver stores (`MarkWritten`, `StoreOwnBytes`) into ranges the tracker does not cover, which leave no block stamp, record their generation per 64 KiB block. - `GuestMemory::NewestStamp` returns the newest of those generations and of the block stamps over the covered part of a range. - `compareUntracked` keys its memo on `NewestStamp` of the surface instead of `TrackerGeneration`. `CollectEpoch`, `ForgetSerial` and `NewestWriteNote` stay. - Those records live in a fixed table of 65,536 slots indexed by 64 KiB block number modulo the table size, each holding the newest generation stored to any of its blocks. A collision can only raise a surface's stamp, which costs one comparison and never skips one. - `docs/dev/ARCHITECTURE.md` describes the memo stamp and the table. ### Tested Rebased onto `main` `e7c70a2d`. Fedora 44, GCC 16.2.1, Release, Intel Arc (Meteor Lake, Mesa 26.2.3 ANV). - Full `ctest` on Intel Arc and lavapipe: 942 of 942 pass on both. - `agc_write_tracking` gains `CheckNewestStamp`: a driver store into unwatched memory advances its stamp and not another range's, a collected CPU store elsewhere leaves it, and a collected store into the watched part of a partly watched range advances it. It fails without the store records. - A CPU store into an unwatched surface is still compared again at the next collect epoch: `RunUntrackedReuse` in `agc_driver_dcc_keys_first_write` covers it, and it fails with `an untracked CPU edit was missed` when the epoch is taken out of the stamp. - On Linux with ANV, current `main` already memoizes as often as this branch: Dreaming Sarah (PPSA02929) and Stray (PPSA02101) show the same hit rate and frame rate on both, see the measurements in the comments. - On Windows, where render targets are outside the write tracker, it still matters: tibzejoker's GTA V (PPSA04264) measurements on an RTX 4090 in the comments show `main` at 0.2 to 0.6 FPS with about 0.57 ms per whole-surface comparison and this branch at 1.1 FPS with about 0.21 ms. ### 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 in [TechnicalDebt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/TechnicalDebt.md#silent-stubs) - [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] AI-assisted: yes
github-actions[bot] commented 2026-10-10 15:30:34 +00:00 (Migrated from github.com)

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


Thank you for your interest in the project! We are sorry, but we cannot accept more PRs while we work through the existing backlog. This PR has been automatically closed and labeled "intake paused". This is not a judgment of the quality of your changes.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6099115588 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2802#issuecomment-6099115588). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-10T15:30:34Z. --- Thank you for your interest in the project! We are sorry, but we cannot accept more PRs while we work through the existing backlog. This PR has been automatically closed and labeled "intake paused". This is not a judgment of the quality of your changes.
adriadam10 commented 2026-10-11 07:06:30 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-11T07:06:30Z.

Review: DISMISSED


Thanks for the measurements. Two problems before this can land:

  • Stale untracked surfaces. compareUntracked is only reached when the surface is not covered by the write watch (Texture.cpp:1418, :3814). There a CPU store leaves no stamp, and the byte comparison was the only way to see it. With the memo keyed on NewestStamp (stamps of covered blocks + driver stores), a CPU-updated untracked surface (video, streamed texture) is never re-compared while the driver writes nothing to it, so it stays on the old contents. CheckNewestStamp pins exactly this ("a collected CPU store elsewhere leaves it") but nothing tests that the comparison still runs when the CPU changed unwatched bytes. Please add a test where an untracked surface is changed by a CPU store only and compareUntracked must report it changed, and key the memo on something that sees it (e.g. limit the memo to ranges where every block is covered by the watch, or re-compare at a bounded interval), and show the Dreaming Sarah numbers again with that.
  • Unbounded unstampedStores (GuestMemory.cpp:905): one map entry per 64 KiB block ever stored to, never erased (not on unwatch/free/remap). Bound it or drop entries when the range is watched/released.

Also, this adds a tracker structure, so docs/dev/ARCHITECTURE.md should describe it where the write tracker is covered.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5482276323 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2802#pullrequestreview-5482276323). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-11T07:06:30Z. **Review:** DISMISSED --- Thanks for the measurements. Two problems before this can land: - **Stale untracked surfaces.** `compareUntracked` is only reached when the surface is not covered by the write watch (`Texture.cpp:1418`, `:3814`). There a CPU store leaves no stamp, and the byte comparison was the only way to see it. With the memo keyed on `NewestStamp` (stamps of covered blocks + driver stores), a CPU-updated untracked surface (video, streamed texture) is never re-compared while the driver writes nothing to it, so it stays on the old contents. `CheckNewestStamp` pins exactly this ("a collected CPU store elsewhere leaves it") but nothing tests that the comparison still runs when the CPU changed unwatched bytes. Please add a test where an untracked surface is changed by a CPU store only and `compareUntracked` must report it changed, and key the memo on something that sees it (e.g. limit the memo to ranges where every block is covered by the watch, or re-compare at a bounded interval), and show the Dreaming Sarah numbers again with that. - **Unbounded `unstampedStores`** (`GuestMemory.cpp:905`): one map entry per 64 KiB block ever stored to, never erased (not on unwatch/free/remap). Bound it or drop entries when the range is watched/released. Also, this adds a tracker structure, so `docs/dev/ARCHITECTURE.md` should describe it where the write tracker is covered.
Mouhand-Kaddo commented 2026-10-11 07:26:43 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by Mouhand-Kaddo on 2026-10-11T07:26:43Z.


Additional platform validation of standalone PR head 93f3adc2418ff2b172055dad2541e31ee4dcdfd0 (2026-10-11):

Windows: passed — Windows 11, WinLibs GCC 15.2.0 UCRT/POSIX/SEH r7; CMake 4.3.1 / Ninja; Release, BUILD_TESTING=ON.

2 checks, 0 failures, 0 CTest skips. Built the selected targets and dependencies; this is focused validation, not a full build or full-suite run.

Checks: agc_write_tracking, agc_driver_graphics.

Command after building: ctest --test-dir <build> --verbose --no-tests=error --timeout 30 -R "^(agc_write_tracking|agc_driver_graphics)$".

This scope checks CPU-side behavior; no GPU execution result is claimed.

No title/gameplay validation. These results cover the standalone head, not a merge with current main.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6106666137 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2802#issuecomment-6106666137). Originally posted by [Mouhand-Kaddo](https://github.com/Mouhand-Kaddo) on 2026-10-11T07:26:43Z. --- <!-- anyps5-platform-validation:93f3adc2418ff2b172055dad2541e31ee4dcdfd0 --> Additional platform validation of standalone PR head `93f3adc2418ff2b172055dad2541e31ee4dcdfd0` (2026-10-11): **Windows: passed** — Windows 11, WinLibs GCC 15.2.0 UCRT/POSIX/SEH r7; CMake 4.3.1 / Ninja; Release, `BUILD_TESTING=ON`. 2 checks, 0 failures, 0 CTest skips. Built the selected targets and dependencies; this is focused validation, not a full build or full-suite run. Checks: `agc_write_tracking`, `agc_driver_graphics`. Command after building: `ctest --test-dir <build> --verbose --no-tests=error --timeout 30 -R "^(agc_write_tracking|agc_driver_graphics)$"`. This scope checks CPU-side behavior; no GPU execution result is claimed. No title/gameplay validation. These results cover the standalone head, not a merge with current main.
ThatsLeo commented 2026-10-11 12:00:59 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ThatsLeo on 2026-10-11T12:00:59Z.


A second title, from Stray (PPSA02101 v01.002, UE4), on the same Intel Arc. It runs on main f1ae427b with the set described in #2749.

On ANV, host-pointer imports lose write protection, so imported storage surfaces are compared rather than watched. At the calibration screen, perf put 54 to 57% of the process's samples in StorageTexture::compareUntracked, at about 2.8 GB/s of comparisons, render targets up to 3840x2160.

With 93f3adc2 the first 16 frames are presented by 43 s, where without it the first 17 came at about 103 s (warm shader cache, same set otherwise). The steady frame rate does not move (about 1 FPS): there the surfaces really change between uses, and the cost goes away only once the imports stay watched (#2434).

AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6108798903 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2802#issuecomment-6108798903). Originally posted by [ThatsLeo](https://github.com/ThatsLeo) on 2026-10-11T12:00:59Z. --- A second title, from Stray (PPSA02101 v01.002, UE4), on the same Intel Arc. It runs on `main` `f1ae427b` with the set described in #2749. On ANV, host-pointer imports lose write protection, so imported storage surfaces are compared rather than watched. At the calibration screen, `perf` put 54 to 57% of the process's samples in `StorageTexture::compareUntracked`, at about 2.8 GB/s of comparisons, render targets up to 3840x2160. With `93f3adc2` the first 16 frames are presented by 43 s, where without it the first 17 came at about 103 s (warm shader cache, same set otherwise). The steady frame rate does not move (about 1 FPS): there the surfaces really change between uses, and the cost goes away only once the imports stay watched (#2434). AI-assisted: yes.
ThatsLeo commented 2026-10-11 22:44:34 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ThatsLeo on 2026-10-11T22:44:34Z.


@adriadam10 thanks for the review, and sorry for the delay. I rebased onto current main to address it, and measured first. On today's main the problem this PR fixed is mostly gone, so I'm closing it rather than asking you to review a larger version.

Rebased PR (48763caf) against plain main (0a8b1d32). The counters are local, on every compareUntracked call: how often the memo hits, and how many bytes are compared or skipped per run (Dreaming Sarah averaged over its two runs). Intel Arc (Mesa 26.2.3 ANV).

Title Arm Memo hits Compared / skipped Frame rate
Dreaming Sarah, 2 runs main 76% 243 / 369 GiB 55.0, 55.2 FPS
Dreaming Sarah, 2 runs this PR 76% 245 / 372 GiB 55.8, 55.9 FPS
Stray, calibration screen, 2 runs main 46% 305–381 / 228–282 GiB 16 frames at 41 / 37 s
Stray, calibration screen, 2 runs this PR 50% 327 / 336 GiB 16 frames at 40 / 38 s

The Stray runs are with the set from #2749, without its dma-buf preference, so the imports stay unwatched and go through compareUntracked.

When I opened this, the stamp's TrackerGeneration advanced on almost every call and the memo almost never matched. On current main it already matches as often as with this PR, so replacing it with NewestStamp no longer buys anything measurable.

On your two points, for the record:

  • Stale untracked surfaces: the stamp keeps CollectEpoch(), so a CPU store into unwatched memory is compared again at the next ordering point, the same bound the collect memo gives watched memory. RunUntrackedReuse in agc_driver_dcc_keys_first_write already checks it: a CPU edit after BumpCollectEpoch must make Refresh re-upload. With the epoch taken out of the stamp, that test fails with an untracked CPU edit was missed.
  • Unbounded map: the rebased version replaced it with a fixed table of 65,536 slots indexed by block modulo the table size. A collision can only raise a stamp.

Neither is needed now that the PR isn't. The remaining cost on ANV is the comparison itself, and keeping the imports watched (#2434) is what removes it.

AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6114735049 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2802#issuecomment-6114735049). Originally posted by [ThatsLeo](https://github.com/ThatsLeo) on 2026-10-11T22:44:34Z. --- @adriadam10 thanks for the review, and sorry for the delay. I rebased onto current `main` to address it, and measured first. On today's `main` the problem this PR fixed is mostly gone, so I'm closing it rather than asking you to review a larger version. Rebased PR (`48763caf`) against plain `main` (`0a8b1d32`). The counters are local, on every `compareUntracked` call: how often the memo hits, and how many bytes are compared or skipped per run (Dreaming Sarah averaged over its two runs). Intel Arc (Mesa 26.2.3 ANV). | Title | Arm | Memo hits | Compared / skipped | Frame rate | |---|---|---|---|---| | Dreaming Sarah, 2 runs | `main` | 76% | 243 / 369 GiB | 55.0, 55.2 FPS | | Dreaming Sarah, 2 runs | this PR | 76% | 245 / 372 GiB | 55.8, 55.9 FPS | | Stray, calibration screen, 2 runs | `main` | 46% | 305–381 / 228–282 GiB | 16 frames at 41 / 37 s | | Stray, calibration screen, 2 runs | this PR | 50% | 327 / 336 GiB | 16 frames at 40 / 38 s | The Stray runs are with the set from #2749, without its dma-buf preference, so the imports stay unwatched and go through `compareUntracked`. When I opened this, the stamp's `TrackerGeneration` advanced on almost every call and the memo almost never matched. On current `main` it already matches as often as with this PR, so replacing it with `NewestStamp` no longer buys anything measurable. On your two points, for the record: - **Stale untracked surfaces:** the stamp keeps `CollectEpoch()`, so a CPU store into unwatched memory is compared again at the next ordering point, the same bound the collect memo gives watched memory. `RunUntrackedReuse` in `agc_driver_dcc_keys_first_write` already checks it: a CPU edit after `BumpCollectEpoch` must make `Refresh` re-upload. With the epoch taken out of the stamp, that test fails with `an untracked CPU edit was missed`. - **Unbounded map:** the rebased version replaced it with a fixed table of 65,536 slots indexed by block modulo the table size. A collision can only raise a stamp. Neither is needed now that the PR isn't. The remaining cost on ANV is the comparison itself, and keeping the imports watched (#2434) is what removes it. AI-assisted: yes.
tibzejoker commented 2026-10-12 09:19:46 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by tibzejoker on 2026-10-12T09:19:46Z.


Data from another workload where this still matters: GTA V (PPSA04264), Windows 11, RTX 4090, write watch on. Tree: main 325e0a8bd (so it includes 0a8b1d32) plus the PRs GTA needs to reach Story. I applied this PR's head 93f3adc24 as is (it cherry-picks cleanly onto that main).

On Windows, the render targets GTA draws to are outside the write tracker (GuestMemory::ChangedBlocks returns false for them), so every StorageTexture::Refresh of a resident target ends in compareUntracked over the whole surface (up to 33 MB at 3840x2160). In Story, about 98% of these refreshes find the surface unchanged.

Local timers inside Refresh, per 10 s of the prologue, one run each:

Arm Refresh calls whole-surface compare per call Window FPS
main 11k to 15k 8.3 to 8.6 s ~0.57 ms 0.2 to 0.6
this PR 32k 6.7 s ~0.21 ms 1.1

So on this workload the TrackerGeneration key still misses most of the time, and keying on NewestStamp roughly halves the frame time. The compare is still the top cost with the PR. Covering these surfaces with the tracker on Windows would remove it, and I'm looking into why they are not covered.

@ThatsLeo would you consider reopening it? If you'd rather not carry it, I can open it again with you as author of the commit and these numbers.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6121348393 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2802#issuecomment-6121348393). Originally posted by [tibzejoker](https://github.com/tibzejoker) on 2026-10-12T09:19:46Z. --- Data from another workload where this still matters: GTA V (PPSA04264), Windows 11, RTX 4090, write watch on. Tree: main 325e0a8bd (so it includes 0a8b1d32) plus the PRs GTA needs to reach Story. I applied this PR's head 93f3adc24 as is (it cherry-picks cleanly onto that main). On Windows, the render targets GTA draws to are outside the write tracker (`GuestMemory::ChangedBlocks` returns false for them), so every `StorageTexture::Refresh` of a resident target ends in `compareUntracked` over the whole surface (up to 33 MB at 3840x2160). In Story, about 98% of these refreshes find the surface unchanged. Local timers inside `Refresh`, per 10 s of the prologue, one run each: | Arm | Refresh calls | whole-surface compare | per call | Window FPS | |---|---|---|---|---| | main | 11k to 15k | 8.3 to 8.6 s | ~0.57 ms | 0.2 to 0.6 | | this PR | 32k | 6.7 s | ~0.21 ms | 1.1 | So on this workload the `TrackerGeneration` key still misses most of the time, and keying on `NewestStamp` roughly halves the frame time. The compare is still the top cost with the PR. Covering these surfaces with the tracker on Windows would remove it, and I'm looking into why they are not covered. @ThatsLeo would you consider reopening it? If you'd rather not carry it, I can open it again with you as author of the commit and these numbers. AI-assisted (Claude Code).
ThatsLeo commented 2026-10-12 10:42:23 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by ThatsLeo on 2026-10-12T10:42:23Z.


Reopened at @tibzejoker's request, and rebased onto main e7c70a2d (ca99658c). The GTA V numbers above show the case my Linux measurements missed: on Windows those render targets are outside the write tracker, the TrackerGeneration key still misses, and keying on NewestStamp roughly halves the frame time there.

@adriadam10, on your review:

  • Stale untracked surfaces. The stamp still contains CollectEpoch(), which advances at every ordering point where a CPU store may have landed (submission start, a satisfied WAIT_REG_MEM, a drain). A thread that never bumps it gets epoch 0 and is never memoized. So a CPU store into unwatched memory is compared again at the next ordering point, the same bound the collect memo gives watched memory. The test you asked for exists on main: RunUntrackedReuse in agc_driver_dcc_keys_first_write changes an unwatched image with a CPU store only and requires the next Refresh after BumpCollectEpoch to upload it. With the epoch taken out of the stamp, it fails with an untracked CPU edit was missed.
  • Unbounded unstampedStores. It's now a fixed table of 65,536 slots indexed by block number modulo the table size. A collision can only raise a stamp: one comparison more, never one skipped.
  • Docs. docs/dev/ARCHITECTURE.md gets a section on untracked storage image comparisons, covering the stamp and the table.

Full suite on Intel Arc and lavapipe: 942 of 942 pass on both. The description is updated.

AI-assisted: yes.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6122657581 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2802#issuecomment-6122657581). Originally posted by [ThatsLeo](https://github.com/ThatsLeo) on 2026-10-12T10:42:23Z. --- Reopened at @tibzejoker's request, and rebased onto `main` `e7c70a2d` (`ca99658c`). The GTA V numbers above show the case my Linux measurements missed: on Windows those render targets are outside the write tracker, the `TrackerGeneration` key still misses, and keying on `NewestStamp` roughly halves the frame time there. @adriadam10, on your review: - **Stale untracked surfaces.** The stamp still contains `CollectEpoch()`, which advances at every ordering point where a CPU store may have landed (submission start, a satisfied `WAIT_REG_MEM`, a drain). A thread that never bumps it gets epoch 0 and is never memoized. So a CPU store into unwatched memory is compared again at the next ordering point, the same bound the collect memo gives watched memory. The test you asked for exists on `main`: `RunUntrackedReuse` in `agc_driver_dcc_keys_first_write` changes an unwatched image with a CPU store only and requires the next `Refresh` after `BumpCollectEpoch` to upload it. With the epoch taken out of the stamp, it fails with `an untracked CPU edit was missed`. - **Unbounded `unstampedStores`.** It's now a fixed table of 65,536 slots indexed by block number modulo the table size. A collision can only raise a stamp: one comparison more, never one skipped. - **Docs.** `docs/dev/ARCHITECTURE.md` gets a section on untracked storage image comparisons, covering the stamp and the table. Full suite on Intel Arc and lavapipe: 942 of 942 pass on both. The description is updated. AI-assisted: yes.
tibzejoker commented 2026-10-12 10:53:53 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by tibzejoker on 2026-10-12T10:53:53Z.


Thanks for reopening. Checked the rebased head ca99658c on Windows 11 (WinLibs GCC 15.2.0, Release, RTX 4090):

  • ctest -R "agc|shader" on the PR head itself: 435 of 435 pass (agc_driver_stencil_ref_export skipped as unsupported here).
  • GTA V Story, same tree as before with ca99658c in place of the old commit: 26k to 36k refreshes per 10 s and window FPS 1.35. Before the PR it was 11k to 15k refreshes and 0.2 to 0.6 FPS, so the rebase keeps the gain.

AI-assisted (Claude Code).

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6122832761 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/2802#issuecomment-6122832761). Originally posted by [tibzejoker](https://github.com/tibzejoker) on 2026-10-12T10:53:53Z. --- Thanks for reopening. Checked the rebased head `ca99658c` on Windows 11 (WinLibs GCC 15.2.0, Release, RTX 4090): - `ctest -R "agc|shader"` on the PR head itself: 435 of 435 pass (`agc_driver_stencil_ref_export` skipped as unsupported here). - GTA V Story, same tree as before with `ca99658c` in place of the old commit: 26k to 36k refreshes per 10 s and window FPS 1.35. Before the PR it was 11k to 15k refreshes and 0.2 to 0.6 FPS, so the rebase keeps the gain. AI-assisted (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!2802
No description provided.