perf(agc): stores beside a range in its 64 KiB block leave the range unchanged #6346

Merged
SleglJan merged 1 commit from upstream-pr/6346 into main 2026-10-18 23:32:32 +00:00
SleglJan commented 2026-10-15 12:43:45 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by SleglJan on 2026-10-15T12:43:45Z.


What

UnchangedSince and UnchangedSinceAll answered from the generations of the 64 KiB blocks a range touches. A CPU or driver store anywhere in a block failed every unchanged proof over any range in it. Among them are the proofs that let a draw keep its sampled textures (fastRevalidate), a reused image table (TableCurrent) and a storage image's upload (StorageTexture::refreshProved). Every caller of the two functions and of StoredOver gets the finer answer. In some runs of 007 First Light (PPSA11386) the CPU writes other pages of the blocks that hold sampled textures in nearly every frame, and most fast revalidations fail and take the full walk.

When a block's generation is newer than the query's, the two functions now look at what wrote the block: the CPU page generations over the range and the block's driver-store pieces, as StoredOver does. StoredOver was already used for this at the shared edge blocks of a surface's write-back (#441).

So that this answer sees every driver stamp:

  • The walk after an own store (storeOwn) stamps the pages it finds dirty in a page map of their own.
    • The unchanged proofs count those pages, so a guest store beside the stored bytes in the same page is not hidden.
    • StoredOver counts them only in a block without driver pieces; where pieces exist it answers as before.
    • They take no slot of the block's four driver pieces and do not count for the complete coverage StoredAllSince proves (#5554).
  • On Windows, a private mapping made over a block that has driver pieces marks them as forgotten instead of dropping them.

A block without pieces or walked pages has therefore had no driver store. Forgotten pieces still count as a store over the whole block. One answer of StoredOver changes: a block whose newer stamp comes only from CPU stores to other pages no longer reads as stored over.

Related:

  • #6266 skips groups of 64 blocks with no newer stamp inside the same block check. The two merge cleanly and compose: its skip answers the unchanged groups, this change answers the newer blocks that remain.
  • #5554 (merged) made noteDriverStore create a block's entry for a whole-block store; this change relies on that.

Tested

  • agc_write_tracking:
    • CheckSharedBlockProofs (new): CPU and driver stores beside a range leave it unchanged, alone and in a batch. These are seen:
      • stores inside it;
      • a whole-block store;
      • a whole-block store followed by a partial one;
      • a guest store made beside an own store, in the same page, during the store.
    • A store over six pages of a block leaves the rest of the block unchanged.
    • StoredAllSince keeps an own store's exact coverage, is not proven by its dirty pages, and survives own stores elsewhere in the block; a neighbour in an own store's page is not stored over but reads as changed.
    • CheckVersionRanges: the exact expectation was block-wide. It now checks three things:
      • a range never reads unchanged over a newer write to its bytes;
      • it never reads changed while its blocks are unchanged;
      • the batch answers like the single calls.
        It also adds whole-block stores to the random history.
    • Without the change in GuestMemory.cpp the test fails at "stores beside the range in its 64 KiB block count for it".
  • Test machine: RTX 3080, NVIDIA 615.78.08, CachyOS (Linux 7.2.10), Ryzen 9 7950X3D, Release.
    • ctest -R '^agc' on this branch (on main 0e4ea13a0): 593 tests, 1 failure. agc_driver_store_over_untracked fails the same way on main 3ee537191 (reported on #5671). agc_driver_stencil_ref_export skips itself on this machine.
  • lavapipe (Mesa 26.2.4, LLVM 23.1.1; Arch Linux container, GCC 16.2.1, Release), before the rebase onto 0e4ea13a0: ctest -R '^agc', 589 tests, 8 failures, the same 8 as on main 4e9a2a871 built the same way. The container has no write watching, so the write-tracking tests skip there, agc_write_tracking included.
  • 007 First Light:
    • Scene: the menu with the gameplay save, no input, frames 215–255 by window title, warm shader cache.
    • Main at d92a8dad3 stops at frame 38 (the 2D-biased volume sampling check of #5461), so the runs use one tree: d92a8dad3 plus 12 local commits.
      • Functional: a port of #454 (retire a depth surface once another writer covers it), a workaround for the 2D-biased volume sampling throw of #5461, image-table key narrowing, cube output modifiers, a shader fold, and a join of registered ranges under a buffer that crosses them.
      • Off by default or log-only: three input tools, an FPS logger and two fault diagnostics.
    • These runs used the GuestMemory.cpp change of the revision before the rebase onto #5554, in which the walk's dirty runs were driver pieces and took slots of the block's four, so it answered changed at least wherever this revision does; the fallback in the unchanged proofs is otherwise the same.
    • Alternated ABBAABBA, without (A) and with (B) this change. The A build also carries a diagnostic that logs, for each failed fast revalidation, what wrote its changed ranges, only when its switch is set.
    • APS5_PROFILE_DRAW=1 in every run, for the revalidation counters. Both arms of these runs also set APS5_HOST_IMPORT_MIB=12288, APS5_RESOURCE_CACHE_ENTRIES=64 and APS5_NO_DRAW_SRT_ENTRIES=1.
run FPS fast revalidations full walks revalidation time
A1 0.514 14,513 24,005 46.2 s
B1 0.639 36,444 122 20.1 s
B2 0.625 38,735 123 21.5 s
A2 0.631 41,663 121 22.9 s
A3 0.593 36,690 393 20.8 s
B3 0.538 38,371 120 23.0 s
B4 0.581 24,986 136 13.5 s
A4 0.628 38,541 130 20.9 s

The counters are cumulative at the end of the run (frames 252–259). B4's menu started later than the others' (frame ~210 instead of ~175–185), so its window starts with the menu and it has fewer revalidations. In every 10 s interval that started after frame 150, the share of revalidations that took the full walk was:

  • without the change (8 runs: A1–A4, one more on the A build, and 3 on the A build with the diagnostic switched on): 61–65% in every interval of 2 runs (A1, FPS 0.514, and a diagnostic run, 0.505), 15% in every interval of 1 run (0.590), at most 1.2% in the other 5 (median FPS 0.627);
  • with the change (11 runs: B1–B4, five more on the B build, and two on a diagnostic build): 0.0% (at most one full walk per interval) in every run (median FPS 0.624, range 0.538–0.639).
  • In the three diagnostic runs without the change, 63,543 of 64,593 failing range queries of fast revalidations (98.4%) had newer CPU stores only on other pages of their 64 KiB block and no recorded driver store over them.
  • Summary lines: 11 captures alternated between the arms with only APS5_TRACE_FRAMES=200:40 set, warm caches, the same tree; the sandbox writes the log to a file. 2 of the 5 A captures ran at about 0.45 FPS over frames 215–255 (one of them while a build ran on the machine), none of the 6 B captures did. 6 are attached, the ones with a saved trace that ran without another load on the machine: 3 per arm (the trace files are the assets aps5-trace-A1–A3 and B1–B3 of https://github.com/SleglJan/AnyPS5/releases/tag/perf-traces-unchanged-shared-block, in the order of the lines below). Commit 7141b56717d8 is the A build and 91e399694be4 the B build (both local). Frame p50, base (A): 2,240, 1,547 and 1,561 ms; with the change (B): 1,554, 1,641 and 1,553 ms. The first A capture had 327 ms of GPU work per present against 158–166 in the others and 11,028 ms of Driver.Packet per frame against 7,636–8,083.
{"commit":"7141b56717d8","dirty":false,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_FRAMES":"200:40"},"gpu":"NVIDIA GeForce RTX 3080","driver":"NVIDIA 615.78.08","os":"Linux 7.2.10-1-cachyos","resolution":"3840x2160","window":{"spec":"frames 200:40","first_present":200,"ms":89632.562},"presents":40,"frame_ms":{"p50":2239.687,"p90":2341.581,"p99":2416.897,"max":2416.897},"gpu_busy_ms_per_present":327.461,"worker_busy_pct":{"queue worker 0x0":99.979,"queue worker 0x20":97.573,"queue worker 0x28":98.590,"queue worker 0x30":98.588,"queue worker 0x38":97.573},"top_phases_ms_per_frame":{"Driver.Packet":11028.243,"Driver.Packet.memory_wait":8297.673,"Driver.Packet.draw":2155.935,"Driver.Draw":2155.674,"Driver.Draw.shader_compile_and_link":1356.085,"Shader.DrawStage":1335.618,"Shader.DrawStage.capture_resources":1171.822,"Driver.Draw.draw_and_resource_release":779.367},"trace_dropped":false,"trace":"aps5-trace-7141b56717d8-2.json.gz"}
{"commit":"7141b56717d8","dirty":false,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_FRAMES":"200:40"},"gpu":"NVIDIA GeForce RTX 3080","driver":"NVIDIA 615.78.08","os":"Linux 7.2.10-1-cachyos","resolution":"3840x2160","window":{"spec":"frames 200:40","first_present":200,"ms":62039.415},"presents":40,"frame_ms":{"p50":1546.925,"p90":1593.178,"p99":1618.618,"max":1618.618},"gpu_busy_ms_per_present":158.336,"worker_busy_pct":{"queue worker 0x0":99.973,"queue worker 0x20":97.707,"queue worker 0x28":98.620,"queue worker 0x30":98.616,"queue worker 0x38":97.712},"top_phases_ms_per_frame":{"Driver.Packet":7636.375,"Driver.Packet.memory_wait":5873.218,"Driver.Packet.draw":1478.977,"Driver.Draw":1478.760,"Driver.Draw.shader_compile_and_link":1110.349,"Shader.DrawStage":1095.407,"Shader.DrawStage.capture_resources":943.222,"Driver.Draw.draw_and_resource_release":357.749},"trace_dropped":false,"trace":"aps5-trace-7141b56717d8-2.json.gz"}
{"commit":"7141b56717d8","dirty":false,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_FRAMES":"200:40"},"gpu":"NVIDIA GeForce RTX 3080","driver":"NVIDIA 615.78.08","os":"Linux 7.2.10-1-cachyos","resolution":"3840x2160","window":{"spec":"frames 200:40","first_present":200,"ms":62364.688},"presents":40,"frame_ms":{"p50":1560.970,"p90":1613.087,"p99":1644.182,"max":1644.182},"gpu_busy_ms_per_present":160.874,"worker_busy_pct":{"queue worker 0x0":99.974,"queue worker 0x20":97.500,"queue worker 0x38":97.519,"queue worker 0x28":98.506,"queue worker 0x30":98.503},"top_phases_ms_per_frame":{"Driver.Packet":7668.336,"Driver.Packet.memory_wait":5886.401,"Driver.Packet.draw":1485.632,"Driver.Draw":1485.405,"Driver.Draw.shader_compile_and_link":1112.668,"Shader.DrawStage":1095.616,"Shader.DrawStage.capture_resources":942.856,"Driver.Draw.draw_and_resource_release":361.708},"trace_dropped":false,"trace":"aps5-trace-7141b56717d8-2.json.gz"}
{"commit":"91e399694be4","dirty":false,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_FRAMES":"200:40"},"gpu":"NVIDIA GeForce RTX 3080","driver":"NVIDIA 615.78.08","os":"Linux 7.2.10-1-cachyos","resolution":"3840x2160","window":{"spec":"frames 200:40","first_present":200,"ms":62183.827},"presents":40,"frame_ms":{"p50":1554.095,"p90":1591.655,"p99":1630.537,"max":1630.537},"gpu_busy_ms_per_present":163.514,"worker_busy_pct":{"queue worker 0x0":99.971,"queue worker 0x20":97.632,"queue worker 0x28":98.608,"queue worker 0x30":98.606,"queue worker 0x38":97.635},"top_phases_ms_per_frame":{"Driver.Packet":7653.412,"Driver.Packet.memory_wait":5908.576,"Driver.Packet.draw":1486.227,"Driver.Draw":1486.015,"Driver.Draw.shader_compile_and_link":1110.462,"Shader.DrawStage":1099.376,"Shader.DrawStage.capture_resources":943.954,"Driver.Draw.draw_and_resource_release":367.067},"trace_dropped":false,"trace":"aps5-trace-91e399694be4-2.json.gz"}
{"commit":"91e399694be4","dirty":false,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_FRAMES":"200:40"},"gpu":"NVIDIA GeForce RTX 3080","driver":"NVIDIA 615.78.08","os":"Linux 7.2.10-1-cachyos","resolution":"3840x2160","window":{"spec":"frames 200:40","first_present":200,"ms":65669.167},"presents":40,"frame_ms":{"p50":1641.170,"p90":1688.472,"p99":1719.335,"max":1719.335},"gpu_busy_ms_per_present":159.693,"worker_busy_pct":{"queue worker 0x0":99.973,"queue worker 0x20":97.663,"queue worker 0x38":97.666,"queue worker 0x30":98.611,"queue worker 0x28":98.613},"top_phases_ms_per_frame":{"Driver.Packet":8082.924,"Driver.Packet.memory_wait":6239.263,"Driver.Packet.draw":1575.564,"Driver.Draw":1575.358,"Driver.Draw.shader_compile_and_link":1193.099,"Shader.DrawStage":1182.535,"Shader.DrawStage.capture_resources":1029.930,"Driver.Draw.draw_and_resource_release":372.720},"trace_dropped":false,"trace":"aps5-trace-91e399694be4-2.json.gz"}
{"commit":"91e399694be4","dirty":false,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_FRAMES":"200:40"},"gpu":"NVIDIA GeForce RTX 3080","driver":"NVIDIA 615.78.08","os":"Linux 7.2.10-1-cachyos","resolution":"3840x2160","window":{"spec":"frames 200:40","first_present":200,"ms":62375.632},"presents":40,"frame_ms":{"p50":1552.708,"p90":1610.929,"p99":1629.742,"max":1629.742},"gpu_busy_ms_per_present":165.812,"worker_busy_pct":{"queue worker 0x0":99.973,"queue worker 0x20":97.544,"queue worker 0x28":98.513,"queue worker 0x38":97.548,"queue worker 0x30":98.511},"top_phases_ms_per_frame":{"Driver.Packet":7669.890,"Driver.Packet.memory_wait":5933.916,"Driver.Packet.draw":1490.126,"Driver.Draw":1489.903,"Driver.Draw.shader_compile_and_link":1109.717,"Shader.DrawStage":1104.190,"Shader.DrawStage.capture_resources":948.091,"Driver.Draw.draw_and_resource_release":368.592},"trace_dropped":false,"trace":"aps5-trace-91e399694be4-2.json.gz"}

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Unblocks: none
  • GPUs tested: NVIDIA RTX 3080, driver 615.78.08, CachyOS Linux 7.2.10; lavapipe (Mesa 26.2.4, LLVM 23.1.1), Arch Linux container
  • AI-assisted: yes (Claude Code)

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:4873437717 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6346). Originally posted by [SleglJan](https://github.com/SleglJan) on 2026-10-15T12:43:45Z. --- ### What `UnchangedSince` and `UnchangedSinceAll` answered from the generations of the 64 KiB blocks a range touches. A CPU or driver store anywhere in a block failed every unchanged proof over any range in it. Among them are the proofs that let a draw keep its sampled textures (`fastRevalidate`), a reused image table (`TableCurrent`) and a storage image's upload (`StorageTexture::refreshProved`). Every caller of the two functions and of `StoredOver` gets the finer answer. In some runs of 007 First Light (PPSA11386) the CPU writes other pages of the blocks that hold sampled textures in nearly every frame, and most fast revalidations fail and take the full walk. When a block's generation is newer than the query's, the two functions now look at what wrote the block: the CPU page generations over the range and the block's driver-store pieces, as `StoredOver` does. `StoredOver` was already used for this at the shared edge blocks of a surface's write-back (#441). So that this answer sees every driver stamp: - The walk after an own store (`storeOwn`) stamps the pages it finds dirty in a page map of their own. - The unchanged proofs count those pages, so a guest store beside the stored bytes in the same page is not hidden. - `StoredOver` counts them only in a block without driver pieces; where pieces exist it answers as before. - They take no slot of the block's four driver pieces and do not count for the complete coverage `StoredAllSince` proves (#5554). - On Windows, a private mapping made over a block that has driver pieces marks them as forgotten instead of dropping them. A block without pieces or walked pages has therefore had no driver store. Forgotten pieces still count as a store over the whole block. One answer of `StoredOver` changes: a block whose newer stamp comes only from CPU stores to other pages no longer reads as stored over. Related: - #6266 skips groups of 64 blocks with no newer stamp inside the same block check. The two merge cleanly and compose: its skip answers the unchanged groups, this change answers the newer blocks that remain. - #5554 (merged) made `noteDriverStore` create a block's entry for a whole-block store; this change relies on that. ### Tested - `agc_write_tracking`: - `CheckSharedBlockProofs` (new): CPU and driver stores beside a range leave it unchanged, alone and in a batch. These are seen: - stores inside it; - a whole-block store; - a whole-block store followed by a partial one; - a guest store made beside an own store, in the same page, during the store. - A store over six pages of a block leaves the rest of the block unchanged. - `StoredAllSince` keeps an own store's exact coverage, is not proven by its dirty pages, and survives own stores elsewhere in the block; a neighbour in an own store's page is not stored over but reads as changed. - `CheckVersionRanges`: the exact expectation was block-wide. It now checks three things: - a range never reads unchanged over a newer write to its bytes; - it never reads changed while its blocks are unchanged; - the batch answers like the single calls. It also adds whole-block stores to the random history. - Without the change in GuestMemory.cpp the test fails at "stores beside the range in its 64 KiB block count for it". - Test machine: RTX 3080, NVIDIA 615.78.08, CachyOS (Linux 7.2.10), Ryzen 9 7950X3D, Release. - `ctest -R '^agc'` on this branch (on `main` 0e4ea13a0): 593 tests, 1 failure. `agc_driver_store_over_untracked` fails the same way on `main` 3ee537191 (reported on #5671). `agc_driver_stencil_ref_export` skips itself on this machine. - lavapipe (Mesa 26.2.4, LLVM 23.1.1; Arch Linux container, GCC 16.2.1, Release), before the rebase onto 0e4ea13a0: `ctest -R '^agc'`, 589 tests, 8 failures, the same 8 as on `main` 4e9a2a871 built the same way. The container has no write watching, so the write-tracking tests skip there, `agc_write_tracking` included. - 007 First Light: - Scene: the menu with the gameplay save, no input, frames 215–255 by window title, warm shader cache. - Main at d92a8dad3 stops at frame 38 (the 2D-biased volume sampling check of #5461), so the runs use one tree: d92a8dad3 plus 12 local commits. - Functional: a port of #454 (retire a depth surface once another writer covers it), a workaround for the 2D-biased volume sampling throw of #5461, image-table key narrowing, cube output modifiers, a shader fold, and a join of registered ranges under a buffer that crosses them. - Off by default or log-only: three input tools, an FPS logger and two fault diagnostics. - These runs used the GuestMemory.cpp change of the revision before the rebase onto #5554, in which the walk's dirty runs were driver pieces and took slots of the block's four, so it answered changed at least wherever this revision does; the fallback in the unchanged proofs is otherwise the same. - Alternated ABBAABBA, without (A) and with (B) this change. The A build also carries a diagnostic that logs, for each failed fast revalidation, what wrote its changed ranges, only when its switch is set. - `APS5_PROFILE_DRAW=1` in every run, for the revalidation counters. Both arms of these runs also set `APS5_HOST_IMPORT_MIB=12288`, `APS5_RESOURCE_CACHE_ENTRIES=64` and `APS5_NO_DRAW_SRT_ENTRIES=1`. | run | FPS | fast revalidations | full walks | revalidation time | |---|---|---|---|---| | A1 | 0.514 | 14,513 | 24,005 | 46.2 s | | B1 | 0.639 | 36,444 | 122 | 20.1 s | | B2 | 0.625 | 38,735 | 123 | 21.5 s | | A2 | 0.631 | 41,663 | 121 | 22.9 s | | A3 | 0.593 | 36,690 | 393 | 20.8 s | | B3 | 0.538 | 38,371 | 120 | 23.0 s | | B4 | 0.581 | 24,986 | 136 | 13.5 s | | A4 | 0.628 | 38,541 | 130 | 20.9 s | The counters are cumulative at the end of the run (frames 252–259). B4's menu started later than the others' (frame ~210 instead of ~175–185), so its window starts with the menu and it has fewer revalidations. In every 10 s interval that started after frame 150, the share of revalidations that took the full walk was: - without the change (8 runs: A1–A4, one more on the A build, and 3 on the A build with the diagnostic switched on): 61–65% in every interval of 2 runs (A1, FPS 0.514, and a diagnostic run, 0.505), 15% in every interval of 1 run (0.590), at most 1.2% in the other 5 (median FPS 0.627); - with the change (11 runs: B1–B4, five more on the B build, and two on a diagnostic build): 0.0% (at most one full walk per interval) in every run (median FPS 0.624, range 0.538–0.639). - In the three diagnostic runs without the change, 63,543 of 64,593 failing range queries of fast revalidations (98.4%) had newer CPU stores only on other pages of their 64 KiB block and no recorded driver store over them. - Summary lines: 11 captures alternated between the arms with only `APS5_TRACE_FRAMES=200:40` set, warm caches, the same tree; the sandbox writes the log to a file. 2 of the 5 A captures ran at about 0.45 FPS over frames 215–255 (one of them while a build ran on the machine), none of the 6 B captures did. 6 are attached, the ones with a saved trace that ran without another load on the machine: 3 per arm (the trace files are the assets aps5-trace-A1–A3 and B1–B3 of https://github.com/SleglJan/AnyPS5/releases/tag/perf-traces-unchanged-shared-block, in the order of the lines below). Commit 7141b56717d8 is the A build and 91e399694be4 the B build (both local). Frame p50, base (A): 2,240, 1,547 and 1,561 ms; with the change (B): 1,554, 1,641 and 1,553 ms. The first A capture had 327 ms of GPU work per present against 158–166 in the others and 11,028 ms of `Driver.Packet` per frame against 7,636–8,083. ```json {"commit":"7141b56717d8","dirty":false,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_FRAMES":"200:40"},"gpu":"NVIDIA GeForce RTX 3080","driver":"NVIDIA 615.78.08","os":"Linux 7.2.10-1-cachyos","resolution":"3840x2160","window":{"spec":"frames 200:40","first_present":200,"ms":89632.562},"presents":40,"frame_ms":{"p50":2239.687,"p90":2341.581,"p99":2416.897,"max":2416.897},"gpu_busy_ms_per_present":327.461,"worker_busy_pct":{"queue worker 0x0":99.979,"queue worker 0x20":97.573,"queue worker 0x28":98.590,"queue worker 0x30":98.588,"queue worker 0x38":97.573},"top_phases_ms_per_frame":{"Driver.Packet":11028.243,"Driver.Packet.memory_wait":8297.673,"Driver.Packet.draw":2155.935,"Driver.Draw":2155.674,"Driver.Draw.shader_compile_and_link":1356.085,"Shader.DrawStage":1335.618,"Shader.DrawStage.capture_resources":1171.822,"Driver.Draw.draw_and_resource_release":779.367},"trace_dropped":false,"trace":"aps5-trace-7141b56717d8-2.json.gz"} {"commit":"7141b56717d8","dirty":false,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_FRAMES":"200:40"},"gpu":"NVIDIA GeForce RTX 3080","driver":"NVIDIA 615.78.08","os":"Linux 7.2.10-1-cachyos","resolution":"3840x2160","window":{"spec":"frames 200:40","first_present":200,"ms":62039.415},"presents":40,"frame_ms":{"p50":1546.925,"p90":1593.178,"p99":1618.618,"max":1618.618},"gpu_busy_ms_per_present":158.336,"worker_busy_pct":{"queue worker 0x0":99.973,"queue worker 0x20":97.707,"queue worker 0x28":98.620,"queue worker 0x30":98.616,"queue worker 0x38":97.712},"top_phases_ms_per_frame":{"Driver.Packet":7636.375,"Driver.Packet.memory_wait":5873.218,"Driver.Packet.draw":1478.977,"Driver.Draw":1478.760,"Driver.Draw.shader_compile_and_link":1110.349,"Shader.DrawStage":1095.407,"Shader.DrawStage.capture_resources":943.222,"Driver.Draw.draw_and_resource_release":357.749},"trace_dropped":false,"trace":"aps5-trace-7141b56717d8-2.json.gz"} {"commit":"7141b56717d8","dirty":false,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_FRAMES":"200:40"},"gpu":"NVIDIA GeForce RTX 3080","driver":"NVIDIA 615.78.08","os":"Linux 7.2.10-1-cachyos","resolution":"3840x2160","window":{"spec":"frames 200:40","first_present":200,"ms":62364.688},"presents":40,"frame_ms":{"p50":1560.970,"p90":1613.087,"p99":1644.182,"max":1644.182},"gpu_busy_ms_per_present":160.874,"worker_busy_pct":{"queue worker 0x0":99.974,"queue worker 0x20":97.500,"queue worker 0x38":97.519,"queue worker 0x28":98.506,"queue worker 0x30":98.503},"top_phases_ms_per_frame":{"Driver.Packet":7668.336,"Driver.Packet.memory_wait":5886.401,"Driver.Packet.draw":1485.632,"Driver.Draw":1485.405,"Driver.Draw.shader_compile_and_link":1112.668,"Shader.DrawStage":1095.616,"Shader.DrawStage.capture_resources":942.856,"Driver.Draw.draw_and_resource_release":361.708},"trace_dropped":false,"trace":"aps5-trace-7141b56717d8-2.json.gz"} {"commit":"91e399694be4","dirty":false,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_FRAMES":"200:40"},"gpu":"NVIDIA GeForce RTX 3080","driver":"NVIDIA 615.78.08","os":"Linux 7.2.10-1-cachyos","resolution":"3840x2160","window":{"spec":"frames 200:40","first_present":200,"ms":62183.827},"presents":40,"frame_ms":{"p50":1554.095,"p90":1591.655,"p99":1630.537,"max":1630.537},"gpu_busy_ms_per_present":163.514,"worker_busy_pct":{"queue worker 0x0":99.971,"queue worker 0x20":97.632,"queue worker 0x28":98.608,"queue worker 0x30":98.606,"queue worker 0x38":97.635},"top_phases_ms_per_frame":{"Driver.Packet":7653.412,"Driver.Packet.memory_wait":5908.576,"Driver.Packet.draw":1486.227,"Driver.Draw":1486.015,"Driver.Draw.shader_compile_and_link":1110.462,"Shader.DrawStage":1099.376,"Shader.DrawStage.capture_resources":943.954,"Driver.Draw.draw_and_resource_release":367.067},"trace_dropped":false,"trace":"aps5-trace-91e399694be4-2.json.gz"} {"commit":"91e399694be4","dirty":false,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_FRAMES":"200:40"},"gpu":"NVIDIA GeForce RTX 3080","driver":"NVIDIA 615.78.08","os":"Linux 7.2.10-1-cachyos","resolution":"3840x2160","window":{"spec":"frames 200:40","first_present":200,"ms":65669.167},"presents":40,"frame_ms":{"p50":1641.170,"p90":1688.472,"p99":1719.335,"max":1719.335},"gpu_busy_ms_per_present":159.693,"worker_busy_pct":{"queue worker 0x0":99.973,"queue worker 0x20":97.663,"queue worker 0x38":97.666,"queue worker 0x30":98.611,"queue worker 0x28":98.613},"top_phases_ms_per_frame":{"Driver.Packet":8082.924,"Driver.Packet.memory_wait":6239.263,"Driver.Packet.draw":1575.564,"Driver.Draw":1575.358,"Driver.Draw.shader_compile_and_link":1193.099,"Shader.DrawStage":1182.535,"Shader.DrawStage.capture_resources":1029.930,"Driver.Draw.draw_and_resource_release":372.720},"trace_dropped":false,"trace":"aps5-trace-91e399694be4-2.json.gz"} {"commit":"91e399694be4","dirty":false,"env":{"APS5_TRACE_DIR":"<path>","APS5_TRACE_FRAMES":"200:40"},"gpu":"NVIDIA GeForce RTX 3080","driver":"NVIDIA 615.78.08","os":"Linux 7.2.10-1-cachyos","resolution":"3840x2160","window":{"spec":"frames 200:40","first_present":200,"ms":62375.632},"presents":40,"frame_ms":{"p50":1552.708,"p90":1610.929,"p99":1629.742,"max":1629.742},"gpu_busy_ms_per_present":165.812,"worker_busy_pct":{"queue worker 0x0":99.973,"queue worker 0x20":97.544,"queue worker 0x28":98.513,"queue worker 0x38":97.548,"queue worker 0x30":98.511},"top_phases_ms_per_frame":{"Driver.Packet":7669.890,"Driver.Packet.memory_wait":5933.916,"Driver.Packet.draw":1490.126,"Driver.Draw":1489.903,"Driver.Draw.shader_compile_and_link":1109.717,"Shader.DrawStage":1104.190,"Shader.DrawStage.capture_resources":948.091,"Driver.Draw.draw_and_resource_release":368.592},"trace_dropped":false,"trace":"aps5-trace-91e399694be4-2.json.gz"} ``` ### 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 - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's technical debt file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Unblocks: none - [x] GPUs tested: NVIDIA RTX 3080, driver 615.78.08, CachyOS Linux 7.2.10; lavapipe (Mesa 26.2.4, LLVM 23.1.1), Arch Linux container - [x] AI-assisted: yes (Claude Code) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
SleglJan commented 2026-10-15 12:47:58 +00:00 (Migrated from github.com)
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6192423578 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6346#issuecomment-6192423578). Originally posted by [SleglJan](https://github.com/SleglJan) on 2026-10-15T12:47:58Z. --- [aps5-trace-A1.json.gz](https://github.com/user-attachments/files/33493097/aps5-trace-A1.json.gz) [aps5-trace-A2.json.gz](https://github.com/user-attachments/files/33493099/aps5-trace-A2.json.gz) [aps5-trace-A3.json.gz](https://github.com/user-attachments/files/33493101/aps5-trace-A3.json.gz) [aps5-trace-B1.json.gz](https://github.com/user-attachments/files/33493102/aps5-trace-B1.json.gz) [aps5-trace-B2.json.gz](https://github.com/user-attachments/files/33493105/aps5-trace-B2.json.gz) [aps5-trace-B3.json.gz](https://github.com/user-attachments/files/33493106/aps5-trace-B3.json.gz)
github-actions[bot] commented 2026-10-15 12:49:25 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-15T12:49:25Z.


Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.

Pull request Conflicting files (lines on main) Same exports Same new files
PR 6759 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp L1146-1147
PR 7233 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp L1661-1687
core/libs/prx/libSceAgcDriver/tests/WriteTracking.cpp L200, L1106
PR 7371 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp L1661-1687
core/libs/prx/libSceAgcDriver/tests/WriteTracking.cpp L200, L1106

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

Pull request Shared files not compared
PR 4448 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
PR 5021 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
PR 6185 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
PR 6186 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
PR 6188 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
PR 6192 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
PR 6273 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
core/libs/prx/libSceAgcDriver/tests/WriteTracking.cpp
PR 6615 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
PR 6701 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
core/libs/prx/libSceAgcDriver/tests/WriteTracking.cpp
PR 6926 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
PR 6946 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
PR 6947 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
PR 7201 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
core/libs/prx/libSceAgcDriver/tests/WriteTracking.cpp
PR 7332 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
core/libs/prx/libSceAgcDriver/tests/WriteTracking.cpp
PR 7432 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
core/libs/prx/libSceAgcDriver/tests/WriteTracking.cpp
PR 7505 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
core/libs/prx/libSceAgcDriver/tests/WriteTracking.cpp
PR 7604 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
core/libs/prx/libSceAgcDriver/tests/WriteTracking.cpp
PR 7615 core/libs/prx/libSceAgcDriver/tests/WriteTracking.cpp
PR 7642 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
PR 7687 core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp
core/libs/prx/libSceAgcDriver/tests/WriteTracking.cpp
<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6192450051 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6346#issuecomment-6192450051). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-10-15T12:49:25Z. --- <!-- pr-overlap --> Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in **Depends on**. | Pull request | Conflicting files (lines on `main`) | Same exports | Same new files | |---|---|---|---| | [PR 6759](https://www.github.com/boykopovar/AnyPS5/pull/6759) | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` [L1146-1147](https://github.com/boykopovar/AnyPS5/blob/84c1a4d9a26429cb483ec963195cff8ef25d128b/core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp#L1146-L1147) | | | | [PR 7233](https://www.github.com/boykopovar/AnyPS5/pull/7233) | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` [L1661-1687](https://github.com/boykopovar/AnyPS5/blob/84c1a4d9a26429cb483ec963195cff8ef25d128b/core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp#L1661-L1687)<br>`core/libs/prx/libSceAgcDriver/tests/WriteTracking.cpp` [L200](https://github.com/boykopovar/AnyPS5/blob/84c1a4d9a26429cb483ec963195cff8ef25d128b/core/libs/prx/libSceAgcDriver/tests/WriteTracking.cpp#L200), [L1106](https://github.com/boykopovar/AnyPS5/blob/84c1a4d9a26429cb483ec963195cff8ef25d128b/core/libs/prx/libSceAgcDriver/tests/WriteTracking.cpp#L1106) | | | | [PR 7371](https://www.github.com/boykopovar/AnyPS5/pull/7371) | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` [L1661-1687](https://github.com/boykopovar/AnyPS5/blob/84c1a4d9a26429cb483ec963195cff8ef25d128b/core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp#L1661-L1687)<br>`core/libs/prx/libSceAgcDriver/tests/WriteTracking.cpp` [L200](https://github.com/boykopovar/AnyPS5/blob/84c1a4d9a26429cb483ec963195cff8ef25d128b/core/libs/prx/libSceAgcDriver/tests/WriteTracking.cpp#L200), [L1106](https://github.com/boykopovar/AnyPS5/blob/84c1a4d9a26429cb483ec963195cff8ef25d128b/core/libs/prx/libSceAgcDriver/tests/WriteTracking.cpp#L1106) | | | Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap. | Pull request | Shared files not compared | |---|---| | [PR 4448](https://www.github.com/boykopovar/AnyPS5/pull/4448) | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | [PR 5021](https://www.github.com/boykopovar/AnyPS5/pull/5021) | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | [PR 6185](https://www.github.com/boykopovar/AnyPS5/pull/6185) | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | [PR 6186](https://www.github.com/boykopovar/AnyPS5/pull/6186) | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | [PR 6188](https://www.github.com/boykopovar/AnyPS5/pull/6188) | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | [PR 6192](https://www.github.com/boykopovar/AnyPS5/pull/6192) | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | [PR 6273](https://www.github.com/boykopovar/AnyPS5/pull/6273) | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/WriteTracking.cpp` | | [PR 6615](https://www.github.com/boykopovar/AnyPS5/pull/6615) | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | [PR 6701](https://www.github.com/boykopovar/AnyPS5/pull/6701) | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/WriteTracking.cpp` | | [PR 6926](https://www.github.com/boykopovar/AnyPS5/pull/6926) | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | [PR 6946](https://www.github.com/boykopovar/AnyPS5/pull/6946) | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | [PR 6947](https://www.github.com/boykopovar/AnyPS5/pull/6947) | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | [PR 7201](https://www.github.com/boykopovar/AnyPS5/pull/7201) | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/WriteTracking.cpp` | | [PR 7332](https://www.github.com/boykopovar/AnyPS5/pull/7332) | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/WriteTracking.cpp` | | [PR 7432](https://www.github.com/boykopovar/AnyPS5/pull/7432) | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/WriteTracking.cpp` | | [PR 7505](https://www.github.com/boykopovar/AnyPS5/pull/7505) | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/WriteTracking.cpp` | | [PR 7604](https://www.github.com/boykopovar/AnyPS5/pull/7604) | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/WriteTracking.cpp` | | [PR 7615](https://www.github.com/boykopovar/AnyPS5/pull/7615) | `core/libs/prx/libSceAgcDriver/tests/WriteTracking.cpp` | | [PR 7642](https://www.github.com/boykopovar/AnyPS5/pull/7642) | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp` | | [PR 7687](https://www.github.com/boykopovar/AnyPS5/pull/7687) | `core/libs/prx/libSceAgcDriver/Execution/src/GuestMemory.cpp`<br>`core/libs/prx/libSceAgcDriver/tests/WriteTracking.cpp` |
simonbbby commented 2026-10-15 14:24:30 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by simonbbby on 2026-10-15T14:24:30Z.


Independent CPU correctness check at exact head c128308d4053faa60b6eaa617e5ea314841980de, Ubuntu 24.04 / kernel 7.0.0-38 / GCC 13.3 / Ryzen 9 9950X, with real Linux write watching.

The unchanged WriteTracking.cpp, linked directly with the production GuestMemory.cpp, GuestAllocations.cpp, GuestArena.cpp and GuestWriteWatch.cpp, passes 3/3. Replacing only GuestMemory.cpp with HEAD^ makes that same test fail 3/3 at stores beside the range in its 64 KiB block count for it. No tracker or write-watch implementation was mocked. Standalone build: C++20, -O2 -pthread -msse4.2, function/data sections and linker garbage collection; this bypasses our unrelated SDL/XRandR configure blocker.

I also ran an external history oracle to vary the offsets beyond the fixed offsets in CheckVersionRanges:

  • 16 watched 64 KiB blocks; 2,048 events per seed. Interleaved CPU writes followed by CollectWritesUncached (modeled at page granularity), whole-block MarkWritten, variable-length MarkWritten spanning up to two blocks, and actual StoreOwnBytes writes up to 8,193 bytes. Starts and queries vary across page/block boundaries.
  • After each event: 36 single-range queries against randomly selected prior generation checkpoints and 12 three-range batches. An event list independently checks that no query reports unchanged over a newer write. Conservative changed answers are allowed within blocks with newer events; blocks with no newer event must remain unchanged. Batches must equal the conjunction of their single queries.
  • Seeds 6346, 1, 0xdeadbeef, 0x61387a29, 0xffffffffffffffff: 368,640 single queries and 122,880 batches pass. There were 22,147 unchanged answers, so this did not pass by returning changed for everything. Write-watch availability and nonzero collection results are hard requirements, not skips.
  • Sensitivity controls, changing only scratch production copies: omitting the whole-block generation (entry.whole = 0) is caught at step 1; forgetting overwritten pieces (entry.dropped = 0) is caught at step 33, both with seed 6346 and unsafe unchanged diagnostics. The untouched PR stock test and oracle pass again afterward; the worktree stays clean.

Scope: sequential CPU tracker correctness after dirty-page collection. This does not check concurrent renderer interactions, Windows private mappings, GPU execution, or the reported title performance; no FPS claim.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6194408963 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6346#issuecomment-6194408963). Originally posted by [simonbbby](https://github.com/simonbbby) on 2026-10-15T14:24:30Z. --- Independent CPU correctness check at exact head `c128308d4053faa60b6eaa617e5ea314841980de`, Ubuntu 24.04 / kernel 7.0.0-38 / GCC 13.3 / Ryzen 9 9950X, with real Linux write watching. The unchanged `WriteTracking.cpp`, linked directly with the production `GuestMemory.cpp`, `GuestAllocations.cpp`, `GuestArena.cpp` and `GuestWriteWatch.cpp`, passes **3/3**. Replacing only `GuestMemory.cpp` with `HEAD^` makes that same test fail **3/3** at `stores beside the range in its 64 KiB block count for it`. No tracker or write-watch implementation was mocked. Standalone build: C++20, `-O2 -pthread -msse4.2`, function/data sections and linker garbage collection; this bypasses our unrelated SDL/XRandR configure blocker. I also ran an external history oracle to vary the offsets beyond the fixed offsets in `CheckVersionRanges`: - 16 watched 64 KiB blocks; 2,048 events per seed. Interleaved CPU writes followed by `CollectWritesUncached` (modeled at page granularity), whole-block `MarkWritten`, variable-length `MarkWritten` spanning up to two blocks, and actual `StoreOwnBytes` writes up to 8,193 bytes. Starts and queries vary across page/block boundaries. - After each event: 36 single-range queries against randomly selected prior generation checkpoints and 12 three-range batches. An event list independently checks that no query reports unchanged over a newer write. Conservative changed answers are allowed within blocks with newer events; blocks with no newer event must remain unchanged. Batches must equal the conjunction of their single queries. - Seeds `6346`, `1`, `0xdeadbeef`, `0x61387a29`, `0xffffffffffffffff`: **368,640 single queries and 122,880 batches pass**. There were 22,147 unchanged answers, so this did not pass by returning changed for everything. Write-watch availability and nonzero collection results are hard requirements, not skips. - Sensitivity controls, changing only scratch production copies: omitting the whole-block generation (`entry.whole = 0`) is caught at step 1; forgetting overwritten pieces (`entry.dropped = 0`) is caught at step 33, both with seed 6346 and `unsafe unchanged` diagnostics. The untouched PR stock test and oracle pass again afterward; the worktree stays clean. Scope: sequential CPU tracker correctness after dirty-page collection. This does not check concurrent renderer interactions, Windows private mappings, GPU execution, or the reported title performance; no FPS claim.
SleglJan commented 2026-10-15 15:07:56 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by SleglJan on 2026-10-15T15:07:56Z.


Rebased onto main 0e4ea13a0 after #5554 merged, and force-pushed as 5532d51fb.

#5554 added StoredAllSince, a proof that driver stores covered every byte of a range. To keep it exact, the walk after an own store no longer records its dirty runs as driver pieces. It stamps them in a page map of its own:

  • the unchanged proofs count those pages;
  • StoredOver counts them only in a block without driver pieces; where pieces exist it answers as on main;
  • they take no driver-piece slot and do not count for StoredAllSince.

On Windows, a private mapping made over a block with driver pieces marks them as forgotten instead of dropping them; a block without pieces gets no entry.

New checks in CheckSharedBlockProofs cover StoredAllSince after own stores and a neighbour in the page of an own store. #5554's CheckStoredAllSince passes unchanged.

RTX 3080 (NVIDIA 615.78.08), on 0e4ea13a0: ctest -R '^agc', 593 tests, 1 failure, agc_driver_store_over_untracked, which fails the same way on main 3ee537191 (see #5671). agc_write_tracking fails without the GuestMemory.cpp change and passes with it.

@simonbbby, thanks for the check at c128308d4. New since that head: the page map, and on Windows existing pieces are marked forgotten instead of every block being marked stored whole. The merge of touching same-generation pieces is gone, and the whole-block entry now comes from #5554.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6195339390 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6346#issuecomment-6195339390). Originally posted by [SleglJan](https://github.com/SleglJan) on 2026-10-15T15:07:56Z. --- Rebased onto `main` 0e4ea13a0 after #5554 merged, and force-pushed as 5532d51fb. #5554 added `StoredAllSince`, a proof that driver stores covered every byte of a range. To keep it exact, the walk after an own store no longer records its dirty runs as driver pieces. It stamps them in a page map of its own: - the unchanged proofs count those pages; - `StoredOver` counts them only in a block without driver pieces; where pieces exist it answers as on `main`; - they take no driver-piece slot and do not count for `StoredAllSince`. On Windows, a private mapping made over a block with driver pieces marks them as forgotten instead of dropping them; a block without pieces gets no entry. New checks in `CheckSharedBlockProofs` cover `StoredAllSince` after own stores and a neighbour in the page of an own store. #5554's `CheckStoredAllSince` passes unchanged. RTX 3080 (NVIDIA 615.78.08), on 0e4ea13a0: `ctest -R '^agc'`, 593 tests, 1 failure, `agc_driver_store_over_untracked`, which fails the same way on `main` 3ee537191 (see #5671). `agc_write_tracking` fails without the GuestMemory.cpp change and passes with it. @simonbbby, thanks for the check at c128308d4. New since that head: the page map, and on Windows existing pieces are marked forgotten instead of every block being marked stored whole. The merge of touching same-generation pieces is gone, and the whole-block entry now comes from #5554. AI-assisted: yes (Claude Code)
simonbbby commented 2026-10-15 16:23:50 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by simonbbby on 2026-10-15T16:23:50Z.


Retested the changed page-map semantics at 5532d51fb80902de94501f3e0f360c94f5553ca1; my earlier result remains pinned to c128308d4.

Same Ubuntu 24.04 / kernel 7.0.0-38 / GCC 13.3 / Ryzen 9 9950X setup, standalone production CPU objects and real Linux write watching:

  • Unchanged current WriteTracking.cpp: 3/3 pass, including CheckStoredAllSince and the new own-store/neighbor checks. Substituting only current HEAD^'s GuestMemory.cpp fails 3/3 at the shared-block proof assertion.
  • Repeated the five seeded variable-offset histories from my previous comment, now also checking every positive StoredAllSince answer against a separately sorted union of newer driver intervals. CPU-only page events are excluded from that union. Conservative false answers remain allowed when history has been discarded.
  • 368,640 single-range queries, 122,880 batches, and 368,640 complete-coverage queries pass. Of the latter, 290,532 returned true and every one had full driver-byte coverage in the independent history. There were 22,837 unchanged answers; batches agree with singles.
  • Sensitivity: routing the own-store dirty walk back into driver pieces in a scratch production copy fails the stock test at one dword store proves complete surface coverage; the independent oracle also rejects it at step 8 with an unsafe complete coverage diagnostic. Omitting the new noteWalkStore call fails the stock test at a guest store beside a driver store in its page during the store is not seen. That neighbor-write case is covered by the stock fixture; the external oracle's own-store events model the declared store spans.

This covers the important separation: dirty pages can invalidate an unchanged proof without claiming that the driver stored every byte on those pages. No repository source was changed. Scope remains sequential Linux CPU tracking after collection; Windows private mappings, concurrent renderer interactions, GPU execution and title performance were not tested.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6196924918 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6346#issuecomment-6196924918). Originally posted by [simonbbby](https://github.com/simonbbby) on 2026-10-15T16:23:50Z. --- Retested the changed page-map semantics at **`5532d51fb80902de94501f3e0f360c94f5553ca1`**; my earlier result remains pinned to `c128308d4`. Same Ubuntu 24.04 / kernel 7.0.0-38 / GCC 13.3 / Ryzen 9 9950X setup, standalone production CPU objects and real Linux write watching: - Unchanged current `WriteTracking.cpp`: **3/3 pass**, including `CheckStoredAllSince` and the new own-store/neighbor checks. Substituting only current `HEAD^`'s `GuestMemory.cpp` fails **3/3** at the shared-block proof assertion. - Repeated the five seeded variable-offset histories from my previous comment, now also checking every positive `StoredAllSince` answer against a separately sorted union of newer **driver** intervals. CPU-only page events are excluded from that union. Conservative false answers remain allowed when history has been discarded. - **368,640 single-range queries, 122,880 batches, and 368,640 complete-coverage queries pass.** Of the latter, 290,532 returned true and every one had full driver-byte coverage in the independent history. There were 22,837 unchanged answers; batches agree with singles. - Sensitivity: routing the own-store dirty walk back into driver pieces in a scratch production copy fails the stock test at `one dword store proves complete surface coverage`; the independent oracle also rejects it at step 8 with an `unsafe complete coverage` diagnostic. Omitting the new `noteWalkStore` call fails the stock test at `a guest store beside a driver store in its page during the store is not seen`. That neighbor-write case is covered by the stock fixture; the external oracle's own-store events model the declared store spans. This covers the important separation: dirty pages can invalidate an unchanged proof without claiming that the driver stored every byte on those pages. No repository source was changed. Scope remains sequential Linux CPU tracking after collection; Windows private mappings, concurrent renderer interactions, GPU execution and title performance were not tested.
Scramblrrrr commented 2026-10-16 18:03:14 +00:00 (Migrated from github.com)

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


Windows/RTX5070Ti617.42 combined cross-test is ready at51b148e100509891c9b194da360e6dd80bdeb16b: https://github.com/Scramblrrrr/AnyPS5/tree/codex/first-light-watch-proof-current . Includes #6346 5532d51fb and #6273 fdcbb838d, on main93e54cedd plus our explicitly listed007/shared-table/level prerequisites. Both author commits applied cleanly; no replacement implementation.

30/30 selected native CPU/Vulkan checks PASS14.19s, no skips, including write_tracking's new cases, repeated-neighbour stores, image-table reuse/bounds, shared-table vouches, draw reuse/verify/inline, storage flush ordering, tessellation, serializer/cache and prebuild unset/0/1. Conventions clean. After final revision-string rebuild,5/5 related controlsPASS1.46s. Combined native evidence, not standalone each-PR evidence; no title FPS result yet.

Integration test adjustment: the a driver store over an entry case now counts2reuse/1resolution across its two dispatches, instead of1/1. With the finer range proof, clean siblings are reused even on the dispatch that rebuilds the changed entry. Both texel checks retained; no production proof weakened. #6273's CpuWriteResolutions=1 is retained. All other current #6340 expectations pass unchanged.

There is also an opt-in bounded copied-buffer ownership sampler in this test branch (maximum25small records per process, no game contents). Its initial asynchronous output triggered a native process-exit timeout; sampler-off control passed, and switching it to the existing direct trace sink made all3prebuild policies pass with sampling on. That defect was mine, not attributed to either PR. The full native result above has sampling enabled after the correction. Starting a guarded007 cross-test next. AI-assisted: Codex; raw title data local.

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6221663305 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/6346#issuecomment-6221663305). Originally posted by [Scramblrrrr](https://github.com/Scramblrrrr) on 2026-10-16T18:03:14Z. --- Windows/RTX5070Ti617.42 combined cross-test is ready at51b148e100509891c9b194da360e6dd80bdeb16b: https://github.com/Scramblrrrr/AnyPS5/tree/codex/first-light-watch-proof-current . Includes #6346 5532d51fb and #6273 fdcbb838d, on main93e54cedd plus our explicitly listed007/shared-table/level prerequisites. Both author commits applied cleanly; no replacement implementation. 30/30 selected native CPU/Vulkan checks PASS14.19s, no skips, including write_tracking's new cases, repeated-neighbour stores, image-table reuse/bounds, shared-table vouches, draw reuse/verify/inline, storage flush ordering, tessellation, serializer/cache and prebuild unset/0/1. Conventions clean. After final revision-string rebuild,5/5 related controlsPASS1.46s. Combined native evidence, not standalone each-PR evidence; no title FPS result yet. Integration test adjustment: the `a driver store over an entry` case now counts2reuse/1resolution across its two dispatches, instead of1/1. With the finer range proof, clean siblings are reused even on the dispatch that rebuilds the changed entry. Both texel checks retained; no production proof weakened. #6273's CpuWriteResolutions=1 is retained. All other current #6340 expectations pass unchanged. There is also an opt-in bounded copied-buffer ownership sampler in this test branch (maximum25small records per process, no game contents). Its initial asynchronous output triggered a native process-exit timeout; sampler-off control passed, and switching it to the existing direct trace sink made all3prebuild policies pass with sampling on. That defect was mine, not attributed to either PR. The full native result above has sampling enabled after the correction. Starting a guarded007 cross-test next. AI-assisted: Codex; raw title data local.
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!6346
No description provided.