perf(agc): exclude only an import's own pages from the write watch and settle partial-block imports in the background #12378

Merged
BunnyFl merged 8 commits from upstream-pr/12378 into main 2026-10-30 05:54:30 +00:00
BunnyFl commented 2026-10-28 12:03:42 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by BunnyFl on 2026-10-28T12:03:42Z.


What

On Windows, a host import that stays compared takes its pages off the write watch through WriteWatchCoverage::Exclude, which excluded every 64 KiB tracker block the import touches. The other pages of those blocks then left the watch with it, and collects over them were refused and fell to full revalidation walks. In a played DEATHLOOP session of about 5 minutes, about 94 % of the refused collects were on such neighbouring pages (#12329).

Two changes, as discussed on #12329, and two fixes the first one needs:

  1. WriteWatchCoverage::Exclude excludes only the 4 KiB pages a range touches. Covers and Restore already work per page. Each excluded page now keeps the generation of its own latest exclusion (excludedGenerations holds 16 per block instead of one), so a later mapping of one page restores it even when a newer import excluded another page of the same block, and a stale mapping still can't restore a newer one. ExcludedSpan is unchanged: the unwatch hook still gets every 64 KiB block the pages touch, so pending storage results in those blocks are saved as before.
  2. An unwatched import that is not a whole number of 64 KiB blocks is queued for the deferred settle too (importRunAt), not only marked settleOnDemand (#9941). rewatchSettledImports returns its own pages; the existing guards still apply: it stays compared while a live storage image overlaps the span, or while another compared import shares a 64 KiB block with it.
  3. UntrackedHint's walk (walkHints) gives a CPU stamp to the pages it clears that are still on the watch (oneandonlydean's finding). With change 1, hinted() accepts a block an import only partly covers, and the walk clears the write-watch marks of the block's still-watched pages too; a covered range over such a page then found no mark and kept a stale copy. Every marked page still stamps the block hint, and a page coverage still covers also gets the stamp walkWrites would give it.
  4. A driver write stamps a block when any of its pages is watched (oneandonlydean's finding). stampWatchedPart skips a block that blockPartWatched reports unwatched, and on Windows that checked only the first and last page of the written range in the block. With change 1, a block whose two ends are excluded can still have watched pages between them; a MarkWritten or MarkPossiblyWritten across it stamped nothing, so UnchangedSince over a middle page could stay true after the write. blockPartWatched now checks every page of the range.

Tests:

  • agc_write_watch_coverage asserts the page policy: an import excludes only its own pages, a range crossing into an imported page is not covered, the other pages of the block stay covered, ExcludedSpan still returns the whole block. New: a same-block, different-generation case (MarcZX10's regression on #12329): an older page restores while a newer page of the same block stays excluded, and a stale mapping does not restore the newer one. With page exclusion but one generation per block (my first version) it fails on a newer import of another page in the block kept an older page excluded; with main's header it fails on an import unwatched pages of its block outside it.
  • agc_write_tracking_rewatch_import_pages: the two cases that asserted the pages around an import (before it, and the reserved page past it) stay unwatched after a rewatch now assert they keep the state they had before the import. With main's header the revised test fails on unwatching an import ending inside a block changed the page past it. A collect over a reserved, uncommitted page still fails and falls back to the comparison, so treating that page as covered hides no write.
  • tests/Recorder.cpp case (m): an import of whole and partial 64 KiB blocks now returns to the watch through the deferred settle before its first use (the first use submits no settle read; on main it submits one); the case with a compared import in its last 64 KiB block is still refused.
  • agc_hint_partial_block_store_{cached,uncached} (tests/Recorder.cpp): import pages 0-5 of a block, collect page 8, store to page 8 from the CPU, take UntrackedHint over pages 4-9, then UnchangedSince over page 8 must fail. Without change 3 both fail on a hint walk across a partial-block import consumed a CPU store to a watched page; without the UntrackedHint call they pass there too.
  • agc_interior_watched_driver_write_{complete,possible} (tests/Recorder.cpp): exclude pages 0-5 and 12-15 of a block, collect page 8, then a MarkWritten or MarkPossiblyWritten across the whole block, and UnchangedSince over page 8 must fail. Without change 4 they fail on a complete driver write across a block with both ends excluded was not recorded on its watched interior page and a possible driver write across a block with both ends excluded was not recorded on its watched interior page.
  • agc_shared_block_rewatch_{cached,uncached} (tests/Recorder.cpp, ebosido444-ai's case): two imports exclude pages 0-5 and 8-11 of one block; Rewatch of the first, as rewatchSettledImports does after its settle, must return pages 0-7 only, keep each of pages 8-11 excluded, keep the block unproven, and collect a CPU store to page 6; Rewatch of the second then returns the whole block. On main both fail at their second check (two imports in one block excluded pages outside both), since main excludes the whole block; their first check, that both imports are excluded, passes there.
  • docs/dev/debt/libSceAgcDriver.md and docs/dev/ARCHITECTURE.md describe the page exclusion and the deferred read of partial-block imports.

Tested

Windows 11 Pro 10.0.26200, AMD Radeon RX 9070 XT (driver 32.0.32015.7029), Ryzen 7 5800X3D, WinLibs GCC 15.2.0 r7, Release, BUILD_TESTING=ON. Head 480ca2dff1 is this branch with main bb04a4f1ea merged in (this PR's diff is the same as on the earlier head 9d619dee3e, rebased onto main 3a2b919816, which includes #8930's WriteChanged change); base is main bb04a4f1ea with only agc_shared_block_rewatch_* added (tests/Recorder.cpp and its registration in CMakeLists.txt, uncommitted, which is why its summary lines below say "dirty":true; no library source differs from main).

Focused tests, serial, ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer, 3 runs on each side alternating base and change: agc_write_watch_coverage, agc_write_tracking, agc_write_tracking_rewatch_import_pages, agc_import_alias_shared, agc_import_watch, agc_import_watch_other_family, every agc_import_settle_*, agc_storage_kept_unit_settle, agc_storage_baseline_settled, agc_hint_mapping_history_{cached,uncached}, agc_partial_watch_restoration, agc_collect_mapping_history_{map,ring,shared,uncached}, agc_shared_block_rewatch_{cached,uncached}, and on the change also agc_hint_partial_block_store_{cached,uncached} and agc_interior_watched_driver_write_{complete,possible} (new here):

runs passed failed VUID- lines missing-layer lines validation layer inserted
main bb04a4f1ea 3 25 of 27 each agc_shared_block_rewatch_{cached,uncached} at their second check (main excludes whole blocks) 0 0 14 processes per run
480ca2dff1 3 31 of 31 each none 0 0 14 processes per run

Case (m) differs in every run: over the import of whole and partial 64 KiB blocks, 1 settle reads submitted, 1 back in the write watch on main and 0 settle reads submitted, 0 back here, both accepted; over the compared import in its last 64 KiB block, 1 settle reads submitted, 0 back on main and 0 settle reads submitted, 0 back here, both refused. tools/check_conventions.py --base upstream/main: all checks pass.

Performance, DEATHLOOP (PPSA01670 01.405.000), opening cutscene from a fresh save with scripted pad input, 3840x2160, captured as the Performance report form asks: APS5_TRACE_FRAMES only, no other APS5_TRACE_*/APS5_PROFILE_* switch (the other APS5_* variables in the lines are APS5_FORCE_SDR and the scripted pad input), caches warm, one warm-up run, then 2 + 2 captures alternating base and change. Base main 3a2b919816, change 9d619dee3e; the title was relinked with 3a2b919816's relinker for both. The trace_digest output is in the comment below, with the traces attached there. These captures were taken before the merge of bb04a4f1ea: this PR's diff is unchanged by it, but main changed 39 library source files under libSceAgcDriver in between (none of the three this PR changes), so they measure this change on 3a2b919816.

aps5-summary.jsonl lines (base 1, change 1, base 2, change 2, in capture order):

{"commit":"3a2b91981651","dirty":true,"env":{"APS5_FORCE_SDR":"1","APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_FRAMES":"1650:600"},"gpu":"AMD Radeon RX 9070 XT","driver":"AMD proprietary driver 26.10.1 (LLPC)","os":"Windows 10.0.26200","cpu":"AMD Ryzen 7 5800X3D 8-Core Processor","cpu_threads":16,"memory_mib":65440,"title_id":"PPSA01670","title":"DEATHLOOP","content_version":"01.405.000","resolution":"3840x2160","window":{"spec":"frames 1650:600","first_present":1650,"ms":112781.689},"presents":600,"frame_ms":{"p50":216.892,"p90":258.404,"p99":370.982,"max":17566.446},"gpu_busy_ms_per_present":51.781,"worker_busy_pct":{"queue worker 0x0":97.676,"queue worker 0x28":74.117,"queue worker 0x30":76.038,"queue worker 0x20":74.660,"queue worker 0x40":79.569,"queue worker 0x38":79.583,"queue worker 0x48":79.632},"top_phases_ms_per_frame":{"Driver.Packet":1053.648,"Driver.Packet.memory_wait":860.252,"Graphics.Draw":131.236,"Graphics.Draw.draw_and_resource_release":127.096,"Driver.Packet.draw":114.734,"Driver.Draw":114.466,"Driver.Draw.draw_enqueued":88.843,"Driver.Packet.dispatch":48.763},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":47.196,"events_lost":664862,"totals_full":false},"draw committer":{"events_full_after_s":106.241,"events_lost":20075,"totals_full":false}},"trace":"aps5-trace-3a2b91981651-46248.json.gz"}
{"commit":"9d619dee3e37","dirty":false,"env":{"APS5_FORCE_SDR":"1","APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_FRAMES":"2100:600"},"gpu":"AMD Radeon RX 9070 XT","driver":"AMD proprietary driver 26.10.1 (LLPC)","os":"Windows 10.0.26200","cpu":"AMD Ryzen 7 5800X3D 8-Core Processor","cpu_threads":16,"memory_mib":65440,"title_id":"PPSA01670","title":"DEATHLOOP","content_version":"01.405.000","resolution":"3840x2160","window":{"spec":"frames 2100:600","first_present":2100,"ms":75655.071},"presents":600,"frame_ms":{"p50":94.188,"p90":128.269,"p99":376.145,"max":17464.989},"gpu_busy_ms_per_present":65.273,"worker_busy_pct":{"queue worker 0x0":96.385,"queue worker 0x38":73.035,"queue worker 0x48":73.061,"queue worker 0x20":60.070,"queue worker 0x40":73.040,"queue worker 0x30":65.590,"queue worker 0x28":58.839},"top_phases_ms_per_frame":{"Driver.Packet":629.066,"Driver.Packet.memory_wait":467.218,"Driver.Packet.draw":63.059,"Driver.Draw":62.715,"Driver.Packet.dispatch":60.862,"Driver.Dispatch":56.747,"Graphics.Draw":40.181,"Driver.Draw.draw_enqueued":35.639},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":34.750,"events_lost":924878,"totals_full":false},"draw committer":{"events_full_after_s":60.036,"events_lost":125415,"totals_full":false}},"trace":"aps5-trace-9d619dee3e37-16496.json.gz"}
{"commit":"3a2b91981651","dirty":true,"env":{"APS5_FORCE_SDR":"1","APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_FRAMES":"1650:600"},"gpu":"AMD Radeon RX 9070 XT","driver":"AMD proprietary driver 26.10.1 (LLPC)","os":"Windows 10.0.26200","cpu":"AMD Ryzen 7 5800X3D 8-Core Processor","cpu_threads":16,"memory_mib":65440,"title_id":"PPSA01670","title":"DEATHLOOP","content_version":"01.405.000","resolution":"3840x2160","window":{"spec":"frames 1650:600","first_present":1650,"ms":131153.782},"presents":600,"frame_ms":{"p50":239.314,"p90":307.736,"p99":495.049,"max":27589.718},"gpu_busy_ms_per_present":46.787,"worker_busy_pct":{"queue worker 0x0":98.034,"queue worker 0x28":70.459,"queue worker 0x38":74.545,"queue worker 0x20":71.040,"queue worker 0x30":72.102,"queue worker 0x48":74.562,"queue worker 0x40":74.546},"top_phases_ms_per_frame":{"Driver.Packet":1168.897,"Driver.Packet.memory_wait":944.633,"Graphics.Draw":143.891,"Graphics.Draw.draw_and_resource_release":139.755,"Driver.Packet.draw":127.370,"Driver.Draw":127.087,"Driver.Draw.draw_enqueued":100.901,"Driver.Packet.dispatch":65.893},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":58.880,"events_lost":680713,"totals_full":false},"draw committer":{"events_full_after_s":122.240,"events_lost":25504,"totals_full":false}},"trace":"aps5-trace-3a2b91981651-47944.json.gz"}
{"commit":"9d619dee3e37","dirty":false,"env":{"APS5_FORCE_SDR":"1","APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_FRAMES":"2100:600"},"gpu":"AMD Radeon RX 9070 XT","driver":"AMD proprietary driver 26.10.1 (LLPC)","os":"Windows 10.0.26200","cpu":"AMD Ryzen 7 5800X3D 8-Core Processor","cpu_threads":16,"memory_mib":65440,"title_id":"PPSA01670","title":"DEATHLOOP","content_version":"01.405.000","resolution":"3840x2160","window":{"spec":"frames 2100:600","first_present":2100,"ms":67692.709},"presents":600,"frame_ms":{"p50":89.814,"p90":118.386,"p99":329.187,"max":17915.687},"gpu_busy_ms_per_present":55.986,"worker_busy_pct":{"queue worker 0x0":96.017,"queue worker 0x20":54.698,"queue worker 0x28":53.546,"queue worker 0x30":59.957,"queue worker 0x48":67.162,"queue worker 0x38":67.134,"queue worker 0x40":67.097},"top_phases_ms_per_frame":{"Driver.Packet":523.959,"Driver.Packet.memory_wait":394.191,"Driver.Packet.dispatch":55.856,"Driver.Packet.draw":52.309,"Driver.Dispatch":52.209,"Driver.Draw":52.032,"Resources.Complete":32.941,"Vulkan.Dispatch":32.709},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":36.416,"events_lost":687947,"totals_full":false},"draw committer":{"events_full_after_s":61.309,"events_lost":44434,"totals_full":false}},"trace":"aps5-trace-9d619dee3e37-5436.json.gz"}

With the default event buffers the 600-present windows don't fit: every line has trace_dropped: true, with queue worker 0x0 full 35 to 59 s and draw committer 60 to 122 s into the window, and no thread's totals table filled (totals_full: false). So the summary lines' totals are complete, and so are the presents, but the traces (and the trace_digest thread tables) hold those two threads' slices only up to the point their buffer filled. The draw counts the earlier comparisons used to find the cut into the cutscene are among the lost slices, so the cut is now found from frame times alone: the first present interval over 400 ms after the window's longest interval (the loading frame, 17 to 28 s here). On the four previous traces, taken with APS5_TRACE_EVENTS=3145728 and complete buffers, this finds the same interval as the draw-count rule and gives identical figures. The cut's first present moves between runs (the pad script is timed in seconds), so each window starts on the loading screen (APS5_TRACE_FRAMES=1650:600 on base, 2100:600 on change). Over the same 300 present intervals in every trace, from 60 to 360 after the cut:

base 1 base 2 change 1 change 2
mean frame (ms) 232.1 263.6 93.4 94.4
p50 / p90 / p99 (ms) 227.9 / 262.1 / 298.3 255.0 / 314.5 / 380.6 92.9 / 113.4 / 143.2 93.8 / 112.2 / 143.8

Whole window, from the summary lines' totals: Driver.Packet.memory_wait 860.3 / 944.6 ms per frame on base vs 467.2 / 394.2 on change; GPU busy per present 51.8 / 46.8 vs 65.3 / 56.0.

Earlier, with APS5_TRACE_EVENTS=3145728 added (so not to the form), same scene and builds: over 313 matched intervals, mean frame 252.9 / 239.6 ms on base and 92.0 / 92.7 ms on change. On main 319621ba2e with 41eef2d043 (306 matched intervals, the cut found with "under 100 draws" since one base trace had 66 draws just before its cut): 255.4 / 254.9 ms vs 93.5 / 98.4 ms; on main 2227f13661 with afe34f6dbb (297 matched intervals): 290.4 / 268.2 ms vs 97.6 / 95.6 ms; all with that switch. With tibzejoker's port of #6192 on both arms, on main 3a40945e62: frame p50 196.9 / 168.2 ms on base and 95.7 / 94.0 ms on change. Before that (10 s summaries, details on #12329), page exclusion alone on plain main did not move the cutscene in one run each.

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: #12329
  • Unblocks: none
  • GPUs tested: AMD Radeon RX 9070 XT, driver 32.0.32015.7029, Windows 11
  • AI-assisted: yes

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5050146064 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12378). Originally posted by [BunnyFl](https://github.com/BunnyFl) on 2026-10-28T12:03:42Z. --- ### What On Windows, a host import that stays compared takes its pages off the write watch through `WriteWatchCoverage::Exclude`, which excluded every 64 KiB tracker block the import touches. The other pages of those blocks then left the watch with it, and collects over them were refused and fell to full revalidation walks. In a played DEATHLOOP session of about 5 minutes, about 94 % of the refused collects were on such neighbouring pages (#12329). Two changes, as discussed on #12329, and two fixes the first one needs: 1. **`WriteWatchCoverage::Exclude` excludes only the 4 KiB pages a range touches.** `Covers` and `Restore` already work per page. Each excluded page now keeps the generation of its own latest exclusion (`excludedGenerations` holds 16 per block instead of one), so a later mapping of one page restores it even when a newer import excluded another page of the same block, and a stale mapping still can't restore a newer one. `ExcludedSpan` is unchanged: the unwatch hook still gets every 64 KiB block the pages touch, so pending storage results in those blocks are saved as before. 2. **An unwatched import that is not a whole number of 64 KiB blocks is queued for the deferred settle too** (`importRunAt`), not only marked `settleOnDemand` (#9941). `rewatchSettledImports` returns its own pages; the existing guards still apply: it stays compared while a live storage image overlaps the span, or while another compared import shares a 64 KiB block with it. 3. **`UntrackedHint`'s walk (`walkHints`) gives a CPU stamp to the pages it clears that are still on the watch** (oneandonlydean's finding). With change 1, `hinted()` accepts a block an import only partly covers, and the walk clears the write-watch marks of the block's still-watched pages too; a covered range over such a page then found no mark and kept a stale copy. Every marked page still stamps the block hint, and a page `coverage` still covers also gets the stamp `walkWrites` would give it. 4. **A driver write stamps a block when any of its pages is watched** (oneandonlydean's finding). `stampWatchedPart` skips a block that `blockPartWatched` reports unwatched, and on Windows that checked only the first and last page of the written range in the block. With change 1, a block whose two ends are excluded can still have watched pages between them; a `MarkWritten` or `MarkPossiblyWritten` across it stamped nothing, so `UnchangedSince` over a middle page could stay true after the write. `blockPartWatched` now checks every page of the range. Tests: - `agc_write_watch_coverage` asserts the page policy: an import excludes only its own pages, a range crossing into an imported page is not covered, the other pages of the block stay covered, `ExcludedSpan` still returns the whole block. New: a same-block, different-generation case (MarcZX10's regression on #12329): an older page restores while a newer page of the same block stays excluded, and a stale mapping does not restore the newer one. With page exclusion but one generation per block (my first version) it fails on `a newer import of another page in the block kept an older page excluded`; with `main`'s header it fails on `an import unwatched pages of its block outside it`. - `agc_write_tracking_rewatch_import_pages`: the two cases that asserted the pages around an import (before it, and the reserved page past it) stay unwatched after a rewatch now assert they keep the state they had before the import. With `main`'s header the revised test fails on `unwatching an import ending inside a block changed the page past it`. A collect over a reserved, uncommitted page still fails and falls back to the comparison, so treating that page as covered hides no write. - `tests/Recorder.cpp` case (m): an import of whole and partial 64 KiB blocks now returns to the watch through the deferred settle before its first use (the first use submits no settle read; on `main` it submits one); the case with a compared import in its last 64 KiB block is still refused. - `agc_hint_partial_block_store_{cached,uncached}` (`tests/Recorder.cpp`): import pages 0-5 of a block, collect page 8, store to page 8 from the CPU, take `UntrackedHint` over pages 4-9, then `UnchangedSince` over page 8 must fail. Without change 3 both fail on `a hint walk across a partial-block import consumed a CPU store to a watched page`; without the `UntrackedHint` call they pass there too. - `agc_interior_watched_driver_write_{complete,possible}` (`tests/Recorder.cpp`): exclude pages 0-5 and 12-15 of a block, collect page 8, then a `MarkWritten` or `MarkPossiblyWritten` across the whole block, and `UnchangedSince` over page 8 must fail. Without change 4 they fail on `a complete driver write across a block with both ends excluded was not recorded on its watched interior page` and `a possible driver write across a block with both ends excluded was not recorded on its watched interior page`. - `agc_shared_block_rewatch_{cached,uncached}` (`tests/Recorder.cpp`, ebosido444-ai's case): two imports exclude pages 0-5 and 8-11 of one block; `Rewatch` of the first, as `rewatchSettledImports` does after its settle, must return pages 0-7 only, keep each of pages 8-11 excluded, keep the block unproven, and collect a CPU store to page 6; `Rewatch` of the second then returns the whole block. On `main` both fail at their second check (`two imports in one block excluded pages outside both`), since `main` excludes the whole block; their first check, that both imports are excluded, passes there. - `docs/dev/debt/libSceAgcDriver.md` and `docs/dev/ARCHITECTURE.md` describe the page exclusion and the deferred read of partial-block imports. ### Tested Windows 11 Pro 10.0.26200, AMD Radeon RX 9070 XT (driver 32.0.32015.7029), Ryzen 7 5800X3D, WinLibs GCC 15.2.0 r7, Release, `BUILD_TESTING=ON`. Head `480ca2dff1` is this branch with `main` `bb04a4f1ea` merged in (this PR's diff is the same as on the earlier head `9d619dee3e`, rebased onto `main` `3a2b919816`, which includes #8930's `WriteChanged` change); base is `main` `bb04a4f1ea` with only `agc_shared_block_rewatch_*` added (`tests/Recorder.cpp` and its registration in `CMakeLists.txt`, uncommitted, which is why its summary lines below say `"dirty":true`; no library source differs from `main`). Focused tests, serial, `ANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer`, 3 runs on each side alternating base and change: `agc_write_watch_coverage`, `agc_write_tracking`, `agc_write_tracking_rewatch_import_pages`, `agc_import_alias_shared`, `agc_import_watch`, `agc_import_watch_other_family`, every `agc_import_settle_*`, `agc_storage_kept_unit_settle`, `agc_storage_baseline_settled`, `agc_hint_mapping_history_{cached,uncached}`, `agc_partial_watch_restoration`, `agc_collect_mapping_history_{map,ring,shared,uncached}`, `agc_shared_block_rewatch_{cached,uncached}`, and on the change also `agc_hint_partial_block_store_{cached,uncached}` and `agc_interior_watched_driver_write_{complete,possible}` (new here): | | runs | passed | failed | `VUID-` lines | missing-layer lines | validation layer inserted | |---|---|---|---|---|---|---| | `main` `bb04a4f1ea` | 3 | 25 of 27 each | `agc_shared_block_rewatch_{cached,uncached}` at their second check (`main` excludes whole blocks) | 0 | 0 | 14 processes per run | | `480ca2dff1` | 3 | 31 of 31 each | none | 0 | 0 | 14 processes per run | Case (m) differs in every run: over the import of whole and partial 64 KiB blocks, `1 settle reads submitted, 1 back in the write watch` on `main` and `0 settle reads submitted, 0 back` here, both accepted; over the compared import in its last 64 KiB block, `1 settle reads submitted, 0 back` on `main` and `0 settle reads submitted, 0 back` here, both refused. `tools/check_conventions.py --base upstream/main`: all checks pass. Performance, DEATHLOOP (PPSA01670 01.405.000), opening cutscene from a fresh save with scripted pad input, 3840x2160, captured as the Performance report form asks: `APS5_TRACE_FRAMES` only, no other `APS5_TRACE_*`/`APS5_PROFILE_*` switch (the other `APS5_*` variables in the lines are `APS5_FORCE_SDR` and the scripted pad input), caches warm, one warm-up run, then 2 + 2 captures alternating base and change. Base `main` `3a2b919816`, change `9d619dee3e`; the title was relinked with `3a2b919816`'s relinker for both. The `trace_digest` output is in the comment below, with the traces attached there. These captures were taken before the merge of `bb04a4f1ea`: this PR's diff is unchanged by it, but `main` changed 39 library source files under `libSceAgcDriver` in between (none of the three this PR changes), so they measure this change on `3a2b919816`. `aps5-summary.jsonl` lines (base 1, change 1, base 2, change 2, in capture order): ```json {"commit":"3a2b91981651","dirty":true,"env":{"APS5_FORCE_SDR":"1","APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_FRAMES":"1650:600"},"gpu":"AMD Radeon RX 9070 XT","driver":"AMD proprietary driver 26.10.1 (LLPC)","os":"Windows 10.0.26200","cpu":"AMD Ryzen 7 5800X3D 8-Core Processor","cpu_threads":16,"memory_mib":65440,"title_id":"PPSA01670","title":"DEATHLOOP","content_version":"01.405.000","resolution":"3840x2160","window":{"spec":"frames 1650:600","first_present":1650,"ms":112781.689},"presents":600,"frame_ms":{"p50":216.892,"p90":258.404,"p99":370.982,"max":17566.446},"gpu_busy_ms_per_present":51.781,"worker_busy_pct":{"queue worker 0x0":97.676,"queue worker 0x28":74.117,"queue worker 0x30":76.038,"queue worker 0x20":74.660,"queue worker 0x40":79.569,"queue worker 0x38":79.583,"queue worker 0x48":79.632},"top_phases_ms_per_frame":{"Driver.Packet":1053.648,"Driver.Packet.memory_wait":860.252,"Graphics.Draw":131.236,"Graphics.Draw.draw_and_resource_release":127.096,"Driver.Packet.draw":114.734,"Driver.Draw":114.466,"Driver.Draw.draw_enqueued":88.843,"Driver.Packet.dispatch":48.763},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":47.196,"events_lost":664862,"totals_full":false},"draw committer":{"events_full_after_s":106.241,"events_lost":20075,"totals_full":false}},"trace":"aps5-trace-3a2b91981651-46248.json.gz"} {"commit":"9d619dee3e37","dirty":false,"env":{"APS5_FORCE_SDR":"1","APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_FRAMES":"2100:600"},"gpu":"AMD Radeon RX 9070 XT","driver":"AMD proprietary driver 26.10.1 (LLPC)","os":"Windows 10.0.26200","cpu":"AMD Ryzen 7 5800X3D 8-Core Processor","cpu_threads":16,"memory_mib":65440,"title_id":"PPSA01670","title":"DEATHLOOP","content_version":"01.405.000","resolution":"3840x2160","window":{"spec":"frames 2100:600","first_present":2100,"ms":75655.071},"presents":600,"frame_ms":{"p50":94.188,"p90":128.269,"p99":376.145,"max":17464.989},"gpu_busy_ms_per_present":65.273,"worker_busy_pct":{"queue worker 0x0":96.385,"queue worker 0x38":73.035,"queue worker 0x48":73.061,"queue worker 0x20":60.070,"queue worker 0x40":73.040,"queue worker 0x30":65.590,"queue worker 0x28":58.839},"top_phases_ms_per_frame":{"Driver.Packet":629.066,"Driver.Packet.memory_wait":467.218,"Driver.Packet.draw":63.059,"Driver.Draw":62.715,"Driver.Packet.dispatch":60.862,"Driver.Dispatch":56.747,"Graphics.Draw":40.181,"Driver.Draw.draw_enqueued":35.639},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":34.750,"events_lost":924878,"totals_full":false},"draw committer":{"events_full_after_s":60.036,"events_lost":125415,"totals_full":false}},"trace":"aps5-trace-9d619dee3e37-16496.json.gz"} {"commit":"3a2b91981651","dirty":true,"env":{"APS5_FORCE_SDR":"1","APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_FRAMES":"1650:600"},"gpu":"AMD Radeon RX 9070 XT","driver":"AMD proprietary driver 26.10.1 (LLPC)","os":"Windows 10.0.26200","cpu":"AMD Ryzen 7 5800X3D 8-Core Processor","cpu_threads":16,"memory_mib":65440,"title_id":"PPSA01670","title":"DEATHLOOP","content_version":"01.405.000","resolution":"3840x2160","window":{"spec":"frames 1650:600","first_present":1650,"ms":131153.782},"presents":600,"frame_ms":{"p50":239.314,"p90":307.736,"p99":495.049,"max":27589.718},"gpu_busy_ms_per_present":46.787,"worker_busy_pct":{"queue worker 0x0":98.034,"queue worker 0x28":70.459,"queue worker 0x38":74.545,"queue worker 0x20":71.040,"queue worker 0x30":72.102,"queue worker 0x48":74.562,"queue worker 0x40":74.546},"top_phases_ms_per_frame":{"Driver.Packet":1168.897,"Driver.Packet.memory_wait":944.633,"Graphics.Draw":143.891,"Graphics.Draw.draw_and_resource_release":139.755,"Driver.Packet.draw":127.370,"Driver.Draw":127.087,"Driver.Draw.draw_enqueued":100.901,"Driver.Packet.dispatch":65.893},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":58.880,"events_lost":680713,"totals_full":false},"draw committer":{"events_full_after_s":122.240,"events_lost":25504,"totals_full":false}},"trace":"aps5-trace-3a2b91981651-47944.json.gz"} {"commit":"9d619dee3e37","dirty":false,"env":{"APS5_FORCE_SDR":"1","APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_FRAMES":"2100:600"},"gpu":"AMD Radeon RX 9070 XT","driver":"AMD proprietary driver 26.10.1 (LLPC)","os":"Windows 10.0.26200","cpu":"AMD Ryzen 7 5800X3D 8-Core Processor","cpu_threads":16,"memory_mib":65440,"title_id":"PPSA01670","title":"DEATHLOOP","content_version":"01.405.000","resolution":"3840x2160","window":{"spec":"frames 2100:600","first_present":2100,"ms":67692.709},"presents":600,"frame_ms":{"p50":89.814,"p90":118.386,"p99":329.187,"max":17915.687},"gpu_busy_ms_per_present":55.986,"worker_busy_pct":{"queue worker 0x0":96.017,"queue worker 0x20":54.698,"queue worker 0x28":53.546,"queue worker 0x30":59.957,"queue worker 0x48":67.162,"queue worker 0x38":67.134,"queue worker 0x40":67.097},"top_phases_ms_per_frame":{"Driver.Packet":523.959,"Driver.Packet.memory_wait":394.191,"Driver.Packet.dispatch":55.856,"Driver.Packet.draw":52.309,"Driver.Dispatch":52.209,"Driver.Draw":52.032,"Resources.Complete":32.941,"Vulkan.Dispatch":32.709},"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":36.416,"events_lost":687947,"totals_full":false},"draw committer":{"events_full_after_s":61.309,"events_lost":44434,"totals_full":false}},"trace":"aps5-trace-9d619dee3e37-5436.json.gz"} ``` With the default event buffers the 600-present windows don't fit: every line has `trace_dropped: true`, with `queue worker 0x0` full 35 to 59 s and `draw committer` 60 to 122 s into the window, and no thread's totals table filled (`totals_full: false`). So the summary lines' totals are complete, and so are the presents, but the traces (and the `trace_digest` thread tables) hold those two threads' slices only up to the point their buffer filled. The draw counts the earlier comparisons used to find the cut into the cutscene are among the lost slices, so the cut is now found from frame times alone: the first present interval over 400 ms after the window's longest interval (the loading frame, 17 to 28 s here). On the four previous traces, taken with `APS5_TRACE_EVENTS=3145728` and complete buffers, this finds the same interval as the draw-count rule and gives identical figures. The cut's first present moves between runs (the pad script is timed in seconds), so each window starts on the loading screen (`APS5_TRACE_FRAMES=1650:600` on base, `2100:600` on change). Over the same 300 present intervals in every trace, from 60 to 360 after the cut: | | base 1 | base 2 | change 1 | change 2 | |---|---|---|---|---| | mean frame (ms) | 232.1 | 263.6 | 93.4 | 94.4 | | p50 / p90 / p99 (ms) | 227.9 / 262.1 / 298.3 | 255.0 / 314.5 / 380.6 | 92.9 / 113.4 / 143.2 | 93.8 / 112.2 / 143.8 | Whole window, from the summary lines' totals: `Driver.Packet.memory_wait` 860.3 / 944.6 ms per frame on base vs 467.2 / 394.2 on change; GPU busy per present 51.8 / 46.8 vs 65.3 / 56.0. Earlier, with `APS5_TRACE_EVENTS=3145728` added (so not to the form), same scene and builds: over 313 matched intervals, mean frame 252.9 / 239.6 ms on base and 92.0 / 92.7 ms on change. On `main` `319621ba2e` with `41eef2d043` (306 matched intervals, the cut found with "under 100 draws" since one base trace had 66 draws just before its cut): 255.4 / 254.9 ms vs 93.5 / 98.4 ms; on `main` `2227f13661` with `afe34f6dbb` (297 matched intervals): 290.4 / 268.2 ms vs 97.6 / 95.6 ms; all with that switch. With tibzejoker's port of #6192 on both arms, on `main` `3a40945e62`: frame p50 196.9 / 168.2 ms on base and 95.7 / 94.0 ms on change. Before that (10 s summaries, details on #12329), page exclusion alone on plain `main` did not move the cutscene in one run each. ### 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: #12329 - [x] Unblocks: none - [x] GPUs tested: AMD Radeon RX 9070 XT, driver 32.0.32015.7029, Windows 11 - [x] AI-assisted: yes 🤖 Generated with [Claude Code](https://claude.com/claude-code)
MarcZX10 commented 2026-10-28 12:05:46 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-28T12:05:46Z.

Review: CHANGES_REQUESTED


Reviewed the performance report and current PR body. The paired runs and reported per-frame measurements are useful, but this perf(agc) PR does not yet meet the repository’s required performance-report evidence: I cannot find the aps5-summary.jsonl line for main and the line for this change, links/attachments for the two traces, or the output of tools/trace_digest.py. Please add those required artifacts for the same machine and scene before this is ready for approval. I have not assessed the performance claim as complete from the summary table alone.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5682293657 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12378#pullrequestreview-5682293657). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-28T12:05:46Z. **Review:** CHANGES_REQUESTED --- Reviewed the performance report and current PR body. The paired runs and reported per-frame measurements are useful, but this `perf(agc)` PR does not yet meet the repository’s required performance-report evidence: I cannot find the `aps5-summary.jsonl` line for `main` and the line for this change, links/attachments for the two traces, or the output of `tools/trace_digest.py`. Please add those required artifacts for the same machine and scene before this is ready for approval. I have not assessed the performance claim as complete from the summary table alone.
adriadam10 commented 2026-10-28 12:11:49 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-28T12:11:49Z.

Review: CHANGES_REQUESTED


The page-granular WriteWatchCoverage looks right on reading: Exclude covers the first/last page masks per block, Restore compares each page against its own generation, the map entry is erased once a block has no excluded page, and ExcludedSpan still returns the whole block for the unwatch hook. The new WriteWatchCoverage, WriteTracking and Recorder assertions pin values that only the change produces.

What blocks it:

  • This is a perf PR and the evidence is incomplete (same ask as the pr-labels-perf bot and @MarcZX10's review): paste the aps5-summary.jsonl line of the capture on main and the one with the change, attach the two traces, and add the output of tools/trace_digest.py for both, from the same title, scene and machine. The table in ### Tested is not a substitute for these.
  • The measured gain depends on #6192, which is not merged, and the body says this exact change was not run without the port. Please state the result on plain main too (or say that there is none), so the claim matches what would land.

Once the artifacts are attached this is ready for another look.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5682361543 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12378#pullrequestreview-5682361543). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-28T12:11:49Z. **Review:** CHANGES_REQUESTED --- The page-granular `WriteWatchCoverage` looks right on reading: `Exclude` covers the first/last page masks per block, `Restore` compares each page against its own generation, the map entry is erased once a block has no excluded page, and `ExcludedSpan` still returns the whole block for the unwatch hook. The new `WriteWatchCoverage`, `WriteTracking` and `Recorder` assertions pin values that only the change produces. What blocks it: - This is a `perf` PR and the evidence is incomplete (same ask as the `pr-labels-perf` bot and @MarcZX10's review): paste the `aps5-summary.jsonl` line of the capture on `main` and the one with the change, attach the two traces, and add the output of `tools/trace_digest.py` for both, from the same title, scene and machine. The table in `### Tested` is not a substitute for these. - The measured gain depends on #6192, which is not merged, and the body says this exact change was not run without the port. Please state the result on plain `main` too (or say that there is none), so the claim matches what would land. Once the artifacts are attached this is ready for another look.
MarcZX10 commented 2026-10-28 15:43:32 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-28T15:43:32Z.

Review: CHANGES_REQUESTED


The performance-report follow-up now includes the required summary lines, trace links, and trace_digest.py output; that resolves my earlier evidence request. I checked the exact current PR head 5f0cd01b53 against upstream main 17f8dfad51, though, and it is 181 commits behind the current base (4 commits ahead). The PR's recorded base is 2227f13661, and its latest listed build/trace comparison uses older main 750cf6cf48 / 2227f13661, not today's 17f8dfad51.

CONTRIBUTING requires branches to stay current with main, and the performance claim needs a main/change comparison. Please rebase onto current main, rerun the focused write-watch suite on both sides with the required Vulkan-validation environment, and refresh the paired performance captures/digests against that same current base. The current Windows CI and the reported prior GPU runs are useful evidence, but they do not cover the intervening base changes. I did not independently run the suite in this session, so I am not approving this head.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5685466773 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12378#pullrequestreview-5685466773). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-28T15:43:32Z. **Review:** CHANGES_REQUESTED --- The performance-report follow-up now includes the required summary lines, trace links, and `trace_digest.py` output; that resolves my earlier evidence request. I checked the exact current PR head `5f0cd01b53` against upstream `main` `17f8dfad51`, though, and it is 181 commits behind the current base (4 commits ahead). The PR's recorded base is `2227f13661`, and its latest listed build/trace comparison uses older `main` `750cf6cf48` / `2227f13661`, not today's `17f8dfad51`. CONTRIBUTING requires branches to stay current with `main`, and the performance claim needs a main/change comparison. Please rebase onto current `main`, rerun the focused write-watch suite on both sides with the required Vulkan-validation environment, and refresh the paired performance captures/digests against that same current base. The current Windows CI and the reported prior GPU runs are useful evidence, but they do not cover the intervening base changes. I did not independently run the suite in this session, so I am not approving this head.
MarcZX10 commented 2026-10-28 23:38:26 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-28T23:38:26Z.

Review: CHANGES_REQUESTED


Re-checked — changes requested

The new interior-page regressions address the reported write-stamping gap, but the test and performance evidence still uses a base that predates a relevant GuestMemory.cpp change now on main.

What I ran

  • Reviewed exact PR head 41eef2d0434e629e74c11d3034455e26f70d84bc; its recorded main merge is 319621ba2e578bd053b0baba2877fe70520e0737. Current main is 3a2b91981651569163768854a1fcdc7193b6667b and includes merge commit 33acc03447034b61424cc1c36143cc40ea02bad3 for #8930.
  • Compared current main with the PR head using git merge-tree --write-tree upstream/main HEAD; the merge preview is clean (c187869a289ae7604192a1a4963a9ee3ed9e966b).
  • Ran python3 tools/check_conventions.py --base upstream/main and git diff --check upstream/main...HEAD: zero convention errors and a clean diff check. The convention checker reports a non-blocking debt-length warning for the 1,742-character entry in docs/dev/debt/libSceAgcDriver.md.
  • Ran python3 tools/pr_overlap.py --branch HEAD --repo boykopovar/AnyPS5 --base main; it scanned 1,361 open PRs. It reports older uncomparable PRs that conflict with the current base, so those rows need manual evaluation before treating the overlap report as exhaustive.
  • Downloaded the first reported base and change traces and ran tools/trace_digest.py --json --frames 0 --top 8 on each. The queue-worker and largest-slice values match the posted digests for those two traces; I did not digest the second pair.
  • Refreshed hosted checks: Windows, conventions, eligibility, labels and report pass; Linux and specialized product jobs are skipped. The Windows configure log selects F16ToF32Unpack, F64FmaSubnormals and RegistrationPrepareShutdown; it does not establish that the new recorder regressions ran in hosted CI. I did not independently run the reported Windows/GPU suite.

Results

Check Result
Main merge preview Clean, tree c187869a289ae7604192a1a4963a9ee3ed9e966b
Conventions / diff check 0 convention errors; diff check passes; one debt-length warning
First base/change trace digest Matches the posted queue-worker and largest-slice values
Hosted Windows and policy checks Pass
Hosted Linux/product and specialized checks Skipped

Findings

Blocking

  • The integrated write-watch change has not been tested or performance-compared. The PR tests and captures use main 319621ba2e. Current main includes #8930 (33acc03447034b61424cc1c36143cc40ea02bad3), which changes core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp in WriteChanged. This PR also changes GuestMemory.cpp for write-watch tracking. The clean merge preview shows the changes compose textually, but does not verify their combined behavior or updated performance baseline.

Non-blocking

  • The changed technical-debt entry is 1,742 characters; the convention checker warns at 1,000. Consider compressing it to keep only the behavior and remaining uncertainty needed by the entry.

Sources

Not verified

I did not run the Windows-only write-watch regressions, reproduce the GPU captures, or rerun the focused performance suite on a merge with current main. The author's reported Windows runs are for the earlier 319621ba2e base.

To get this to a good state

Rebase onto current main, preserve both #8930's changed-byte write path and this PR's page-level watch tracking, then rerun the focused write-watch regressions and provide a fresh paired main/change performance report with both summary lines, traces and trace_digest.py output.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5691094710 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12378#pullrequestreview-5691094710). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-28T23:38:26Z. **Review:** CHANGES_REQUESTED --- # Re-checked — changes requested The new interior-page regressions address the reported write-stamping gap, but the test and performance evidence still uses a base that predates a relevant `GuestMemory.cpp` change now on `main`. ## What I ran - Reviewed exact PR head `41eef2d0434e629e74c11d3034455e26f70d84bc`; its recorded main merge is `319621ba2e578bd053b0baba2877fe70520e0737`. Current `main` is `3a2b91981651569163768854a1fcdc7193b6667b` and includes merge commit `33acc03447034b61424cc1c36143cc40ea02bad3` for #8930. - Compared current main with the PR head using `git merge-tree --write-tree upstream/main HEAD`; the merge preview is clean (`c187869a289ae7604192a1a4963a9ee3ed9e966b`). - Ran `python3 tools/check_conventions.py --base upstream/main` and `git diff --check upstream/main...HEAD`: zero convention errors and a clean diff check. The convention checker reports a non-blocking debt-length warning for the 1,742-character entry in `docs/dev/debt/libSceAgcDriver.md`. - Ran `python3 tools/pr_overlap.py --branch HEAD --repo boykopovar/AnyPS5 --base main`; it scanned 1,361 open PRs. It reports older uncomparable PRs that conflict with the current base, so those rows need manual evaluation before treating the overlap report as exhaustive. - Downloaded the first reported base and change traces and ran `tools/trace_digest.py --json --frames 0 --top 8` on each. The queue-worker and largest-slice values match the posted digests for those two traces; I did not digest the second pair. - Refreshed hosted checks: Windows, conventions, eligibility, labels and report pass; Linux and specialized product jobs are skipped. The Windows configure log selects `F16ToF32Unpack`, `F64FmaSubnormals` and `RegistrationPrepareShutdown`; it does not establish that the new recorder regressions ran in hosted CI. I did not independently run the reported Windows/GPU suite. ## Results | Check | Result | |---|---| | Main merge preview | Clean, tree `c187869a289ae7604192a1a4963a9ee3ed9e966b` | | Conventions / diff check | 0 convention errors; diff check passes; one debt-length warning | | First base/change trace digest | Matches the posted queue-worker and largest-slice values | | Hosted Windows and policy checks | Pass | | Hosted Linux/product and specialized checks | Skipped | ## Findings ### Blocking - **The integrated write-watch change has not been tested or performance-compared.** The PR tests and captures use `main` `319621ba2e`. Current main includes #8930 (`33acc03447034b61424cc1c36143cc40ea02bad3`), which changes `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` in `WriteChanged`. This PR also changes `GuestMemory.cpp` for write-watch tracking. The clean merge preview shows the changes compose textually, but does not verify their combined behavior or updated performance baseline. ### Non-blocking - The changed technical-debt entry is 1,742 characters; the convention checker warns at 1,000. Consider compressing it to keep only the behavior and remaining uncertainty needed by the entry. ## Sources - [PR head write-watch change](https://github.com/boykopovar/AnyPS5/blob/41eef2d0434e629e74c11d3034455e26f70d84bc/core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp) - [PR head interior-page regressions](https://github.com/boykopovar/AnyPS5/blob/41eef2d0434e629e74c11d3034455e26f70d84bc/core/libs/prx/libSceAgcDriver/tests/Recorder.cpp) - [Main's #8930 merge affecting `GuestMemory.cpp`](https://github.com/boykopovar/AnyPS5/blob/33acc03447034b61424cc1c36143cc40ea02bad3/core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp) - [#8930 change](https://github.com/boykopovar/AnyPS5/pull/8930) ## Not verified I did not run the Windows-only write-watch regressions, reproduce the GPU captures, or rerun the focused performance suite on a merge with current main. The author's reported Windows runs are for the earlier `319621ba2e` base. ## To get this to a good state Rebase onto current `main`, preserve both #8930's changed-byte write path and this PR's page-level watch tracking, then rerun the focused write-watch regressions and provide a fresh paired main/change performance report with both summary lines, traces and `trace_digest.py` output.
MarcZX10 commented 2026-10-29 03:11:16 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T03:11:16Z.

Review: CHANGES_REQUESTED


Re-checked — changes requested

The code and current-main validation evidence address my earlier findings. I am keeping changes requested because the performance capture uses a prohibited trace switch and the traces are hosted in a separate repository instead of attached to this PR.

What I ran

  • Reviewed exact head 9d619dee3e37dddf31d21fd897631a12c8c958ee against current main 3a2b91981651569163768854a1fcdc7193b6667b.
  • Ran python3 tools/check_conventions.py --base upstream/main --head HEAD.
  • Ran git diff --check upstream/main...HEAD and git merge-tree --write-tree upstream/main HEAD.
  • Downloaded the four trace files from the linked release and ran tools/trace_digest.py with each summary line from the PR comment.
  • Refreshed hosted checks and read the author’s current-head Windows validation report.

Results

Check Result
Conventions Passed
Diff whitespace Passed
Merge preview with current main Clean; tree 777110a31fe78ec639500584b723a97ef853ee41
Recomputed trace digest: base run 1 Exact full-output match
Recomputed trace digest: base run 2 Exact full-output match
Recomputed trace digest: change run 1 Exact full-output match
Recomputed trace digest: change run 2 Exact full-output match
Author-reported focused validation Three alternating runs on current main and this head, RX 9070 XT; no missing-layer or VUID- lines
Hosted checks Conventions, eligibility, labels, and report pass; Windows pending; Linux and specialized jobs skipped

The author’s validation run reports 25/27 tests on the baseline because the two new shared-block regressions fail there, and 31/31 on the change. The paired test and performance results are author-run; I did not independently run Windows/Vulkan tests.

Negative control

Control Result
New shared-block rewatch tests on baseline Author reports both fail at the expected whole-block exclusion assertion
New shared-block rewatch tests on the change Author reports both pass in all three runs
Independent reproduction Not run; this host is not the reported Windows RX 9070 XT system

Findings

Blocking

  • The summary lines set APS5_TRACE_EVENTS=3145728. The repository’s performance capture form permits choosing APS5_TRACE_FRAMES or APS5_TRACE_SECONDS, then explicitly requires no other APS5_TRACE_* or APS5_PROFILE_* switch. Please recapture the base and change pair following that procedure, replace all four summary lines, traces, digest outputs, and update the reported comparison from the new captures.
  • Attach the trace artifacts to this PR. The current summary and digest are in the PR comment, but all four trace files are linked from a release in another repository. The capture form asks reporters to attach each trace to the report. Please attach the matching files here so the report remains self-contained.

Non-blocking

  • The capture uses different frame-window offsets for base and change because the cutscene begins at a different present. The report explains the alignment and compares the same 313 intervals after the cut; I found no inconsistency in the reproduced digests.
  • The baseline summary has dirty: true because the new regression tests were added to its local tree. The report states production sources match current main; this does not appear to contaminate the performance comparison, but keep the baseline-only test changes explicit.

Sources

All code links point to the reviewed commit 9d619dee3e37dddf31d21fd897631a12c8c958ee.

Not verified

  • I did not run the Windows/Vulkan regression suite or performance captures locally.
  • Windows hosted build remains pending; Linux and specialized product jobs were skipped.
  • I did not independently inspect the RX 9070 XT validation logs; their results are attributed to the author.

To get to a good state

Recapture with only the allowed trace-window switch among APS5_TRACE_*/APS5_PROFILE_*, attach the four new traces to this PR, and replace the summary and digest outputs with those from the new captures.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5692405642 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12378#pullrequestreview-5692405642). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-29T03:11:16Z. **Review:** CHANGES_REQUESTED --- # Re-checked — changes requested The code and current-main validation evidence address my earlier findings. I am keeping changes requested because the performance capture uses a prohibited trace switch and the traces are hosted in a separate repository instead of attached to this PR. ## What I ran - Reviewed exact head `9d619dee3e37dddf31d21fd897631a12c8c958ee` against current `main` `3a2b91981651569163768854a1fcdc7193b6667b`. - Ran `python3 tools/check_conventions.py --base upstream/main --head HEAD`. - Ran `git diff --check upstream/main...HEAD` and `git merge-tree --write-tree upstream/main HEAD`. - Downloaded the four trace files from the linked release and ran `tools/trace_digest.py` with each summary line from the PR comment. - Refreshed hosted checks and read the author’s current-head Windows validation report. ## Results | Check | Result | |---|---| | Conventions | Passed | | Diff whitespace | Passed | | Merge preview with current `main` | Clean; tree `777110a31fe78ec639500584b723a97ef853ee41` | | Recomputed trace digest: base run 1 | Exact full-output match | | Recomputed trace digest: base run 2 | Exact full-output match | | Recomputed trace digest: change run 1 | Exact full-output match | | Recomputed trace digest: change run 2 | Exact full-output match | | Author-reported focused validation | Three alternating runs on current `main` and this head, RX 9070 XT; no missing-layer or `VUID-` lines | | Hosted checks | Conventions, eligibility, labels, and report pass; Windows pending; Linux and specialized jobs skipped | The author’s validation run reports 25/27 tests on the baseline because the two new shared-block regressions fail there, and 31/31 on the change. The paired test and performance results are author-run; I did not independently run Windows/Vulkan tests. ## Negative control | Control | Result | |---|---| | New shared-block rewatch tests on baseline | Author reports both fail at the expected whole-block exclusion assertion | | New shared-block rewatch tests on the change | Author reports both pass in all three runs | | Independent reproduction | Not run; this host is not the reported Windows RX 9070 XT system | ## Findings ### Blocking - **The summary lines set `APS5_TRACE_EVENTS=3145728`.** The repository’s [performance capture form](https://github.com/boykopovar/AnyPS5/blob/3a2b91981651569163768854a1fcdc7193b6667b/.github/ISSUE_TEMPLATE/performance.yml#L8-L17) permits choosing `APS5_TRACE_FRAMES` or `APS5_TRACE_SECONDS`, then explicitly requires no other `APS5_TRACE_*` or `APS5_PROFILE_*` switch. Please recapture the base and change pair following that procedure, replace all four summary lines, traces, digest outputs, and update the reported comparison from the new captures. - **Attach the trace artifacts to this PR.** The current summary and digest are in the PR comment, but all four trace files are linked from a release in another repository. The capture form asks reporters to attach each trace to the report. Please attach the matching files here so the report remains self-contained. ### Non-blocking - The capture uses different frame-window offsets for base and change because the cutscene begins at a different present. The report explains the alignment and compares the same 313 intervals after the cut; I found no inconsistency in the reproduced digests. - The baseline summary has `dirty: true` because the new regression tests were added to its local tree. The report states production sources match current `main`; this does not appear to contaminate the performance comparison, but keep the baseline-only test changes explicit. ## Sources All code links point to the reviewed commit `9d619dee3e37dddf31d21fd897631a12c8c958ee`. - [Page-level write-watch coverage and generations](https://github.com/boykopovar/AnyPS5/blob/9d619dee3e37dddf31d21fd897631a12c8c958ee/core/libs/prx/libSceAgcDriver/Execution/include/WriteWatchCoverage.hpp) - [Interior-page write tracking and CPU hint stamping](https://github.com/boykopovar/AnyPS5/blob/9d619dee3e37dddf31d21fd897631a12c8c958ee/core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp#L1116-L1125) - [Deferred settle of partial-block imports](https://github.com/boykopovar/AnyPS5/blob/9d619dee3e37dddf31d21fd897631a12c8c958ee/core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp#L2222-L2232) - [Current performance capture requirements](https://github.com/boykopovar/AnyPS5/blob/3a2b91981651569163768854a1fcdc7193b6667b/.github/ISSUE_TEMPLATE/performance.yml#L8-L17) - [Author’s current-head validation, summary lines, digests, and trace release link](https://github.com/boykopovar/AnyPS5/pull/12378#issuecomment-6486570925) - [Four trace files](https://github.com/BunnyFl/AnyPS5/releases/tag/pr12378-main-3a2b919816-traces) ## Not verified - I did not run the Windows/Vulkan regression suite or performance captures locally. - Windows hosted build remains pending; Linux and specialized product jobs were skipped. - I did not independently inspect the RX 9070 XT validation logs; their results are attributed to the author. ## To get to a good state Recapture with only the allowed trace-window switch among `APS5_TRACE_*`/`APS5_PROFILE_*`, attach the four new traces to this PR, and replace the summary and digest outputs with those from the new captures.
MarcZX10 commented 2026-10-29 11:06:51 +00:00 (Migrated from github.com)

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

Review: CHANGES_REQUESTED


Re-checked — changes requested

The new report resolves the artifact issues from my prior review: it uses APS5_TRACE_FRAMES only, attaches the traces, and includes the digest output. The author also explains that the complete summary totals are retained even though event buffers overflow; the digest correctly marks the traces as dropped, so the per-thread event timelines are incomplete while the reported phase totals remain available.

The PR is still based on main 3a2b919816, while current main is ba5b5330b3. The intervening changes touch this PR's CMake registration, architecture and debt files. Please merge current main and run the focused registered test/conventions checks on the resulting exact head. The author’s path comparison indicates the measured production source is unchanged, so the existing captures can remain if the refreshed diff confirms that; please keep the dropped-event limitation explicit.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5696695356 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12378#pullrequestreview-5696695356). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-29T11:06:51Z. **Review:** CHANGES_REQUESTED --- ## Re-checked — changes requested The new report resolves the artifact issues from my prior review: it uses `APS5_TRACE_FRAMES` only, attaches the traces, and includes the digest output. The author also explains that the complete summary totals are retained even though event buffers overflow; the digest correctly marks the traces as dropped, so the per-thread event timelines are incomplete while the reported phase totals remain available. The PR is still based on `main` `3a2b919816`, while current `main` is `ba5b5330b3`. The intervening changes touch this PR's CMake registration, architecture and debt files. Please merge current `main` and run the focused registered test/conventions checks on the resulting exact head. The author’s path comparison indicates the measured production source is unchanged, so the existing captures can remain if the refreshed diff confirms that; please keep the dropped-event limitation explicit.
MarcZX10 commented 2026-10-29 17:33:21 +00:00 (Migrated from github.com)

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

Review: APPROVED


Re-checked — new head, looks good

The current head integrates the latest base, preserves the reviewed implementation, and the exact-head validation and Windows CI pass.

What I ran

  • Reviewed head 480ca2dff1fc0c079d3888b43e61b76471ffc40f, whose merge commit includes current main `bb04a4f1ea); GitHub reports it mergeable.
  • Locally ran git diff --check upstream/main...HEAD on Linux; it passed with no output.
  • Refreshed hosted checks with gh pr checks 12378 --repo boykopovar/AnyPS5.
  • Read the author’s report of three alternating runs of the focused Windows/Vulkan suite on this exact head and the prior paired performance captures. These are author-provided results, not runs I performed.
git diff --check upstream/main...HEAD
gh pr checks 12378 --repo boykopovar/AnyPS5

Results

Check Result
Diff whitespace Passed locally
Conventions Hosted check passed; author also reports exact-head pass
Windows build Hosted check passed
Focused Windows/Vulkan suite Author reports 31/31 on this head in each of three runs
Linux and specialized product checks Skipped by workflow
Unedited local diff-check output

Unedited hosted check output
conventions	pass	16s	https://github.com/boykopovar/AnyPS5/actions/runs/40897119882/job/123529182604
labels	pass	11s	https://github.com/boykopovar/AnyPS5/actions/runs/40897119855/job/123530593279
windows	pass	9m43s	https://github.com/boykopovar/AnyPS5/actions/runs/40897122954/job/123529927182
linux	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/40897122954/job/123529930007
register-context	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/40897122954/job/123529929396
relinker	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/40897122954/job/123529930807
relinker-asan	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/40897122954/job/123529930194
write-watch	skipping	0	https://github.com/boykopovar/AnyPS5/actions/runs/40897122954/job/123529930783
eligibility	pass	6s	https://github.com/boykopovar/AnyPS5/actions/runs/40897122954/job/123529182973
report	pass	50s	https://github.com/boykopovar/AnyPS5/actions/runs/40897123482/job/123529185222

Negative control

Assertion Change/control Result
New shared-block rewatch regressions Baseline main with the new tests retained Author reports 2 expected failures (25/27 pass); the change reports 31/31 pass
Independent reproduction Not run; this Linux environment cannot reproduce the author’s Windows/Vulkan setup Not independently verified

Findings

Blocking

None found in the reviewed change.

Non-blocking

The DEATHLOOP trace captures report trace_dropped: true; their summary totals and frame samples remain available, while the affected worker event timelines are incomplete. This limitation is disclosed in the report. The new GTA V data point is also author-reported and was not independently reproduced.

Sources

Not verified

  • I did not run a local C++ build, Windows/Vulkan tests, GPU performance capture, or physical-console checks.
  • Linux and specialized hosted jobs were skipped.
  • The author’s Windows/Vulkan and performance results were not independently reproduced.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5702211785 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12378#pullrequestreview-5702211785). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-29T17:33:21Z. **Review:** APPROVED --- # Re-checked — new head, looks good The current head integrates the latest base, preserves the reviewed implementation, and the exact-head validation and Windows CI pass. ## What I ran - Reviewed head `480ca2dff1fc0c079d3888b43e61b76471ffc40f`, whose merge commit includes current `main` `bb04a4f1ea0175e9e4f149f0359a764d62ff3296); GitHub reports it mergeable. - Locally ran `git diff --check upstream/main...HEAD` on Linux; it passed with no output. - Refreshed hosted checks with `gh pr checks 12378 --repo boykopovar/AnyPS5`. - Read the author’s report of three alternating runs of the focused Windows/Vulkan suite on this exact head and the prior paired performance captures. These are author-provided results, not runs I performed. ```sh git diff --check upstream/main...HEAD gh pr checks 12378 --repo boykopovar/AnyPS5 ``` ## Results | Check | Result | |---|---| | Diff whitespace | Passed locally | | Conventions | Hosted check passed; author also reports exact-head pass | | Windows build | Hosted check passed | | Focused Windows/Vulkan suite | Author reports 31/31 on this head in each of three runs | | Linux and specialized product checks | Skipped by workflow | <details><summary>Unedited local diff-check output</summary> ```text ``` </details> <details><summary>Unedited hosted check output</summary> ```text conventions pass 16s https://github.com/boykopovar/AnyPS5/actions/runs/40897119882/job/123529182604 labels pass 11s https://github.com/boykopovar/AnyPS5/actions/runs/40897119855/job/123530593279 windows pass 9m43s https://github.com/boykopovar/AnyPS5/actions/runs/40897122954/job/123529927182 linux skipping 0 https://github.com/boykopovar/AnyPS5/actions/runs/40897122954/job/123529930007 register-context skipping 0 https://github.com/boykopovar/AnyPS5/actions/runs/40897122954/job/123529929396 relinker skipping 0 https://github.com/boykopovar/AnyPS5/actions/runs/40897122954/job/123529930807 relinker-asan skipping 0 https://github.com/boykopovar/AnyPS5/actions/runs/40897122954/job/123529930194 write-watch skipping 0 https://github.com/boykopovar/AnyPS5/actions/runs/40897122954/job/123529930783 eligibility pass 6s https://github.com/boykopovar/AnyPS5/actions/runs/40897122954/job/123529182973 report pass 50s https://github.com/boykopovar/AnyPS5/actions/runs/40897123482/job/123529185222 ``` </details> ## Negative control | Assertion | Change/control | Result | |---|---|---| | New shared-block rewatch regressions | Baseline `main` with the new tests retained | Author reports 2 expected failures (25/27 pass); the change reports 31/31 pass | | Independent reproduction | Not run; this Linux environment cannot reproduce the author’s Windows/Vulkan setup | Not independently verified | ## Findings ### Blocking None found in the reviewed change. ### Non-blocking The DEATHLOOP trace captures report `trace_dropped: true`; their summary totals and frame samples remain available, while the affected worker event timelines are incomplete. This limitation is disclosed in the report. The new GTA V data point is also author-reported and was not independently reproduced. ## Sources - [Page-level write-watch coverage and generation tracking at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/480ca2dff1fc0c079d3888b43e61b76471ffc40f/core/libs/prx/libSceAgcDriver/Execution/include/WriteWatchCoverage.hpp) - [Interior-page write tracking and hint stamping at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/480ca2dff1fc0c079d3888b43e61b76471ffc40f/core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp) - [Partial-block deferred import settle at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/480ca2dff1fc0c079d3888b43e61b76471ffc40f/core/libs/prx/libSceAgcDriver/Graphics/src/GuestBufferMemory.cpp) - [Performance capture requirements at current base](https://github.com/boykopovar/AnyPS5/blob/bb04a4f1ea0175e9e4f149f0359a764d62ff3296/.github/ISSUE_TEMPLATE/performance.yml) - [Author’s exact-head test report and additional GTA V data point](https://github.com/boykopovar/AnyPS5/pull/12378#issuecomment-6486570925) ## Not verified - I did not run a local C++ build, Windows/Vulkan tests, GPU performance capture, or physical-console checks. - Linux and specialized hosted jobs were skipped. - The author’s Windows/Vulkan and performance results were not independently reproduced.
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!12378
No description provided.