perf(agc): keep an untracked fast proof across collect epochs on Windows while its write-watch hint has not moved #12921

Closed
EagleBearerYS wants to merge 15 commits from upstream-pr/12921 into main
EagleBearerYS commented 2026-10-29 14:23:15 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by EagleBearerYS on 2026-10-29T14:23:15Z.


What

Windows only in effect. Write-watch hints exist only on Windows (GuestMemory::UntrackedHint returns 0 on other platforms), so on Linux this changes nothing: every untracked proof keeps #6192's epoch stamp.

#6192 lets a fast revalidation over untracked memory accept a surface by its stamp until the next ordering point: the stamp is {collect epoch, NewestStamp, ForgetStamp, write note}. In Resident Evil Village (PPSA01556)'s static menu, collect epochs advance about 80 times a second, so most of those proofs expire before they're reused, and the next one walks the full table again.

On Windows, an unwatched range has a write-watch hint (GuestMemory::UntrackedHint), and a store into it moves the hint at the next walk of that page's marks. The check runs that walk itself: UntrackedHint reads and resets the range's marks (walkHints) unless this thread already walked the range in the current collect epoch. This change keeps a proof across epochs while the hint hasn't moved.

  • A hinted range's stamp is {hint, NewestStamp, ForgetStamp, write note, 1}. Every field is taken just before the bytes the proof stands on are read or compared, not when the proof is captured:
    • snapshots: main's untrackedKey, carried in the lookup record (LookupRecord::untracked);
    • views and storage images: the stamp of the image's last equal compare in StorageTexture::compareUntracked, through StorageTexture::HintedComparison.
  • Why a racing store is never absorbed: a CPU store after the read leaves a write-watch mark, and the next hint walk stamps a hint newer than the recorded one. A driver store moves NewestStamp, a forget moves ForgetStamp, and a new recorded GPU write moves the note. So at the next ordering point the check walks again.
    • Within an epoch, the hint is memoized, which is #6192's in-epoch acceptance, unchanged.
    • Sampling at capture instead would be wrong: the memo can already include a store made after the compare. The test's last control covers that.
  • Unhinted ranges (Linux, shared pages, host regions) keep #6192's epoch stamp. The last field keeps the two kinds apart, and both forms are refused while a forget is in progress.
  • APS5_VERIFY_UNTRACKED_PROOFS=1 still cross-checks every fast proof that used an untracked stamp, hinted or epoch, with the full walk.
  • Known cost: a new storage image has no hinted entry until its first equal compare, so its first proof across an ordering point walks once.

The branch. It holds #6192's four commits unchanged (with #6187 under them), then four of ours:

  1. A merge of main. #6192 conflicts with current main in Texture.cpp (main's per-range comparedRanges memo kept, with #6187's ForgetStamp in place of ForgetSerial), ShaderResources.cpp (main's LastRecordIndices, GenerationFor and depth guard kept, with the untracked stamps added) and CMakeLists.txt (the Windows test list).
  2. The ENVIRONMENT.md row for APS5_VERIFY_UNTRACKED_PROOFS, which main's conventions check requires.
  3. agc_untracked_forget's teardown fix, offered on #6187: the test freed its detiler while a recorded dispatch still used its pipeline, which crashed lavapipe's queue thread. It's test-only.
  4. The hint key and its test.

Overlap: checked with git merge-tree against each pull request the overlap comment lists, at head fdc70046f8.

  • #14261 and #14262 (oneandonlydean) carry #6187 and #6192 forward on current main: the same four commits of TheAggie's, rebased and kept under TheAggie's name, with oneandonlydean's test fixes. This PR carries the original commits. Once #14262 lands, this PR's next merge of main takes their changes from main, and this PR's diff is then only its hinted stamp.
  • #6108 (Gashrod1) adds GuestSnapshots() where this PR adds HintedComparison(), in Texture.hpp and Texture.cpp. The clash is textual only: whichever lands second keeps both.
  • #12575 (QRMOE, draft) rewrites cachedTexture's sampled-cache hit branch as a per-entry check. This PR adds one argument in that branch: the untracked proof's key, passed to logLookup. QRMOE agreed in #12575's thread that this PR goes first, and carries its logLookup argument into the per-entry form when #12575 is rebased (comment).
  • #6182 and #9875 (CMakeLists.txt), and #10894 (ShaderResources.cpp), conflict with #6192's commits, which this PR carries. The conflicting hunks are the same with #6192's head merged with main, and this PR's own lines don't touch them, so their order follows #6192's. #11550 has merged, and 31dff937b5 merges it (Tested).
  • #12378 (BunnyFl), which merges cleanly with this branch, excludes only an import's own pages from the write watch and settles partial-block imports in the background. Ranges it keeps watched never become untracked; this change covers the ones that stay unwatched.
  • #11602 (XatiX), which merges cleanly too, keys DepthSurface's HTILE clear check of untracked memory on the same UntrackedHint. It's a different consumer of the same hint.

Resident Evil Village (PPSA01556)

Static menu, one block of four unprofiled runs, B A A B.

  • The arms: A is main 319621ba2e plus #11580 and #10304, with a local scePadOpen answer for port types 3 and 4 (103015a9ca). B is the same tree plus #6192's four commits and this PR's commit (24b56bc1b4: the same added and removed lines as this head, apart from the agc_untracked_forget teardown fix, which only changes a test). So the pair measures #6192 and this PR together; #6192 alone wasn't run.
  • The env, in both: APS5_LAZY_SHADER_PREPARE=1 APS5_NO_GPL=1 APS5_HOST_IMPORT_MIB=6400 APS5_TRACE_SUMMARY_EVERY=10, with scripted pad input. The change has no switch, so nothing else differs.
  • The machine: NVIDIA GeForce RTX 3070 Laptop GPU (617.42), Ryzen 9 5900HS, Windows 10.0.26300, 3840x2160 output.
    • The shader cache was warm, with the same key in all four runs (0 misses).
    • GPU clocks weren't held: P0 at 98-99 %, 1,435-1,459 MHz, since the menu is CPU-bound.
  • The figure: presents per second over menu +5..15 minutes.
run fps frame p50 / p90 (s)
B 0.691 1.36 / 1.76
A 0.513 1.71 / 2.25
A 0.657 1.47 / 1.80
B 0.829 1.18 / 1.39
  • Means: B 0.760 and A 0.585, +29.9 %. B's mean is 15.7 % above A's best run, and B is ahead in both same-phase pairs, by +34.8 % and +26.2 %.
  • Spreads: A's own spread is 24.7 %, because its first run slowed from 0.69 to 0.35 fps at +11-13 min. B's is 18.2 %.
  • Phases, B against A, ms per frame: Driver.Packet 3,926 / 3,368 against 4,944 / 4,253, about 21 % lower. Driver.Packet.memory_wait 2,277 / 1,943 against 2,898 / 2,482. Graphics.Draw 782 / 689 against 1,056 / 907.
  • Health: no aborts and no failed host imports in any run.
  • Where it comes from, in one profiled boot of each tree (APS5_PROFILE_DRAW=1; menu +10..15, 31 ten-second [rescache] blocks):
    • On A, 15,396 fast proofs failed at the collect check, and each one took a full walk.
    • With this change, none failed there. Fast proofs that failed for any reason fell from 18,279 to 6,033. Some of the proofs that used to stop at the collect check now get as far as the pending-image check, so its count rose from 2,698 to 5,804.
    • Not compared: the B boot also ran with APS5_VERIFY_UNTRACKED_PROOFS=1, so its revalidation time includes the self-check's extra full walks.
    • Overlap with #12745: its write index removes the same collect-check failures by another route, a proof that doesn't collect per element (0 in its profiled boot, same window). On this menu the two PRs address the same full walks.
      • Together (one block, B A A B, unprofiled, menu +5..15):
        • B: fork diag/village-combined-on-103015a9ca c9cff8c839, the A tree above plus #12478, #12745 and #12921, run with APS5_TABLE_INDEX=1.
        • fps: B ran 0.711 and 0.778 against A's 0.497 and 0.495, +50.0 %.
          • B led both same-phase pairs, by +42.8 % and +57.1 %.
          • B's slower run is 42.9 % above A's faster one.
        • Driver.Packet per frame: 3,822 and 3,568 ms against 5,187 and 5,301 ms. memory_wait: 2,199 and 2,032 ms against 3,090 and 3,167 ms.
        • Read the ratio, not the fps: A ran slower in this block than in the pair above, 0.50 against 0.51 and 0.66.
        • The total is below the two gains added (#12745's +25 % and #12921's +29.9 %), although B also carries #12478, because both PRs remove the same full walks.
      • Tests with both PRs in and APS5_TABLE_INDEX=1:
        • The failure: two of #12921's path assertions, in agc_untracked_revalidate and agc_untracked_hint_proof, expect a full walk after a collect epoch. The index proves those draws by looking the elements up again, which re-reads the memory, so the content still follows every store.
        • Unaffected: with the switch off (the default), nothing fails.
        • The fix: a test-only update for whichever PR merges second is ready, as one commit with the same patch-id on two branches:
        • What it accepts: a fast proof only when the image versions moved the way guest memory did.
        • Red/green (Linux, lavapipe), result:
          • both tests fail 10 of 10 on the merge without it, and pass 10 of 10 with it, off and on;
          • ctest -R '^agc' gives 1,048 passed, 73 skipped and 0 failed in both modes.
Summary lines at menu +10 of the first B and A runs (B 07f624d854, A 103015a9ca). Each row is one 10 s interval, so its frame times aren't the window's figures above.
{"commit":"07f624d854fb","dirty":false,"env":{"APS5_HOST_IMPORT_MIB":"6400","APS5_LAZY_SHADER_PREPARE":"1","APS5_NO_GPL":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_SUMMARY_EVERY":"10"},"gpu":"NVIDIA GeForce RTX 3070 Laptop GPU","driver":"NVIDIA 617.42","os":"Windows 10.0.26300","cpu":"AMD Ryzen 9 5900HS with Radeon Graphics","cpu_threads":16,"memory_mib":15776,"title_id":"PPSA01556","title":"Resident Evil Village","content_version":"01.210.000","resolution":"3840x2160","window":{"spec":"summary_every 10","first_present":1605,"ms":10237.489},"interval_start_s":836.978,"interval_end_s":847.215,"presents":6,"frame_ms":{"p50":1738.099,"p90":2336.798,"p99":2336.798,"max":2336.798},"gpu_busy_ms_per_present":243.520,"worker_busy_pct":{"queue worker 0x0":99.570,"queue worker 0x38":0.112,"queue worker 0x20":89.391,"queue worker 0x28":94.215},"top_phases_ms_per_frame":{"Driver.Packet":4828.637,"Driver.Packet.memory_wait":2822.733,"Driver.Packet.draw":1269.158,"Driver.Draw":1267.783,"Graphics.Draw":996.479,"Graphics.Draw.draw_and_resource_release":970.327,"Driver.Packet.dispatch":693.763,"Driver.Dispatch":639.245},"trace_dropped":false,"trace":""}
{"commit":"103015a9ca66","dirty":false,"env":{"APS5_HOST_IMPORT_MIB":"6400","APS5_LAZY_SHADER_PREPARE":"1","APS5_NO_GPL":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_SUMMARY_EVERY":"10"},"gpu":"NVIDIA GeForce RTX 3070 Laptop GPU","driver":"NVIDIA 617.42","os":"Windows 10.0.26300","cpu":"AMD Ryzen 9 5900HS with Radeon Graphics","cpu_threads":16,"memory_mib":15776,"title_id":"PPSA01556","title":"Resident Evil Village","content_version":"01.210.000","resolution":"3840x2160","window":{"spec":"summary_every 10","first_present":3369,"ms":11746.745},"interval_start_s":979.116,"interval_end_s":990.863,"presents":6,"frame_ms":{"p50":2124.387,"p90":2317.005,"p99":2317.005,"max":2317.005},"gpu_busy_ms_per_present":285.700,"worker_busy_pct":{"queue worker 0x0":99.617,"queue worker 0x38":0.114,"queue worker 0x20":90.888,"queue worker 0x28":95.018},"top_phases_ms_per_frame":{"Driver.Packet":5590.476,"Driver.Packet.memory_wait":3348.407,"Driver.Packet.draw":1541.600,"Driver.Draw":1540.185,"Graphics.Draw":1190.041,"Graphics.Draw.draw_and_resource_release":1161.247,"Driver.Packet.dispatch":661.397,"Driver.Dispatch":602.462},"trace_dropped":false,"trace":""}
  • Traces: one 30 s capture of each arm, menu +10.3-10.5 min, with APS5_TRACE_SECONDS=960:30 and no other trace or profile switch:
    • A: aps5-trace-103015a9ca66-33724.json.gz, 2,419,643 bytes, sha256 16eab88b27f0843a5aa46433a83dbb69cc1fd960ff2a521acade7d20b52fb809;
    • B: aps5-trace-07f624d854fb-36204.json.gz, 2,161,932 bytes, sha256 bb08a9ac103f778937429c3ead8343ed6b3e87b6abf7bc7ff8c471b125913f0b.
    • A single 30 s window per arm is too short to compare speed (frame p50 1.50 s for A, 1.44 s for B). The comparison is the four unprofiled runs above.
    • GPU clocks weren't held: P0 98 %, mean 1,420-1,425 MHz.
trace_digest.py of A (103015a9ca)

seconds 960:30 from present 2901: 21 presents, frame p50 1497.6 / p90 1783.2 / p99 1903.7 / max 1903.7 ms, GPU busy 230.6 ms per present
NVIDIA GeForce RTX 3070 Laptop GPU, NVIDIA 617.42, Windows 10.0.26300, 3840x2160, commit 103015a9ca66, dropped: no

{"commit":"103015a9ca66","dirty":false,"env":{"APS5_HOST_IMPORT_MIB":"6400","APS5_LAZY_SHADER_PREPARE":"1","APS5_NO_GPL":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_SECONDS":"960:30"},"gpu":"NVIDIA GeForce RTX 3070 Laptop GPU","driver":"NVIDIA 617.42","os":"Windows 10.0.26300","cpu":"AMD Ryzen 9 5900HS with Radeon Graphics","cpu_threads":16,"memory_mib":15776,"title_id":"PPSA01556","title":"Resident Evil Village","content_version":"01.210.000","resolution":"3840x2160","window":{"spec":"seconds 960:30","first_present":2901,"ms":31778.408},"presents":21,"frame_ms":{"p50":1497.603,"p90":1783.23,"p99":1903.699,"max":1903.699},"gpu_busy_ms_per_present":230.559,"worker_busy_pct":{"queue worker 0x0":99.554,"queue worker 0x38":0.057,"queue worker 0x28":93.25,"queue worker 0x20":89.065},"top_phases_ms_per_frame":{"Driver.Packet":4261.674,"Driver.Packet.memory_wait":2505.215,"Driver.Packet.draw":1156.599,"Driver.Draw":1155.503,"Graphics.Draw":928.353,"Graphics.Draw.draw_and_resource_release":907.06,"Driver.Packet.dispatch":560.368,"Driver.Dispatch":510.148},"trace_dropped":false,"trace":"aps5-trace-103015a9ca66-33724.json.gz"}

Slowest frames (largest slices inside each, inclusive)

  • present 2907: 1903.7 ms at 9350 ms: Driver.WorkerWait (queue worker 0x38) 1903.0, Driver.WorkerWait.dequeue_order (queue worker 0x38) 1897.0, Driver.Packet (queue worker 0x0) 1885.3, Driver.Packet (queue worker 0x28) 1785.2
  • present 2908: 1831.4 ms at 11253 ms: Driver.WorkerWait (queue worker 0x38) 1828.9, Driver.WorkerWait.dequeue_order (queue worker 0x38) 1818.7, Driver.Packet (queue worker 0x0) 1812.5, Driver.Packet (queue worker 0x28) 1746.7
  • present 2921: 1783.2 ms at 29995 ms: Driver.Packet (queue worker 0x0) 1764.7, Driver.Packet (queue worker 0x28) 1682.4, Driver.Packet.memory_wait (queue worker 0x28) 1663.5, Driver.Packet (queue worker 0x20) 1600.6
  • present 2901: 1750.5 ms at 0 ms: Driver.Packet (queue worker 0x0) 1728.6, Driver.Packet (queue worker 0x20) 1566.8, Driver.Packet (queue worker 0x28) 1505.2, Driver.Packet.memory_wait (queue worker 0x28) 1486.6
  • present 2904: 1743.3 ms at 4870 ms: Driver.WorkerWait (queue worker 0x38) 1742.3, Driver.WorkerWait.dequeue_order (queue worker 0x38) 1736.4, Driver.Packet (queue worker 0x0) 1724.7, Driver.Packet (queue worker 0x28) 1658.1

Threads (ms per frame)

thread busy wait untraced in slices < 20 us largest
queue worker 0x0 1057.9 (70 %) 442.5 (29 %) 12.9 90.7 Driver.Packet 1496.1, Vulkan.Dispatch 0.0
draw committer 660.4 (44 %) 40.9 (3 %) 811.9 4.9 Graphics.Draw 675.0, Recorder.Submit 2.1
presenter 3.3 (0 %) 0.3 (0 %) 1509.7 0.1 VideoOut.Flip 3.2, Driver.Present 0.4
queue worker 0x38 0.7 (0 %) 1344.4 (89 %) 168.1 0.9 Driver.Packet 0.7, Driver.EndSubmission 0.1
queue worker 0x28 18.2 (1 %) 1483.2 (98 %) 11.9 0.2 Driver.Packet 1410.6, Driver.EndSubmission 0.5
queue worker 0x20 129.1 (9 %) 1374.5 (91 %) 9.7 4.9 Driver.Packet 1343.2, Driver.EndSubmission 4.0
gpu 242.4 (16 %) 0.0 (0 %) 1270.9 0.0 batch 242.4

Largest slices (ms per frame, inclusive, all threads): Driver.Packet 4250.6, Driver.Packet.memory_wait 2505.1, Driver.WorkerWait 1594.9, Driver.WorkerWait.dequeue_order 1338.7, Driver.Packet.draw 1155.6, Driver.Draw 1154.5, Graphics.Draw 927.6, Graphics.Draw.draw_and_resource_release 906.3, Driver.Packet.dispatch 559.1, Driver.Dispatch 508.7

Longest waits

  • Driver.WorkerWait (queue worker 0x38) 1903.8 ms at 9351 ms, present 2907
  • Driver.WorkerWait (queue worker 0x38) 1827.9 ms at 11257 ms, present 2908
  • Driver.WorkerWait (queue worker 0x38) 1742.4 ms at 4872 ms, present 2904
  • Driver.WorkerWait (queue worker 0x38) 1707.2 ms at 28288 ms, present 2920
  • Driver.WorkerWait (queue worker 0x38) 1652.5 ms at 26635 ms, present 2919
  • Driver.Packet.memory_wait (queue worker 0x28) 1639.3 ms at 9478 ms, present 2907
  • Driver.Packet.memory_wait (queue worker 0x28) 1577.3 ms at 11410 ms, present 2908
  • Driver.WorkerWait (queue worker 0x38) 1564.9 ms at 1753 ms, present 2902
  • Driver.WorkerWait (queue worker 0x38) 1552.0 ms at 3319 ms, present 2903
  • Driver.WorkerWait (queue worker 0x38) 1542.0 ms at 13086 ms, present 2909

Largest GPU batches (GPU ranges inside, and the CPU slices that recorded each, inclusive)

  • batch 427: 41.7 ms at 11426 ms, present 2908: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 3.0, Driver.Packet.dispatch (queue worker 0x0) 2.6, Driver.Dispatch (queue worker 0x0) 2.5, Vulkan.DispatchRecipe (queue worker 0x0) 1.3
  • batch 1139: 41.4 ms at 28443 ms, present 2920: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 2.2, Driver.Packet.dispatch (queue worker 0x0) 2.0, Driver.Dispatch (queue worker 0x0) 1.9, Vulkan.DispatchRecipe (queue worker 0x0) 0.4
  • batch 897: 41.4 ms at 22580 ms, present 2916: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 1.8, Driver.Packet.dispatch (queue worker 0x0) 1.5, Driver.Dispatch (queue worker 0x0) 1.5, Vulkan.DispatchRecipe (queue worker 0x0) 0.7
  • batch 779: 41.3 ms at 19993 ms, present 2914: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 0.6, Driver.Packet.dispatch (queue worker 0x0) 0.4, Driver.Dispatch (queue worker 0x0) 0.4, Vulkan.DispatchRecipe (queue worker 0x0) 0.3
  • batch 955: 41.3 ms at 24025 ms, present 2917: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 0.2, Driver.Packet.flush_between_packets (queue worker 0x0) 0.1, Driver.Packet.dispatch (queue worker 0x0) 0.1, Recorder.Submit (queue worker 0x0) 0.1
trace_digest.py of B (07f624d854)

seconds 960:30 from present 1815: 19 presents, frame p50 1438.8 / p90 2203.1 / p99 2511.8 / max 2511.8 ms, GPU busy 255.7 ms per present
NVIDIA GeForce RTX 3070 Laptop GPU, NVIDIA 617.42, Windows 10.0.26300, 3840x2160, commit 07f624d854fb, dropped: no

{"commit":"07f624d854fb","dirty":false,"env":{"APS5_HOST_IMPORT_MIB":"6400","APS5_LAZY_SHADER_PREPARE":"1","APS5_NO_GPL":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_SECONDS":"960:30"},"gpu":"NVIDIA GeForce RTX 3070 Laptop GPU","driver":"NVIDIA 617.42","os":"Windows 10.0.26300","cpu":"AMD Ryzen 9 5900HS with Radeon Graphics","cpu_threads":16,"memory_mib":15776,"title_id":"PPSA01556","title":"Resident Evil Village","content_version":"01.210.000","resolution":"3840x2160","window":{"spec":"seconds 960:30","first_present":1815,"ms":30085.902},"presents":19,"frame_ms":{"p50":1438.787,"p90":2203.059,"p99":2511.784,"max":2511.784},"gpu_busy_ms_per_present":255.744,"worker_busy_pct":{"queue worker 0x0":94.143,"queue worker 0x38":0.263,"queue worker 0x28":87.619,"queue worker 0x20":83.028},"top_phases_ms_per_frame":{"Driver.Packet":4195.016,"Driver.Packet.memory_wait":2410.236,"Driver.Packet.draw":1091.817,"Driver.Draw":1090.727,"Graphics.Draw":809.924,"Graphics.Draw.draw_and_resource_release":788.767,"Driver.Packet.dispatch":649.726,"Driver.Dispatch":595.737},"trace_dropped":false,"trace":"aps5-trace-07f624d854fb-36204.json.gz"}

Slowest frames (largest slices inside each, inclusive)

  • present 1818: 2511.8 ms at 5778 ms: Driver.WorkerWait (queue worker 0x38) 2508.9, Driver.WorkerWait.dequeue_order (queue worker 0x38) 2501.5, Driver.Packet (queue worker 0x0) 2491.6, Driver.Packet (queue worker 0x28) 2380.0
  • present 1815: 2203.1 ms at 0 ms: Driver.Packet (queue worker 0x0) 608.2, Driver.Packet.dispatch (queue worker 0x0) 547.6, Driver.Dispatch (queue worker 0x0) 522.9, GpuMutex.wait.dispatch (queue worker 0x0) 315.3
  • present 1817: 2086.2 ms at 3691 ms: Driver.WorkerWait (queue worker 0x38) 2085.5, Driver.WorkerWait.dequeue_order (queue worker 0x38) 2080.5, Driver.Packet (queue worker 0x0) 2065.6, Driver.Packet (queue worker 0x28) 1986.3
  • present 1831: 1957.3 ms at 25030 ms: Driver.WorkerWait (queue worker 0x38) 1956.2, Driver.WorkerWait.dequeue_order (queue worker 0x38) 1950.6, Driver.Packet (queue worker 0x0) 1938.5, Driver.Packet (queue worker 0x28) 1850.0
  • present 1827: 1891.9 ms at 18993 ms: Driver.WorkerWait (queue worker 0x38) 1890.6, Driver.WorkerWait.dequeue_order (queue worker 0x38) 1884.8, Driver.Packet (queue worker 0x0) 1875.6, Driver.Packet (queue worker 0x28) 1806.1

Threads (ms per frame)

thread busy wait untraced in slices < 20 us largest
queue worker 0x0 1089.9 (69 %) 401.2 (25 %) 92.4 85.7 Driver.Packet 1480.6, Recorder.Sync 3.7
draw committer 628.2 (40 %) 45.0 (3 %) 910.2 4.5 Graphics.Draw 640.6, Recorder.Submit 3.9
presenter 25.9 (2 %) 4.6 (0 %) 1553.0 0.1 VideoOut.Flip 22.4, Driver.Present 8.0
queue worker 0x38 3.9 (0 %) 1383.6 (87 %) 195.9 0.8 Driver.Packet 3.9, Driver.EndSubmission 0.1
queue worker 0x28 26.2 (2 %) 1441.4 (91 %) 115.8 0.2 Driver.Packet 1386.8, Driver.EndSubmission 0.5
queue worker 0x20 141.6 (9 %) 1348.7 (85 %) 93.2 4.6 Driver.Packet 1312.8, Vulkan.Dispatch 7.3
gpu 233.5 (15 %) 0.0 (0 %) 1350.0 0.0 batch 233.5

Largest slices (ms per frame, inclusive, all threads): Driver.Packet 4184.1, Driver.Packet.memory_wait 2410.1, Driver.WorkerWait 1639.1, Driver.WorkerWait.dequeue_order 1381.6, Driver.Packet.draw 1090.9, Driver.Draw 1089.8, Graphics.Draw 809.3, Graphics.Draw.draw_and_resource_release 787.9, Driver.Packet.dispatch 648.6, Driver.Dispatch 594.5

Longest waits

  • Driver.WorkerWait (queue worker 0x38) 2509.4 ms at 5781 ms, present 1818
  • Driver.WorkerWait (queue worker 0x38) 2085.3 ms at 3693 ms, present 1817
  • Driver.Packet.memory_wait (queue worker 0x28) 2056.8 ms at 5941 ms, present 1818
  • Driver.WorkerWait (queue worker 0x38) 1956.1 ms at 25031 ms, present 1831
  • Driver.WorkerWait (queue worker 0x38) 1890.8 ms at 18995 ms, present 1827
  • Driver.Packet.memory_wait (queue worker 0x28) 1816.0 ms at 3845 ms, present 1817
  • Driver.Packet.memory_wait (queue worker 0x28) 1689.8 ms at 25170 ms, present 1831
  • Driver.Packet.memory_wait (queue worker 0x28) 1650.0 ms at 19134 ms, present 1827
  • Driver.Packet.memory_wait (queue worker 0x20) 1637.9 ms at 5908 ms, present 1818
  • Driver.Packet.memory_wait (queue worker 0x20) 1602.1 ms at 3808 ms, present 1817

Largest GPU batches (GPU ranges inside, and the CPU slices that recorded each, inclusive)

  • batch 694: 41.9 ms at 19138 ms, present 1827: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 3.0, Driver.Packet.dispatch (queue worker 0x0) 2.0, Driver.Dispatch (queue worker 0x0) 1.9, Driver.Packet.flush_between_packets (queue worker 0x0) 1.0
  • batch 95: 41.8 ms at 3861 ms, present 1817: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 0.2, Driver.Packet.dispatch (queue worker 0x0) 0.1, Driver.Dispatch (queue worker 0x0) 0.1, Driver.Packet.flush_between_packets (queue worker 0x0) 0.1
  • batch 569: 41.6 ms at 16447 ms, present 1825: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 0.1, Driver.Packet.dispatch (queue worker 0x0) 0.1, Driver.Dispatch (queue worker 0x0) 0.1, Driver.Packet.flush_between_packets (queue worker 0x0) 0.1
  • batch 935: 41.6 ms at 25173 ms, present 1831: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 1.7, Driver.Packet.dispatch (queue worker 0x0) 1.5, Driver.Dispatch (queue worker 0x0) 1.4, Vulkan.DispatchRecipe (queue worker 0x0) 0.5
  • batch 159: 41.6 ms at 5964 ms, present 1818: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 474.3, Driver.Packet.draw (queue worker 0x0) 461.8, Driver.Draw (queue worker 0x0) 461.4, Driver.Draw.draw_enqueued (queue worker 0x0) 154.9
- **The self-check, in Village:** one boot to menu +15 with `APS5_VERIFY_UNTRACKED_PROOFS=1`. After every fast proof that accepted a surface over untracked memory by its stamp, hinted or epoch, the full walk ran too. - **The result:** 38,000 such proofs were checked, from boot through the menu, and **0 disagreed**. That's all 38 of its `[verify-untracked]` lines; the last reads `38000 fast proofs over untracked memory checked by the full walk, 0 disagreed`. - **How it was built:** the boot was a diagnostic build of this change that prints the count every 1,000 checks instead of every 100,000. - **Not a speed figure:** the self-check's extra walks slow the boot.

Grand Theft Auto V (PPSA04263), by @chitters2004

On Windows 11, a Ryzen 7 5800X and an RTX 3080 (driver 621.01), with the same machine, scene and save in both arms.

  • Story gameplay, 12 s trace windows, runs alternating (comment). The base is e8efeed58a + #11580, since main stops at Story load. The change merges 23ef222060 into it, so it adds #6192's four commits and this PR's together.
    • Frame p50: 104.3 and 106.6 ms in the base, 87.9 and 82.6 ms with the change. p99: 117.1 and 120.6 ms, against 97.4 and 94.0 ms.
    • Draw committer busy: 82.6 and 84.7 ms, against 65.6 and 60.7 ms. GPU busy stays at about 36 ms.
    • With APS5_PROFILE_DRAW=1, Revalidate full walks refused by collect fell from 3,380 to 1,530 ms per 10 s.
    • Two of about 70 boots of the change crashed on the title's main thread about 21 s in, against none of about 40 on the base. Both read a garbage length while parsing audio metadata. The count is too small to tie to either side.
  • The Story gain, split (comment): both arms are the same merge, and in the first, untrackedRangeStamp's hinted branch is removed, so every proof takes #6192's epoch stamp. Two runs each, alternating, with no crashes.
    • Frame p50: 81.2 and 83.2 ms with the hinted stamp off, against 84.3 and 83.3 ms with this PR. p99: 88.5 and 89.4 ms, against 97.3 and 92.1 ms.
    • So on this title the Story gain comes from #6192, and this PR's hinted stamp adds nothing measurable.
    • Why the hint doesn't apply here: about 21,000 of the 21,500 collect refusals per 10 s are on plain sampled snapshots recorded with the epoch stamp. GuestArenaCollectWrites refuses their ranges: in one 10 s sample, all 19,091 refusals came from collectable, on direct-memory pages marked comparedWhenShared. So walkHints fails and UntrackedHint returns 0. This is the shared-pages case under What's "Unhinted ranges".
  • This PR alone, in the North Yankton prologue (comment, timings): main 52c09d567d + #11580 + #6192 against the same plus this PR, three runs each.
    • FPS 12.30, 12.61 and 12.78 against 12.24, 12.48 and 12.12: no change outside the run-to-run spread.
    • The proof self-check (APS5_VERIFY_UNTRACKED_PROOFS=1 APS5_VERIFY_PROOFS=1) compared 300,000 fast proofs with the full walk, with 0 disagreements.
    • Hinted stamps took about 10,000 checks per 10 s there, all passing, at about 1.1 µs each.

Grand Theft Auto V (PPSA04264), by @Nesyth

Windows 11 Pro 26300, a Radeon RX 7900 XTX (AMD Software 26.10.1), a Ryzen 7 7800X3D, 3840x2160 output. Version 01.011.001 in the Performance graphics mode, gameplay of the opening level with warm caches (comment). The arms are main 9090972b7e and the same commit with this PR's head 793fc7f8ea merged, so the second carries #6192's four commits as well as this PR's. Each run is a separate boot, and FPS is the window title's counter over 57 s of scripted gameplay.

  • FPS without profiling: 14.46 on main, against 17.32 and 18.70 with the change (+20 to +29 %). With APS5_PROFILE_DRAW=1: 12.78 and 13.56, against 15.60 and 16.36.
  • The draw committer bounds the frame in this mode (about 88 % busy on main). Draw commit: 39.9 and 37.6 µs, against 31.3 and 30.3 µs. Collect full walks: 3.83 and 3.58 s per 10 s, against 2.42 and 2.22 s. Collect refusals per 10 s: 50,181 over 163 surfaces and 41,172 over 125, against 30,269 over 120 and 30,118 over 119. Every remaining refusal is counted as unwatched.
  • No new warnings: both builds print the same 8 storage-image "keeping the CPU's blocks" lines per run, with no BDA or device faults.
  • This pair compares main with #6192 and this PR together, so it doesn't separate their shares. On the Story save above, the split put the gain on #6192.

Tested

  • agc_untracked_hint_proof (new), with two sampled 64 KiB surfaces over write-watched, host-imported, then unwatched memory:
    • Red/green: after a collect epoch with no write, the proof is fast exactly when the block has a hint.
    • Controls: a CPU store after a bump; a MarkWritten driver store; a recorded GPU write note, before and after the write is reaped; and a CPU store made after the hint is sampled but before the stamp is recorded, through a flush hook.
    • Each control must walk and take the new content, and settle re-proves the stamps after each one. No case asserts a throw.
  • Red/green on Windows (RTX 3070 Laptop, driver 617.42, Windows 10.0.26300):
    • Red: the new test on #6192's code (ported onto main) fails at "a proof over a hinted untracked range walked after a collect epoch with no write". The test prints "the block has a write-watch hint".
    • Green: agc_untracked_hint_proof, agc_untracked_revalidate and agc_untracked_forget passed 10 of 10 each.
  • Linux (lavapipe, Ubuntu 24.04, GCC 13.3, Release, CI's flags), on this head's tree:
    • agc_untracked_hint_proof, agc_untracked_revalidate and agc_untracked_forget passed 20 of 20 each. Linux has no hints, so the new test runs there under the epoch rule and checks that nothing changes.
    • ctest -R '^agc' --parallel 4: 1,119 tests: 1,046 passed, 73 skipped, 0 failed.
    • Without the teardown fix, agc_untracked_forget crashes on lavapipe 20 of 20 times.
  • Checks: check_conventions.py and check_test_registration.py pass. MinGW-w64 -fsyntax-only adds no errors or warnings to main's. Nothing under core/shader/** changes, so the shader cache key is unchanged.
  • GitHub, ×10, with the Khronos validation comparison on Linux (run). The comparison arm is #6192 merged with main plus the teardown fix (e440b742c3), so it differs from this head only by the hint key.
    • Linux: agc_untracked_hint_proof, agc_untracked_revalidate and agc_untracked_forget passed 10 of 10 under validation.
    • Linux ^agc under validation: 1,119 run, 73 skipped, 1 failed. The failure is agc_driver_image_table, whose only validation message is VUID-VkDeviceCreateInfo-pNext-pNext from vkCreateDevice ("unknown VkStructureType (1000574000) ... version 275 of the Vulkan header"). That's the runner's validation layer being older than the headers. The comparison arm fails that test the same way, and the change adds no VUID.
    • Windows runner: 1,144 run, 812 skipped, 0 failed. The three tests skip there, because the runner has no Vulkan device, so on Windows this is a build and no-crash check. The device evidence for Windows is the RTX 3070 red/green above. It ran on the same library lines as this head; only the test-only teardown fix is newer.
    • Suites: the libc and libkernel suites, run with APS5_SKIP_TIMING_TESTS=1, pass: 191 and 291 on Linux, 220 and 314 on Windows.
    • agc_driver_image_table without the validation layer (run 40890382693) passes on both sides. On Linux, it ran with the branch's 78 tests: 71 passed, 7 skipped, 0 failed. On Windows, 94 ran, 4 passed and 90 skipped, since the runner has no device. The suites match the run above.
  • 31dff937b5, a merge of main 673fa865f4, which brings johandavidcm's #11550 (run).
    • The conflicts: both were in fastRevalidate, in lines #6192 changes. #11550 counts each collect refusal with countCollectRefusal, and #6192 lets an untracked surface whose stamp still matches pass instead of refusing.
    • The resolution: countCollectRefusal now sits inside #6192's stamp check, just before return fail(FastFail::Collect). So only collects that are still refused are counted, and an untracked surface its stamp proves isn't.
    • This PR's own lines are unchanged.
    • ×10: #11550's agc_driver_resource_cache_collect_refusals; the untracked-proof tests agc_untracked_revalidate, agc_untracked_forget and agc_untracked_hint_proof; agc_write_tracking; and the ^agc_driver_image_table tests, with the tests for the files the merge changes.
      • Linux: 87 run, 79 pass, 8 skip, 0 fail.
      • Windows: 103 run, 6 pass, 97 skip (no Vulkan device), 0 fail.
      • The libc and libkernel suites run 194 and 294 tests on Linux and 224 and 317 on Windows, with 0 failed. The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.
  • 2b74a6c5d5, cross-thread cases (test-only).
    • agc_untracked_hint_proof gains three cases:
      • another thread stores right after the first surface's compare, from inside the flush hook;
      • another thread stores after a fast proof;
      • the check itself runs on another thread.
    • agc_write_tracking gains a device-free case on Windows:
      • a store from one thread is seen by another thread's walk;
      • the stamps are shared, so a thread still in its old epoch reads the newer hint, and so does the next epoch;
      • a writer races across 50 epochs.
    • Green on Windows (RTX 3070 Laptop, driver 617.42):
      • agc_untracked_hint_proof, agc_untracked_revalidate, agc_untracked_forget and agc_write_tracking pass 10 of 10 each.
      • The hint proof printed "the block has a write-watch hint" in all 10 runs, so the hinted path ran.
      • agc_write_tracking alone passes 20 of 20.
    • GitHub, ×10 (run):
      • Linux: 79 run, 71 pass, 8 skip, 0 fail.
      • Windows: 102 run, 12 pass, 90 skip (no Vulkan device), 0 fail. agc_write_tracking's device-free cases run there.
      • The libc and libkernel suites run 194 and 294 tests on Linux and 224 and 317 on Windows, with 0 failed. The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.
    • Red, with the UntrackedHint memo made to ignore the collect epoch (a measurement branch, not part of this PR):
      • On the RTX 3070, agc_write_tracking fails with "the last store of a racing thread did not move the hint past every value read before it", and agc_untracked_hint_proof fails at its existing step, "a CPU store after a collect epoch kept the fast proof".
      • On GitHub (run), Windows fails agc_write_tracking with the same message, and agc_untracked_hint_proof skips there. Linux passes: it has no write-watch hints, so its ranges keep the epoch stamp.
    • Taking the hint after the compare has no deterministic red. The only hook in that path runs before both reads.
  • 23ef222060, a merge of main 8304ccaedb (run).
    • The conflict: one line in CMakeLists.txt, the Windows ENVIRONMENT_MODIFICATION test list, where #9565 adds agc_recorder_command_buffer_release. The resolution is the union of both sides' names, each once.
    • This PR's own lines are unchanged. The only difference in its diff is that list line, which now carries main's new name.
    • ×10: the ^agc_untracked_ tests, agc_write_tracking, agc_driver_recorder and main's agc_recorder_command_buffer_release.
      • Linux: 81 run, 73 pass, 8 skip, 0 fail.
      • Windows: 104 run, 12 pass, 92 skip (no Vulkan device), 0 fail.
      • The libc and libkernel suites run 198 and 307 tests on Linux and 225 and 327 on Windows, with 0 failed. The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.
  • 8bee4cadbf, a merge of main 0836dfdf4f (run). #12862 moved libSceAgcDriver's test registrations into tests/cmake/; the conflict in CMakeLists.txt is resolved with tools/agc_test_split.py resolve, which moves this PR's registrations into tests/cmake/agc_driver_recorder_tests.cmake (+7 −1). Nothing else conflicted. Apart from the move, this PR's diff is unchanged. With -DBUILD_TESTING=ON, ctest -N gives 3078 tests: main's 3075 plus its 3 tests, each listed once. agc_driver_recorder, agc_recorder_command_buffer_release, agc_untracked_forget, agc_untracked_hint_proof, agc_untracked_revalidate, agc_write_tracking pass 10 runs in a row. Linux: 6 run, 6 pass, 0 skip, 0 fail. Windows: 6 run, 1 pass, 5 skip (no Vulkan device), 0 fail. Suites: libc and libkernel pass on Linux (199 and 308) and on Windows (226 and 330). The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.
  • 793fc7f8ea, the untracked proof tests report a skip when they can't run, for oneandonlydean's review (test-only, tests/Recorder.cpp). untrackedForgetTests, untrackedRevalidateTests and untrackedHintProofTests return false at each of their 10 early outs and true at the end, and their --untracked-*-only branches return ? 0 : 77, as SKIP_RETURN_CODE 77 expects.
    • ×10 (run): Linux: 3 run, 3 pass, 0 skip, 0 fail. Windows: 3 run, 0 pass, 3 skip (no Vulkan device), 0 fail. The libc and libkernel suites run 199 and 308 tests on Linux and 226 and 330 on Windows, with 0 failed. The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.
    • The new skips aren't reached on GitHub's runners: Linux runs all three in full at both heads (before), and Windows skips the binary before them at both heads.
  • AMD Radeon RX 6300 (RADV NAVI24, Mesa 25.2.8) at 793fc7f8ea, from TechLevelZero's AMD bot (report): this head merged onto main 291e02d, Ubuntu 26.04.1, 2,540 of 3,155 tests selected.
    • 2,477 passed, 9 failed and 54 skipped. None of the failures is new: all 9 also fail on main.
    • With VK_LAYER_KHRONOS_validation, no new validation IDs over 934 GPU tests. agc_untracked_forget, agc_untracked_revalidate and agc_untracked_hint_proof passed on the GPU, so they ran in full there, since this head reports 77 when they can't. They aren't in main's baseline, so their validation wasn't compared.
  • NVIDIA RTX 2000 Ada Generation at 793fc7f8ea, from TechLevelZero's NVIDIA bot (report): this head merged onto main e6f5730, driver 595.99.02, Ubuntu 26.04.1, 2,535 of 3,148 tests selected.
    • 2,484 passed, 6 failed and 45 skipped. None of the failures is new: 3 also fail on main, and 3 are unstable on main.
    • With VK_LAYER_KHRONOS_validation, no new validation IDs over 934 GPU tests. The three agc_untracked_* tests passed on the GPU, so they ran in full there too. They aren't in main's baseline, so their validation wasn't compared.
  • 38dc520c3f, oneandonlydean's merge of main f6232fcfda. It resolves the conflicts in ShaderResources.hpp and tests/cmake/agc_driver_recorder_tests.cmake. This PR's own lines are unchanged. The only difference in its diff is the Windows ENVIRONMENT_MODIFICATION list line, which now carries main's agc_window_import_unmap.
    • NVIDIA RTX 2000 Ada Generation at 38dc520c3f, from TechLevelZero's NVIDIA bot (report): this head merged onto main f6232fc, driver 595.99.02, Ubuntu 26.04.1, 2,795 of 3,743 tests selected. 2,740 passed, 6 failed and 49 skipped. None of the failures is new: 3 also fail on main, and 3 are unstable on main. With VK_LAYER_KHRONOS_validation, no new validation IDs over 937 GPU tests.
  • 8468301cdd, a merge of main 4f41f4c375 (run).
    • The conflicts: two, each resolved by keeping both sides. In Texture.hpp, main's new OccasionalLabelStores declaration and this PR's HintedComparison declaration are adjacent, and both stay. In tests/cmake/agc_driver_recorder_tests.cmake, the Windows ENVIRONMENT_MODIFICATION list, where main adds agc_changed_copy, the resolution is the union of both sides' names, each once. This PR's own lines are unchanged, and that list line is the only difference in its diff.
    • ×10: agc_changed_copy, agc_recorder_read_list and every test matching ^agc_untracked or ^guest_memory. Linux: 9 run, 9 pass, 0 skip, 0 fail. Windows: 8 run, 3 pass, 5 skip (no Vulkan device), 0 fail. The libc and libkernel suites run 300 and 322 tests on Linux and 327 and 342 on Windows, with 0 failed. The suites ran with APS5_SKIP_TIMING_TESTS=1, which relaxes precise_wait's median bounds on GitHub's hosted runners.

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: #14262 (oneandonlydean's carry of #6192, which stacks on #14261, the carry of #6187); merge order: after #12745, since both change Graphics/src/ShaderResources.cpp and conflict there, and this PR takes the second merge with the test-only update on test/untracked-proof-index-on-12921
  • Fixes: none
  • Unblocks: none
  • GPUs tested: NVIDIA GeForce RTX 3070 Laptop GPU (617.42); NVIDIA GeForce RTX 3080 (621.01), Windows 11 (Grand Theft Auto V, chitters2004); AMD Radeon RX 7900 XTX (AMD Software 26.10.1), Windows 11 (Grand Theft Auto V, Nesyth); lavapipe; AMD Radeon RX 6300 (RADV NAVI24, Mesa 25.2.8), Ubuntu 26.04.1 (tests, TechLevelZero's AMD bot); NVIDIA RTX 2000 Ada Generation (driver 595.99.02), Ubuntu 26.04.1 (tests, TechLevelZero's NVIDIA bot)
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5069764269 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12921). Originally posted by [EagleBearerYS](https://github.com/EagleBearerYS) on 2026-10-29T14:23:15Z. --- ### What **Windows only in effect.** Write-watch hints exist only on Windows (`GuestMemory::UntrackedHint` returns 0 on other platforms), so on Linux this changes nothing: every untracked proof keeps #6192's epoch stamp. #6192 lets a fast revalidation over untracked memory accept a surface by its stamp until the next ordering point: the stamp is `{collect epoch, NewestStamp, ForgetStamp, write note}`. In Resident Evil Village (PPSA01556)'s static menu, collect epochs advance about 80 times a second, so most of those proofs expire before they're reused, and the next one walks the full table again. On Windows, an unwatched range has a write-watch hint (`GuestMemory::UntrackedHint`), and a store into it moves the hint at the next walk of that page's marks. The check runs that walk itself: `UntrackedHint` reads and resets the range's marks (`walkHints`) unless this thread already walked the range in the current collect epoch. This change keeps a proof across epochs while the hint hasn't moved. - **A hinted range's stamp** is `{hint, NewestStamp, ForgetStamp, write note, 1}`. Every field is taken just before the bytes the proof stands on are read or compared, not when the proof is captured: - **snapshots:** main's `untrackedKey`, carried in the lookup record (`LookupRecord::untracked`); - **views and storage images:** the stamp of the image's last equal compare in `StorageTexture::compareUntracked`, through `StorageTexture::HintedComparison`. - **Why a racing store is never absorbed:** a CPU store after the read leaves a write-watch mark, and the next hint walk stamps a hint newer than the recorded one. A driver store moves `NewestStamp`, a forget moves `ForgetStamp`, and a new recorded GPU write moves the note. So at the next ordering point the check walks again. - Within an epoch, the hint is memoized, which is #6192's in-epoch acceptance, unchanged. - Sampling at capture instead would be wrong: the memo can already include a store made after the compare. The test's last control covers that. - **Unhinted ranges** (Linux, shared pages, host regions) keep #6192's epoch stamp. The last field keeps the two kinds apart, and both forms are refused while a forget is in progress. - **`APS5_VERIFY_UNTRACKED_PROOFS=1`** still cross-checks every fast proof that used an untracked stamp, hinted or epoch, with the full walk. - **Known cost:** a new storage image has no hinted entry until its first equal compare, so its first proof across an ordering point walks once. **The branch.** It holds #6192's four commits unchanged (with #6187 under them), then four of ours: 1. **A merge of `main`.** #6192 conflicts with current main in `Texture.cpp` (main's per-range `comparedRanges` memo kept, with #6187's `ForgetStamp` in place of `ForgetSerial`), `ShaderResources.cpp` (main's `LastRecordIndices`, `GenerationFor` and depth guard kept, with the untracked stamps added) and `CMakeLists.txt` (the Windows test list). 2. **The `ENVIRONMENT.md` row** for `APS5_VERIFY_UNTRACKED_PROOFS`, which main's conventions check requires. 3. **`agc_untracked_forget`'s teardown fix,** offered on #6187: the test freed its detiler while a recorded dispatch still used its pipeline, which crashed lavapipe's queue thread. It's test-only. 4. **The hint key and its test.** **Overlap:** checked with `git merge-tree` against each pull request the overlap comment lists, at head fdc70046f8. - **#14261 and #14262 (oneandonlydean)** carry #6187 and #6192 forward on current `main`: the same four commits of TheAggie's, rebased and kept under TheAggie's name, with oneandonlydean's test fixes. This PR carries the original commits. Once #14262 lands, this PR's next merge of `main` takes their changes from `main`, and this PR's diff is then only its hinted stamp. - **#6108 (Gashrod1)** adds `GuestSnapshots()` where this PR adds `HintedComparison()`, in `Texture.hpp` and `Texture.cpp`. The clash is textual only: whichever lands second keeps both. - **#12575 (QRMOE, draft)** rewrites `cachedTexture`'s sampled-cache hit branch as a per-entry check. This PR adds one argument in that branch: the untracked proof's key, passed to `logLookup`. QRMOE agreed in #12575's thread that this PR goes first, and carries its `logLookup` argument into the per-entry form when #12575 is rebased ([comment](https://github.com/boykopovar/AnyPS5/pull/12575#issuecomment-6600597512)). - **#6182 and #9875** (`CMakeLists.txt`), and **#10894** (`ShaderResources.cpp`), conflict with #6192's commits, which this PR carries. The conflicting hunks are the same with #6192's head merged with `main`, and this PR's own lines don't touch them, so their order follows #6192's. **#11550** has merged, and 31dff937b5 merges it (Tested). - **#12378 (BunnyFl)**, which merges cleanly with this branch, excludes only an import's own pages from the write watch and settles partial-block imports in the background. Ranges it keeps watched never become untracked; this change covers the ones that stay unwatched. - **#11602 (XatiX)**, which merges cleanly too, keys `DepthSurface`'s HTILE clear check of untracked memory on the same `UntrackedHint`. It's a different consumer of the same hint. ### Resident Evil Village (PPSA01556) **Static menu, one block of four unprofiled runs, B A A B.** - **The arms:** A is `main` 319621ba2e plus #11580 and #10304, with a local `scePadOpen` answer for port types 3 and 4 (103015a9ca). B is the same tree plus #6192's four commits and this PR's commit (24b56bc1b4: the same added and removed lines as this head, apart from the `agc_untracked_forget` teardown fix, which only changes a test). So the pair measures #6192 and this PR together; #6192 alone wasn't run. - **The env, in both:** `APS5_LAZY_SHADER_PREPARE=1 APS5_NO_GPL=1 APS5_HOST_IMPORT_MIB=6400 APS5_TRACE_SUMMARY_EVERY=10`, with scripted pad input. The change has no switch, so nothing else differs. - **The machine:** NVIDIA GeForce RTX 3070 Laptop GPU (617.42), Ryzen 9 5900HS, Windows 10.0.26300, 3840x2160 output. - The shader cache was warm, with the same key in all four runs (0 misses). - GPU clocks weren't held: P0 at 98-99 %, 1,435-1,459 MHz, since the menu is CPU-bound. - **The figure:** presents per second over menu +5..15 minutes. | run | fps | frame p50 / p90 (s) | |---|---|---| | B | 0.691 | 1.36 / 1.76 | | A | 0.513 | 1.71 / 2.25 | | A | 0.657 | 1.47 / 1.80 | | B | 0.829 | 1.18 / 1.39 | - **Means:** B 0.760 and A 0.585, **+29.9 %**. B's mean is 15.7 % above A's best run, and B is ahead in both same-phase pairs, by +34.8 % and +26.2 %. - **Spreads:** A's own spread is 24.7 %, because its first run slowed from 0.69 to 0.35 fps at +11-13 min. B's is 18.2 %. - **Phases, B against A, ms per frame:** `Driver.Packet` 3,926 / 3,368 against 4,944 / 4,253, about 21 % lower. `Driver.Packet.memory_wait` 2,277 / 1,943 against 2,898 / 2,482. `Graphics.Draw` 782 / 689 against 1,056 / 907. - **Health:** no aborts and no failed host imports in any run. - **Where it comes from, in one profiled boot of each tree** (`APS5_PROFILE_DRAW=1`; menu +10..15, 31 ten-second `[rescache]` blocks): - **On A,** 15,396 fast proofs failed at the collect check, and each one took a full walk. - **With this change,** none failed there. Fast proofs that failed for any reason fell from 18,279 to 6,033. Some of the proofs that used to stop at the collect check now get as far as the pending-image check, so its count rose from 2,698 to 5,804. - **Not compared:** the B boot also ran with `APS5_VERIFY_UNTRACKED_PROOFS=1`, so its revalidation time includes the self-check's extra full walks. - **Overlap with #12745:** its write index removes the same collect-check failures by another route, a proof that doesn't collect per element (0 in its profiled boot, same window). On this menu the two PRs address the same full walks. - **Together** (one block, B A A B, unprofiled, menu +5..15): - **B:** fork `diag/village-combined-on-103015a9ca` c9cff8c839, the A tree above plus #12478, #12745 and #12921, run with `APS5_TABLE_INDEX=1`. - **fps:** B ran 0.711 and 0.778 against A's 0.497 and 0.495, **+50.0 %**. - B led both same-phase pairs, by +42.8 % and +57.1 %. - B's slower run is 42.9 % above A's faster one. - **`Driver.Packet` per frame:** 3,822 and 3,568 ms against 5,187 and 5,301 ms. **`memory_wait`:** 2,199 and 2,032 ms against 3,090 and 3,167 ms. - **Read the ratio, not the fps:** A ran slower in this block than in the pair above, 0.50 against 0.51 and 0.66. - **The total is below the two gains added** (#12745's +25 % and #12921's +29.9 %), although B also carries #12478, because both PRs remove the same full walks. - **Tests with both PRs in and `APS5_TABLE_INDEX=1`:** - **The failure:** two of #12921's path assertions, in `agc_untracked_revalidate` and `agc_untracked_hint_proof`, expect a full walk after a collect epoch. The index proves those draws by looking the elements up again, which re-reads the memory, so the content still follows every store. - **Unaffected:** with the switch off (the default), nothing fails. - **The fix:** a test-only update for whichever PR merges second is ready, as one commit with the same patch-id on two branches: - [`test/untracked-proof-index-on-12745`](https://github.com/EagleBearerYS/AnyPS5/commits/test/untracked-proof-index-on-12745), for #12745 if #12921 lands first; - [`test/untracked-proof-index-on-12921`](https://github.com/EagleBearerYS/AnyPS5/commits/test/untracked-proof-index-on-12921), for #12921 if #12745 lands first. - **What it accepts:** a fast proof only when the image versions moved the way guest memory did. - **Red/green** (Linux, lavapipe), [result](https://github.com/EagleBearerYS/AnyPS5/blob/cloud-results/results/cloud-2/BF-285.md): - both tests fail 10 of 10 on the merge without it, and pass 10 of 10 with it, off and on; - `ctest -R '^agc'` gives 1,048 passed, 73 skipped and 0 failed in both modes. <details><summary>Summary lines at menu +10 of the first B and A runs (B 07f624d854, A 103015a9ca). Each row is one 10 s interval, so its frame times aren't the window's figures above.</summary> ```jsonl {"commit":"07f624d854fb","dirty":false,"env":{"APS5_HOST_IMPORT_MIB":"6400","APS5_LAZY_SHADER_PREPARE":"1","APS5_NO_GPL":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_SUMMARY_EVERY":"10"},"gpu":"NVIDIA GeForce RTX 3070 Laptop GPU","driver":"NVIDIA 617.42","os":"Windows 10.0.26300","cpu":"AMD Ryzen 9 5900HS with Radeon Graphics","cpu_threads":16,"memory_mib":15776,"title_id":"PPSA01556","title":"Resident Evil Village","content_version":"01.210.000","resolution":"3840x2160","window":{"spec":"summary_every 10","first_present":1605,"ms":10237.489},"interval_start_s":836.978,"interval_end_s":847.215,"presents":6,"frame_ms":{"p50":1738.099,"p90":2336.798,"p99":2336.798,"max":2336.798},"gpu_busy_ms_per_present":243.520,"worker_busy_pct":{"queue worker 0x0":99.570,"queue worker 0x38":0.112,"queue worker 0x20":89.391,"queue worker 0x28":94.215},"top_phases_ms_per_frame":{"Driver.Packet":4828.637,"Driver.Packet.memory_wait":2822.733,"Driver.Packet.draw":1269.158,"Driver.Draw":1267.783,"Graphics.Draw":996.479,"Graphics.Draw.draw_and_resource_release":970.327,"Driver.Packet.dispatch":693.763,"Driver.Dispatch":639.245},"trace_dropped":false,"trace":""} {"commit":"103015a9ca66","dirty":false,"env":{"APS5_HOST_IMPORT_MIB":"6400","APS5_LAZY_SHADER_PREPARE":"1","APS5_NO_GPL":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_SUMMARY_EVERY":"10"},"gpu":"NVIDIA GeForce RTX 3070 Laptop GPU","driver":"NVIDIA 617.42","os":"Windows 10.0.26300","cpu":"AMD Ryzen 9 5900HS with Radeon Graphics","cpu_threads":16,"memory_mib":15776,"title_id":"PPSA01556","title":"Resident Evil Village","content_version":"01.210.000","resolution":"3840x2160","window":{"spec":"summary_every 10","first_present":3369,"ms":11746.745},"interval_start_s":979.116,"interval_end_s":990.863,"presents":6,"frame_ms":{"p50":2124.387,"p90":2317.005,"p99":2317.005,"max":2317.005},"gpu_busy_ms_per_present":285.700,"worker_busy_pct":{"queue worker 0x0":99.617,"queue worker 0x38":0.114,"queue worker 0x20":90.888,"queue worker 0x28":95.018},"top_phases_ms_per_frame":{"Driver.Packet":5590.476,"Driver.Packet.memory_wait":3348.407,"Driver.Packet.draw":1541.600,"Driver.Draw":1540.185,"Graphics.Draw":1190.041,"Graphics.Draw.draw_and_resource_release":1161.247,"Driver.Packet.dispatch":661.397,"Driver.Dispatch":602.462},"trace_dropped":false,"trace":""} ``` </details> - **Traces:** one 30 s capture of each arm, menu +10.3-10.5 min, with `APS5_TRACE_SECONDS=960:30` and no other trace or profile switch: - A: [aps5-trace-103015a9ca66-33724.json.gz](https://github.com/EagleBearerYS/AnyPS5/releases/download/traces-12921/aps5-trace-103015a9ca66-33724.json.gz), 2,419,643 bytes, sha256 `16eab88b27f0843a5aa46433a83dbb69cc1fd960ff2a521acade7d20b52fb809`; - B: [aps5-trace-07f624d854fb-36204.json.gz](https://github.com/EagleBearerYS/AnyPS5/releases/download/traces-12921/aps5-trace-07f624d854fb-36204.json.gz), 2,161,932 bytes, sha256 `bb08a9ac103f778937429c3ead8343ed6b3e87b6abf7bc7ff8c471b125913f0b`. - A single 30 s window per arm is too short to compare speed (frame p50 1.50 s for A, 1.44 s for B). The comparison is the four unprofiled runs above. - GPU clocks weren't held: P0 98 %, mean 1,420-1,425 MHz. <details><summary>trace_digest.py of A (103015a9ca)</summary> **seconds 960:30** from present 2901: 21 presents, frame p50 1497.6 / p90 1783.2 / p99 1903.7 / max 1903.7 ms, GPU busy 230.6 ms per present NVIDIA GeForce RTX 3070 Laptop GPU, NVIDIA 617.42, Windows 10.0.26300, 3840x2160, commit 103015a9ca66, dropped: no ```json {"commit":"103015a9ca66","dirty":false,"env":{"APS5_HOST_IMPORT_MIB":"6400","APS5_LAZY_SHADER_PREPARE":"1","APS5_NO_GPL":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_SECONDS":"960:30"},"gpu":"NVIDIA GeForce RTX 3070 Laptop GPU","driver":"NVIDIA 617.42","os":"Windows 10.0.26300","cpu":"AMD Ryzen 9 5900HS with Radeon Graphics","cpu_threads":16,"memory_mib":15776,"title_id":"PPSA01556","title":"Resident Evil Village","content_version":"01.210.000","resolution":"3840x2160","window":{"spec":"seconds 960:30","first_present":2901,"ms":31778.408},"presents":21,"frame_ms":{"p50":1497.603,"p90":1783.23,"p99":1903.699,"max":1903.699},"gpu_busy_ms_per_present":230.559,"worker_busy_pct":{"queue worker 0x0":99.554,"queue worker 0x38":0.057,"queue worker 0x28":93.25,"queue worker 0x20":89.065},"top_phases_ms_per_frame":{"Driver.Packet":4261.674,"Driver.Packet.memory_wait":2505.215,"Driver.Packet.draw":1156.599,"Driver.Draw":1155.503,"Graphics.Draw":928.353,"Graphics.Draw.draw_and_resource_release":907.06,"Driver.Packet.dispatch":560.368,"Driver.Dispatch":510.148},"trace_dropped":false,"trace":"aps5-trace-103015a9ca66-33724.json.gz"} ``` **Slowest frames** (largest slices inside each, inclusive) - present 2907: 1903.7 ms at 9350 ms: Driver.WorkerWait (queue worker 0x38) 1903.0, Driver.WorkerWait.dequeue_order (queue worker 0x38) 1897.0, Driver.Packet (queue worker 0x0) 1885.3, Driver.Packet (queue worker 0x28) 1785.2 - present 2908: 1831.4 ms at 11253 ms: Driver.WorkerWait (queue worker 0x38) 1828.9, Driver.WorkerWait.dequeue_order (queue worker 0x38) 1818.7, Driver.Packet (queue worker 0x0) 1812.5, Driver.Packet (queue worker 0x28) 1746.7 - present 2921: 1783.2 ms at 29995 ms: Driver.Packet (queue worker 0x0) 1764.7, Driver.Packet (queue worker 0x28) 1682.4, Driver.Packet.memory_wait (queue worker 0x28) 1663.5, Driver.Packet (queue worker 0x20) 1600.6 - present 2901: 1750.5 ms at 0 ms: Driver.Packet (queue worker 0x0) 1728.6, Driver.Packet (queue worker 0x20) 1566.8, Driver.Packet (queue worker 0x28) 1505.2, Driver.Packet.memory_wait (queue worker 0x28) 1486.6 - present 2904: 1743.3 ms at 4870 ms: Driver.WorkerWait (queue worker 0x38) 1742.3, Driver.WorkerWait.dequeue_order (queue worker 0x38) 1736.4, Driver.Packet (queue worker 0x0) 1724.7, Driver.Packet (queue worker 0x28) 1658.1 **Threads** (ms per frame) | thread | busy | wait | untraced | in slices < 20 us | largest | |---|---|---|---|---|---| | queue worker 0x0 | 1057.9 (70 %) | 442.5 (29 %) | 12.9 | 90.7 | Driver.Packet 1496.1, Vulkan.Dispatch 0.0 | | draw committer | 660.4 (44 %) | 40.9 (3 %) | 811.9 | 4.9 | Graphics.Draw 675.0, Recorder.Submit 2.1 | | presenter | 3.3 (0 %) | 0.3 (0 %) | 1509.7 | 0.1 | VideoOut.Flip 3.2, Driver.Present 0.4 | | queue worker 0x38 | 0.7 (0 %) | 1344.4 (89 %) | 168.1 | 0.9 | Driver.Packet 0.7, Driver.EndSubmission 0.1 | | queue worker 0x28 | 18.2 (1 %) | 1483.2 (98 %) | 11.9 | 0.2 | Driver.Packet 1410.6, Driver.EndSubmission 0.5 | | queue worker 0x20 | 129.1 (9 %) | 1374.5 (91 %) | 9.7 | 4.9 | Driver.Packet 1343.2, Driver.EndSubmission 4.0 | | gpu | 242.4 (16 %) | 0.0 (0 %) | 1270.9 | 0.0 | batch 242.4 | **Largest slices** (ms per frame, inclusive, all threads): Driver.Packet 4250.6, Driver.Packet.memory_wait 2505.1, Driver.WorkerWait 1594.9, Driver.WorkerWait.dequeue_order 1338.7, Driver.Packet.draw 1155.6, Driver.Draw 1154.5, Graphics.Draw 927.6, Graphics.Draw.draw_and_resource_release 906.3, Driver.Packet.dispatch 559.1, Driver.Dispatch 508.7 **Longest waits** - Driver.WorkerWait (queue worker 0x38) 1903.8 ms at 9351 ms, present 2907 - Driver.WorkerWait (queue worker 0x38) 1827.9 ms at 11257 ms, present 2908 - Driver.WorkerWait (queue worker 0x38) 1742.4 ms at 4872 ms, present 2904 - Driver.WorkerWait (queue worker 0x38) 1707.2 ms at 28288 ms, present 2920 - Driver.WorkerWait (queue worker 0x38) 1652.5 ms at 26635 ms, present 2919 - Driver.Packet.memory_wait (queue worker 0x28) 1639.3 ms at 9478 ms, present 2907 - Driver.Packet.memory_wait (queue worker 0x28) 1577.3 ms at 11410 ms, present 2908 - Driver.WorkerWait (queue worker 0x38) 1564.9 ms at 1753 ms, present 2902 - Driver.WorkerWait (queue worker 0x38) 1552.0 ms at 3319 ms, present 2903 - Driver.WorkerWait (queue worker 0x38) 1542.0 ms at 13086 ms, present 2909 **Largest GPU batches** (GPU ranges inside, and the CPU slices that recorded each, inclusive) - batch 427: 41.7 ms at 11426 ms, present 2908: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 3.0, Driver.Packet.dispatch (queue worker 0x0) 2.6, Driver.Dispatch (queue worker 0x0) 2.5, Vulkan.DispatchRecipe (queue worker 0x0) 1.3 - batch 1139: 41.4 ms at 28443 ms, present 2920: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 2.2, Driver.Packet.dispatch (queue worker 0x0) 2.0, Driver.Dispatch (queue worker 0x0) 1.9, Vulkan.DispatchRecipe (queue worker 0x0) 0.4 - batch 897: 41.4 ms at 22580 ms, present 2916: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 1.8, Driver.Packet.dispatch (queue worker 0x0) 1.5, Driver.Dispatch (queue worker 0x0) 1.5, Vulkan.DispatchRecipe (queue worker 0x0) 0.7 - batch 779: 41.3 ms at 19993 ms, present 2914: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 0.6, Driver.Packet.dispatch (queue worker 0x0) 0.4, Driver.Dispatch (queue worker 0x0) 0.4, Vulkan.DispatchRecipe (queue worker 0x0) 0.3 - batch 955: 41.3 ms at 24025 ms, present 2917: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 0.2, Driver.Packet.flush_between_packets (queue worker 0x0) 0.1, Driver.Packet.dispatch (queue worker 0x0) 0.1, Recorder.Submit (queue worker 0x0) 0.1 </details> <details><summary>trace_digest.py of B (07f624d854)</summary> **seconds 960:30** from present 1815: 19 presents, frame p50 1438.8 / p90 2203.1 / p99 2511.8 / max 2511.8 ms, GPU busy 255.7 ms per present NVIDIA GeForce RTX 3070 Laptop GPU, NVIDIA 617.42, Windows 10.0.26300, 3840x2160, commit 07f624d854fb, dropped: no ```json {"commit":"07f624d854fb","dirty":false,"env":{"APS5_HOST_IMPORT_MIB":"6400","APS5_LAZY_SHADER_PREPARE":"1","APS5_NO_GPL":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_SECONDS":"960:30"},"gpu":"NVIDIA GeForce RTX 3070 Laptop GPU","driver":"NVIDIA 617.42","os":"Windows 10.0.26300","cpu":"AMD Ryzen 9 5900HS with Radeon Graphics","cpu_threads":16,"memory_mib":15776,"title_id":"PPSA01556","title":"Resident Evil Village","content_version":"01.210.000","resolution":"3840x2160","window":{"spec":"seconds 960:30","first_present":1815,"ms":30085.902},"presents":19,"frame_ms":{"p50":1438.787,"p90":2203.059,"p99":2511.784,"max":2511.784},"gpu_busy_ms_per_present":255.744,"worker_busy_pct":{"queue worker 0x0":94.143,"queue worker 0x38":0.263,"queue worker 0x28":87.619,"queue worker 0x20":83.028},"top_phases_ms_per_frame":{"Driver.Packet":4195.016,"Driver.Packet.memory_wait":2410.236,"Driver.Packet.draw":1091.817,"Driver.Draw":1090.727,"Graphics.Draw":809.924,"Graphics.Draw.draw_and_resource_release":788.767,"Driver.Packet.dispatch":649.726,"Driver.Dispatch":595.737},"trace_dropped":false,"trace":"aps5-trace-07f624d854fb-36204.json.gz"} ``` **Slowest frames** (largest slices inside each, inclusive) - present 1818: 2511.8 ms at 5778 ms: Driver.WorkerWait (queue worker 0x38) 2508.9, Driver.WorkerWait.dequeue_order (queue worker 0x38) 2501.5, Driver.Packet (queue worker 0x0) 2491.6, Driver.Packet (queue worker 0x28) 2380.0 - present 1815: 2203.1 ms at 0 ms: Driver.Packet (queue worker 0x0) 608.2, Driver.Packet.dispatch (queue worker 0x0) 547.6, Driver.Dispatch (queue worker 0x0) 522.9, GpuMutex.wait.dispatch (queue worker 0x0) 315.3 - present 1817: 2086.2 ms at 3691 ms: Driver.WorkerWait (queue worker 0x38) 2085.5, Driver.WorkerWait.dequeue_order (queue worker 0x38) 2080.5, Driver.Packet (queue worker 0x0) 2065.6, Driver.Packet (queue worker 0x28) 1986.3 - present 1831: 1957.3 ms at 25030 ms: Driver.WorkerWait (queue worker 0x38) 1956.2, Driver.WorkerWait.dequeue_order (queue worker 0x38) 1950.6, Driver.Packet (queue worker 0x0) 1938.5, Driver.Packet (queue worker 0x28) 1850.0 - present 1827: 1891.9 ms at 18993 ms: Driver.WorkerWait (queue worker 0x38) 1890.6, Driver.WorkerWait.dequeue_order (queue worker 0x38) 1884.8, Driver.Packet (queue worker 0x0) 1875.6, Driver.Packet (queue worker 0x28) 1806.1 **Threads** (ms per frame) | thread | busy | wait | untraced | in slices < 20 us | largest | |---|---|---|---|---|---| | queue worker 0x0 | 1089.9 (69 %) | 401.2 (25 %) | 92.4 | 85.7 | Driver.Packet 1480.6, Recorder.Sync 3.7 | | draw committer | 628.2 (40 %) | 45.0 (3 %) | 910.2 | 4.5 | Graphics.Draw 640.6, Recorder.Submit 3.9 | | presenter | 25.9 (2 %) | 4.6 (0 %) | 1553.0 | 0.1 | VideoOut.Flip 22.4, Driver.Present 8.0 | | queue worker 0x38 | 3.9 (0 %) | 1383.6 (87 %) | 195.9 | 0.8 | Driver.Packet 3.9, Driver.EndSubmission 0.1 | | queue worker 0x28 | 26.2 (2 %) | 1441.4 (91 %) | 115.8 | 0.2 | Driver.Packet 1386.8, Driver.EndSubmission 0.5 | | queue worker 0x20 | 141.6 (9 %) | 1348.7 (85 %) | 93.2 | 4.6 | Driver.Packet 1312.8, Vulkan.Dispatch 7.3 | | gpu | 233.5 (15 %) | 0.0 (0 %) | 1350.0 | 0.0 | batch 233.5 | **Largest slices** (ms per frame, inclusive, all threads): Driver.Packet 4184.1, Driver.Packet.memory_wait 2410.1, Driver.WorkerWait 1639.1, Driver.WorkerWait.dequeue_order 1381.6, Driver.Packet.draw 1090.9, Driver.Draw 1089.8, Graphics.Draw 809.3, Graphics.Draw.draw_and_resource_release 787.9, Driver.Packet.dispatch 648.6, Driver.Dispatch 594.5 **Longest waits** - Driver.WorkerWait (queue worker 0x38) 2509.4 ms at 5781 ms, present 1818 - Driver.WorkerWait (queue worker 0x38) 2085.3 ms at 3693 ms, present 1817 - Driver.Packet.memory_wait (queue worker 0x28) 2056.8 ms at 5941 ms, present 1818 - Driver.WorkerWait (queue worker 0x38) 1956.1 ms at 25031 ms, present 1831 - Driver.WorkerWait (queue worker 0x38) 1890.8 ms at 18995 ms, present 1827 - Driver.Packet.memory_wait (queue worker 0x28) 1816.0 ms at 3845 ms, present 1817 - Driver.Packet.memory_wait (queue worker 0x28) 1689.8 ms at 25170 ms, present 1831 - Driver.Packet.memory_wait (queue worker 0x28) 1650.0 ms at 19134 ms, present 1827 - Driver.Packet.memory_wait (queue worker 0x20) 1637.9 ms at 5908 ms, present 1818 - Driver.Packet.memory_wait (queue worker 0x20) 1602.1 ms at 3808 ms, present 1817 **Largest GPU batches** (GPU ranges inside, and the CPU slices that recorded each, inclusive) - batch 694: 41.9 ms at 19138 ms, present 1827: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 3.0, Driver.Packet.dispatch (queue worker 0x0) 2.0, Driver.Dispatch (queue worker 0x0) 1.9, Driver.Packet.flush_between_packets (queue worker 0x0) 1.0 - batch 95: 41.8 ms at 3861 ms, present 1817: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 0.2, Driver.Packet.dispatch (queue worker 0x0) 0.1, Driver.Dispatch (queue worker 0x0) 0.1, Driver.Packet.flush_between_packets (queue worker 0x0) 0.1 - batch 569: 41.6 ms at 16447 ms, present 1825: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 0.1, Driver.Packet.dispatch (queue worker 0x0) 0.1, Driver.Dispatch (queue worker 0x0) 0.1, Driver.Packet.flush_between_packets (queue worker 0x0) 0.1 - batch 935: 41.6 ms at 25173 ms, present 1831: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 1.7, Driver.Packet.dispatch (queue worker 0x0) 1.5, Driver.Dispatch (queue worker 0x0) 1.4, Vulkan.DispatchRecipe (queue worker 0x0) 0.5 - batch 159: 41.6 ms at 5964 ms, present 1818: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 474.3, Driver.Packet.draw (queue worker 0x0) 461.8, Driver.Draw (queue worker 0x0) 461.4, Driver.Draw.draw_enqueued (queue worker 0x0) 154.9 </details> - **The self-check, in Village:** one boot to menu +15 with `APS5_VERIFY_UNTRACKED_PROOFS=1`. After every fast proof that accepted a surface over untracked memory by its stamp, hinted or epoch, the full walk ran too. - **The result:** 38,000 such proofs were checked, from boot through the menu, and **0 disagreed**. That's all 38 of its `[verify-untracked]` lines; the last reads `38000 fast proofs over untracked memory checked by the full walk, 0 disagreed`. - **How it was built:** the boot was a diagnostic build of this change that prints the count every 1,000 checks instead of every 100,000. - **Not a speed figure:** the self-check's extra walks slow the boot. ### Grand Theft Auto V (PPSA04263), by @chitters2004 On Windows 11, a Ryzen 7 5800X and an RTX 3080 (driver 621.01), with the same machine, scene and save in both arms. - **Story gameplay, 12 s trace windows, runs alternating** ([comment](https://github.com/boykopovar/AnyPS5/pull/12921#issuecomment-6537640927)). The base is `e8efeed58a` + #11580, since `main` stops at Story load. The change merges 23ef222060 into it, so it adds #6192's four commits and this PR's together. - Frame p50: 104.3 and 106.6 ms in the base, 87.9 and 82.6 ms with the change. p99: 117.1 and 120.6 ms, against 97.4 and 94.0 ms. - Draw committer busy: 82.6 and 84.7 ms, against 65.6 and 60.7 ms. GPU busy stays at about 36 ms. - With `APS5_PROFILE_DRAW=1`, `Revalidate` full walks refused by `collect` fell from 3,380 to 1,530 ms per 10 s. - Two of about 70 boots of the change crashed on the title's main thread about 21 s in, against none of about 40 on the base. Both read a garbage length while parsing audio metadata. The count is too small to tie to either side. - **The Story gain, split** ([comment](https://github.com/boykopovar/AnyPS5/pull/12921#issuecomment-6538271696)): both arms are the same merge, and in the first, `untrackedRangeStamp`'s hinted branch is removed, so every proof takes #6192's epoch stamp. Two runs each, alternating, with no crashes. - Frame p50: 81.2 and 83.2 ms with the hinted stamp off, against 84.3 and 83.3 ms with this PR. p99: 88.5 and 89.4 ms, against 97.3 and 92.1 ms. - So on this title the Story gain comes from #6192, and this PR's hinted stamp adds nothing measurable. - **Why the hint doesn't apply here:** about 21,000 of the 21,500 `collect` refusals per 10 s are on plain sampled snapshots recorded with the epoch stamp. `GuestArenaCollectWrites` refuses their ranges: in one 10 s sample, all 19,091 refusals came from `collectable`, on direct-memory pages marked `comparedWhenShared`. So `walkHints` fails and `UntrackedHint` returns 0. This is the shared-pages case under What's "Unhinted ranges". - **This PR alone, in the North Yankton prologue** ([comment](https://github.com/boykopovar/AnyPS5/pull/12921#issuecomment-6503637734), [timings](https://github.com/boykopovar/AnyPS5/pull/12921#issuecomment-6510812689)): `main` 52c09d567d + #11580 + #6192 against the same plus this PR, three runs each. - FPS 12.30, 12.61 and 12.78 against 12.24, 12.48 and 12.12: no change outside the run-to-run spread. - The proof self-check (`APS5_VERIFY_UNTRACKED_PROOFS=1 APS5_VERIFY_PROOFS=1`) compared 300,000 fast proofs with the full walk, with 0 disagreements. - Hinted stamps took about 10,000 checks per 10 s there, all passing, at about 1.1 µs each. ### Grand Theft Auto V (PPSA04264), by @Nesyth Windows 11 Pro 26300, a Radeon RX 7900 XTX (AMD Software 26.10.1), a Ryzen 7 7800X3D, 3840x2160 output. Version 01.011.001 in the Performance graphics mode, gameplay of the opening level with warm caches ([comment](https://github.com/boykopovar/AnyPS5/pull/12921#issuecomment-6603037477)). The arms are `main` 9090972b7e and the same commit with this PR's head 793fc7f8ea merged, so the second carries #6192's four commits as well as this PR's. Each run is a separate boot, and FPS is the window title's counter over 57 s of scripted gameplay. - **FPS without profiling:** 14.46 on `main`, against 17.32 and 18.70 with the change (+20 to +29 %). With `APS5_PROFILE_DRAW=1`: 12.78 and 13.56, against 15.60 and 16.36. - **The draw committer bounds the frame in this mode** (about 88 % busy on `main`). Draw commit: 39.9 and 37.6 µs, against 31.3 and 30.3 µs. Collect full walks: 3.83 and 3.58 s per 10 s, against 2.42 and 2.22 s. Collect refusals per 10 s: 50,181 over 163 surfaces and 41,172 over 125, against 30,269 over 120 and 30,118 over 119. Every remaining refusal is counted as unwatched. - **No new warnings:** both builds print the same 8 storage-image "keeping the CPU's blocks" lines per run, with no BDA or device faults. - This pair compares `main` with #6192 and this PR together, so it doesn't separate their shares. On the Story save above, the split put the gain on #6192. ### Tested - **`agc_untracked_hint_proof` (new),** with two sampled 64 KiB surfaces over write-watched, host-imported, then unwatched memory: - **Red/green:** after a collect epoch with no write, the proof is fast exactly when the block has a hint. - **Controls:** a CPU store after a bump; a `MarkWritten` driver store; a recorded GPU write note, before and after the write is reaped; and a CPU store made after the hint is sampled but before the stamp is recorded, through a flush hook. - Each control must walk and take the new content, and `settle` re-proves the stamps after each one. No case asserts a throw. - **Red/green on Windows** (RTX 3070 Laptop, driver 617.42, Windows 10.0.26300): - **Red:** the new test on #6192's code (ported onto main) fails at "a proof over a hinted untracked range walked after a collect epoch with no write". The test prints "the block has a write-watch hint". - **Green:** `agc_untracked_hint_proof`, `agc_untracked_revalidate` and `agc_untracked_forget` passed 10 of 10 each. - **Linux** (lavapipe, Ubuntu 24.04, GCC 13.3, Release, CI's flags), on this head's tree: - `agc_untracked_hint_proof`, `agc_untracked_revalidate` and `agc_untracked_forget` passed 20 of 20 each. Linux has no hints, so the new test runs there under the epoch rule and checks that nothing changes. - `ctest -R '^agc' --parallel 4`: 1,119 tests: 1,046 passed, 73 skipped, 0 failed. - Without the teardown fix, `agc_untracked_forget` crashes on lavapipe 20 of 20 times. - **Checks:** `check_conventions.py` and `check_test_registration.py` pass. MinGW-w64 `-fsyntax-only` adds no errors or warnings to `main`'s. Nothing under `core/shader/**` changes, so the shader cache key is unchanged. - **GitHub, ×10, with the Khronos validation comparison on Linux** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/40868978247)). The comparison arm is #6192 merged with `main` plus the teardown fix (e440b742c3), so it differs from this head only by the hint key. - **Linux:** `agc_untracked_hint_proof`, `agc_untracked_revalidate` and `agc_untracked_forget` passed 10 of 10 under validation. - **Linux `^agc` under validation:** 1,119 run, 73 skipped, 1 failed. The failure is `agc_driver_image_table`, whose only validation message is `VUID-VkDeviceCreateInfo-pNext-pNext` from `vkCreateDevice` ("unknown VkStructureType (1000574000) ... version 275 of the Vulkan header"). That's the runner's validation layer being older than the headers. The comparison arm fails that test the same way, and the change adds no VUID. - **Windows runner:** 1,144 run, 812 skipped, 0 failed. The three tests skip there, because the runner has no Vulkan device, so on Windows this is a build and no-crash check. The device evidence for Windows is the RTX 3070 red/green above. It ran on the same library lines as this head; only the test-only teardown fix is newer. - **Suites:** the libc and libkernel suites, run with `APS5_SKIP_TIMING_TESTS=1`, pass: 191 and 291 on Linux, 220 and 314 on Windows. - **`agc_driver_image_table` without the validation layer** ([run 40890382693](https://github.com/EagleBearerYS/AnyPS5/actions/runs/40890382693)) passes on both sides. On Linux, it ran with the branch's 78 tests: 71 passed, 7 skipped, 0 failed. On Windows, 94 ran, 4 passed and 90 skipped, since the runner has no device. The suites match the run above. - **31dff937b5, a merge of `main` 673fa865f4**, which brings johandavidcm's #11550 ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/40980756803)). - **The conflicts:** both were in `fastRevalidate`, in lines #6192 changes. #11550 counts each collect refusal with `countCollectRefusal`, and #6192 lets an untracked surface whose stamp still matches pass instead of refusing. - **The resolution:** `countCollectRefusal` now sits inside #6192's stamp check, just before `return fail(FastFail::Collect)`. So only collects that are still refused are counted, and an untracked surface its stamp proves isn't. - This PR's own lines are unchanged. - **×10:** #11550's `agc_driver_resource_cache_collect_refusals`; the untracked-proof tests `agc_untracked_revalidate`, `agc_untracked_forget` and `agc_untracked_hint_proof`; `agc_write_tracking`; and the `^agc_driver_image_table` tests, with the tests for the files the merge changes. - Linux: 87 run, 79 pass, 8 skip, 0 fail. - Windows: 103 run, 6 pass, 97 skip (no Vulkan device), 0 fail. - The libc and libkernel suites run 194 and 294 tests on Linux and 224 and 317 on Windows, with 0 failed. The suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. - **2b74a6c5d5, cross-thread cases** (test-only). - **`agc_untracked_hint_proof`** gains three cases: - another thread stores right after the first surface's compare, from inside the flush hook; - another thread stores after a fast proof; - the check itself runs on another thread. - **`agc_write_tracking`** gains a device-free case on Windows: - a store from one thread is seen by another thread's walk; - the stamps are shared, so a thread still in its old epoch reads the newer hint, and so does the next epoch; - a writer races across 50 epochs. - **Green on Windows** (RTX 3070 Laptop, driver 617.42): - `agc_untracked_hint_proof`, `agc_untracked_revalidate`, `agc_untracked_forget` and `agc_write_tracking` pass 10 of 10 each. - The hint proof printed "the block has a write-watch hint" in all 10 runs, so the hinted path ran. - `agc_write_tracking` alone passes 20 of 20. - **GitHub, ×10** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/40991368062)): - Linux: 79 run, 71 pass, 8 skip, 0 fail. - Windows: 102 run, 12 pass, 90 skip (no Vulkan device), 0 fail. `agc_write_tracking`'s device-free cases run there. - The libc and libkernel suites run 194 and 294 tests on Linux and 224 and 317 on Windows, with 0 failed. The suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. - **Red, with the `UntrackedHint` memo made to ignore the collect epoch** (a measurement branch, not part of this PR): - On the RTX 3070, `agc_write_tracking` fails with "the last store of a racing thread did not move the hint past every value read before it", and `agc_untracked_hint_proof` fails at its existing step, "a CPU store after a collect epoch kept the fast proof". - On GitHub ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/40991533432)), Windows fails `agc_write_tracking` with the same message, and `agc_untracked_hint_proof` skips there. Linux passes: it has no write-watch hints, so its ranges keep the epoch stamp. - **Taking the hint after the compare has no deterministic red.** The only hook in that path runs before both reads. - **23ef222060, a merge of `main` 8304ccaedb** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41102416597)). - **The conflict:** one line in `CMakeLists.txt`, the Windows `ENVIRONMENT_MODIFICATION` test list, where #9565 adds `agc_recorder_command_buffer_release`. The resolution is the union of both sides' names, each once. - This PR's own lines are unchanged. The only difference in its diff is that list line, which now carries main's new name. - **×10:** the `^agc_untracked_` tests, `agc_write_tracking`, `agc_driver_recorder` and main's `agc_recorder_command_buffer_release`. - Linux: 81 run, 73 pass, 8 skip, 0 fail. - Windows: 104 run, 12 pass, 92 skip (no Vulkan device), 0 fail. - The libc and libkernel suites run 198 and 307 tests on Linux and 225 and 327 on Windows, with 0 failed. The suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. - **8bee4cadbf, a merge of `main` 0836dfdf4f** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41240389134)). #12862 moved `libSceAgcDriver`'s test registrations into `tests/cmake/`; the conflict in `CMakeLists.txt` is resolved with `tools/agc_test_split.py resolve`, which moves this PR's registrations into `tests/cmake/agc_driver_recorder_tests.cmake` (+7 −1). Nothing else conflicted. Apart from the move, this PR's diff is unchanged. With `-DBUILD_TESTING=ON`, `ctest -N` gives 3078 tests: `main`'s 3075 plus its 3 tests, each listed once. `agc_driver_recorder`, `agc_recorder_command_buffer_release`, `agc_untracked_forget`, `agc_untracked_hint_proof`, `agc_untracked_revalidate`, `agc_write_tracking` pass 10 runs in a row. Linux: 6 run, 6 pass, 0 skip, 0 fail. Windows: 6 run, 1 pass, 5 skip (no Vulkan device), 0 fail. Suites: libc and libkernel pass on Linux (199 and 308) and on Windows (226 and 330). The suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. - **793fc7f8ea, the untracked proof tests report a skip when they can't run,** for oneandonlydean's [review](https://github.com/boykopovar/AnyPS5/pull/12921#issuecomment-6557353434) (test-only, `tests/Recorder.cpp`). `untrackedForgetTests`, `untrackedRevalidateTests` and `untrackedHintProofTests` return `false` at each of their 10 early outs and `true` at the end, and their `--untracked-*-only` branches return `? 0 : 77`, as `SKIP_RETURN_CODE 77` expects. - **×10** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41302695463)): Linux: 3 run, 3 pass, 0 skip, 0 fail. Windows: 3 run, 0 pass, 3 skip (no Vulkan device), 0 fail. The libc and libkernel suites run 199 and 308 tests on Linux and 226 and 330 on Windows, with 0 failed. The suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. - **The new skips aren't reached on GitHub's runners:** Linux runs all three in full at both heads ([before](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41302704235)), and Windows skips the binary before them at both heads. - **AMD Radeon RX 6300 (RADV NAVI24, Mesa 25.2.8)** at 793fc7f8ea, from TechLevelZero's AMD bot ([report](https://github.com/boykopovar/AnyPS5/pull/12921#issuecomment-6561320165)): this head merged onto `main` 291e02d, Ubuntu 26.04.1, 2,540 of 3,155 tests selected. - 2,477 passed, 9 failed and 54 skipped. None of the failures is new: all 9 also fail on `main`. - With `VK_LAYER_KHRONOS_validation`, no new validation IDs over 934 GPU tests. `agc_untracked_forget`, `agc_untracked_revalidate` and `agc_untracked_hint_proof` passed on the GPU, so they ran in full there, since this head reports 77 when they can't. They aren't in `main`'s baseline, so their validation wasn't compared. - **NVIDIA RTX 2000 Ada Generation** at 793fc7f8ea, from TechLevelZero's NVIDIA bot ([report](https://github.com/boykopovar/AnyPS5/pull/12921#issuecomment-6561412446)): this head merged onto `main` e6f5730, driver 595.99.02, Ubuntu 26.04.1, 2,535 of 3,148 tests selected. - 2,484 passed, 6 failed and 45 skipped. None of the failures is new: 3 also fail on `main`, and 3 are unstable on `main`. - With `VK_LAYER_KHRONOS_validation`, no new validation IDs over 934 GPU tests. The three `agc_untracked_*` tests passed on the GPU, so they ran in full there too. They aren't in `main`'s baseline, so their validation wasn't compared. - **38dc520c3f, oneandonlydean's merge of `main` f6232fcfda.** It resolves the conflicts in `ShaderResources.hpp` and `tests/cmake/agc_driver_recorder_tests.cmake`. This PR's own lines are unchanged. The only difference in its diff is the Windows `ENVIRONMENT_MODIFICATION` list line, which now carries main's `agc_window_import_unmap`. - **NVIDIA RTX 2000 Ada Generation** at 38dc520c3f, from TechLevelZero's NVIDIA bot ([report](https://github.com/boykopovar/AnyPS5/pull/12921#issuecomment-6597108567)): this head merged onto `main` f6232fc, driver 595.99.02, Ubuntu 26.04.1, 2,795 of 3,743 tests selected. 2,740 passed, 6 failed and 49 skipped. None of the failures is new: 3 also fail on `main`, and 3 are unstable on `main`. With `VK_LAYER_KHRONOS_validation`, no new validation IDs over 937 GPU tests. - **8468301cdd, a merge of `main` 4f41f4c375** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41602180594)). - **The conflicts:** two, each resolved by keeping both sides. In `Texture.hpp`, `main`'s new `OccasionalLabelStores` declaration and this PR's `HintedComparison` declaration are adjacent, and both stay. In `tests/cmake/agc_driver_recorder_tests.cmake`, the Windows `ENVIRONMENT_MODIFICATION` list, where `main` adds `agc_changed_copy`, the resolution is the union of both sides' names, each once. This PR's own lines are unchanged, and that list line is the only difference in its diff. - **×10:** `agc_changed_copy`, `agc_recorder_read_list` and every test matching `^agc_untracked` or `^guest_memory`. Linux: 9 run, 9 pass, 0 skip, 0 fail. Windows: 8 run, 3 pass, 5 skip (no Vulkan device), 0 fail. The libc and libkernel suites run 300 and 322 tests on Linux and 327 and 342 on Windows, with 0 failed. The suites ran with `APS5_SKIP_TIMING_TESTS=1`, which relaxes `precise_wait`'s median bounds on GitHub's hosted runners. ### 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: #14262 (oneandonlydean's carry of #6192, which stacks on #14261, the carry of #6187); merge order: after #12745, since both change `Graphics/src/ShaderResources.cpp` and conflict there, and this PR takes the second merge with the test-only update on `test/untracked-proof-index-on-12921` - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: NVIDIA GeForce RTX 3070 Laptop GPU (617.42); NVIDIA GeForce RTX 3080 (621.01), Windows 11 (Grand Theft Auto V, chitters2004); AMD Radeon RX 7900 XTX (AMD Software 26.10.1), Windows 11 (Grand Theft Auto V, Nesyth); lavapipe; AMD Radeon RX 6300 (RADV NAVI24, Mesa 25.2.8), Ubuntu 26.04.1 (tests, TechLevelZero's AMD bot); NVIDIA RTX 2000 Ada Generation (driver 595.99.02), Ubuntu 26.04.1 (tests, TechLevelZero's NVIDIA bot) - [x] AI-assisted: yes
CnRJay commented 2026-10-29 18:51:38 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by CnRJay on 2026-10-29T18:51:38Z.

Review: COMMENTED


The measurement does not isolate this change, and the fast path it extends gets more expensive per proof. Neither point is addressed in the description.

1. The +29.9 % is #6192 plus this PR. The description says so: "#6192 alone wasn't run". The branch carries #6192's four commits, #6187 under them, and a merge of main, so an unrelated diff of about 450 lines is reviewed as one PR. The arms are 4 runs of 0.51–0.83 fps with a 19–25 % spread inside each arm. B ahead of A by 30 % on two runs per arm is not distinguishable from the spread. The only independent run so far is chitters2004's GTA V one above (12.60 vs 12.31 fps, inside the noise), and it says the fast-fails there are on ranges with no hint, where this change does not apply. Please run main + #6192 against main + #6192 + this PR on the Village menu, same machine and scene, with tools/trace_digest.py summaries of both. That is the only comparison that measures this PR.

2. The proof now does more work per surface. For an untracked surface, currentUntrackedStamp calls hintedProof: UntrackedHint, NewestStamp, ForgetStamp and NewestWriteNote. ForgetStamp, which this branch carries from #6192, loops over every 64 KiB block of the range with an acquire load per block. A 3840x2160 RGBA16F target is about 66 MB, which is about 1,000 loads per call, per surface, per proof. GTA shows about 135k fast proofs per 10 s, and each proof can hold several untracked surfaces. The fast path exists because it is cheaper than the full walk; with #6192's loop it costs O(range size) per surface instead of O(1). Keep a single global counter that the forget path bumps, and use the per-block slots only when that counter has moved. Or show the proof cost in the trace.

3. Correctness depends on the hint being up to date. The description says "a store into it moves the hint at the next walk of that page's marks". Between two ordering points no walk happens, so a CPU store after the compare is only visible if something walks those marks before the next check. Please say what guarantees a walk between the compare and the next check on a surface nobody reads through CollectWrites. APS5_VERIFY_UNTRACKED_PROOFS covers the runs listed, but a title that rewrites an untracked surface once per frame from the CPU would show a stale texture instead of a slow frame. The new test would need a case that stores into the range from another thread right after the compare.

4. Smaller points.

  • The "where it comes from" numbers use APS5_PROFILE_DRAW=1. The Performance report form does not accept those for a speed claim. They are fine as explanation, but the claim needs the aps5-summary.jsonl figures from item 1.
  • On Linux and for unhinted ranges nothing changes, so the PR is Windows-only in effect. Say that in the title or in What.
  • "A new storage image has no hinted entry until its first equal compare" means a freshly created image pays the full walk once per recreation. If the title recreates targets per scene change, that cost should be in the numbers too.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5703274169 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12921#pullrequestreview-5703274169). Originally posted by [CnRJay](https://github.com/CnRJay) on 2026-10-29T18:51:38Z. **Review:** COMMENTED --- The measurement does not isolate this change, and the fast path it extends gets more expensive per proof. Neither point is addressed in the description. **1. The +29.9 % is #6192 plus this PR.** The description says so: "#6192 alone wasn't run". The branch carries #6192's four commits, #6187 under them, and a merge of `main`, so an unrelated diff of about 450 lines is reviewed as one PR. The arms are 4 runs of 0.51–0.83 fps with a 19–25 % spread inside each arm. B ahead of A by 30 % on two runs per arm is not distinguishable from the spread. The only independent run so far is chitters2004's GTA V one above (12.60 vs 12.31 fps, inside the noise), and it says the fast-fails there are on ranges with no hint, where this change does not apply. Please run `main` + #6192 against `main` + #6192 + this PR on the Village menu, same machine and scene, with `tools/trace_digest.py` summaries of both. That is the only comparison that measures this PR. **2. The proof now does more work per surface.** For an untracked surface, `currentUntrackedStamp` calls `hintedProof`: `UntrackedHint`, `NewestStamp`, `ForgetStamp` and `NewestWriteNote`. `ForgetStamp`, which this branch carries from #6192, loops over every 64 KiB block of the range with an acquire load per block. A 3840x2160 RGBA16F target is about 66 MB, which is about 1,000 loads per call, per surface, per proof. GTA shows about 135k fast proofs per 10 s, and each proof can hold several untracked surfaces. The fast path exists because it is cheaper than the full walk; with #6192's loop it costs O(range size) per surface instead of O(1). Keep a single global counter that the forget path bumps, and use the per-block slots only when that counter has moved. Or show the proof cost in the trace. **3. Correctness depends on the hint being up to date.** The description says "a store into it moves the hint at the next walk of that page's marks". Between two ordering points no walk happens, so a CPU store after the compare is only visible if something walks those marks before the next check. Please say what guarantees a walk between the compare and the next check on a surface nobody reads through `CollectWrites`. `APS5_VERIFY_UNTRACKED_PROOFS` covers the runs listed, but a title that rewrites an untracked surface once per frame from the CPU would show a stale texture instead of a slow frame. The new test would need a case that stores into the range from another thread right after the compare. **4. Smaller points.** - The "where it comes from" numbers use `APS5_PROFILE_DRAW=1`. The Performance report form does not accept those for a speed claim. They are fine as explanation, but the claim needs the `aps5-summary.jsonl` figures from item 1. - On Linux and for unhinted ranges nothing changes, so the PR is Windows-only in effect. Say that in the title or in `What`. - "A new storage image has no hinted entry until its first equal compare" means a freshly created image pays the full walk once per recreation. If the title recreates targets per scene change, that cost should be in the numbers too.
XairRrR commented 2026-11-03 12:14:31 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by XairRrR on 2026-11-03T12:14:31Z.

Review: COMMENTED


Reviewed — comments

On Linux/lavapipe the merge is clean, it builds, the checks pass, and the three new agc_untracked_* tests pass here and fail on main's production code. Two limits: the PR's own hinted stamp only runs on Windows, so this machine can't exercise it, and the APS5_VERIFY_UNTRACKED_PROOFS self-check cannot detect a stale view or storage image.

What I ran

Head 8468301cddcc8d5ba3992077b94084c449293b1f, main 4f41f4c375f5abb487dbd184fbc150f31994d762, merged tree 5ae2065315ccc0445f9f5092dfbd6ec1d619d5ce. Debian 13 VM (Xeon Gold 6136), GCC 14.2.0, Release, lavapipe (Mesa 26.1.6, LLVM 19).

git diff --check 4f41f4c375f5abb487dbd184fbc150f31994d762...8468301cddcc8d5ba3992077b94084c449293b1f
python3 tools/check_conventions.py --base 4f41f4c375f5abb487dbd184fbc150f31994d762
env VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 ctest --test-dir build -V -R '^agc_driver_native_depth_uniform_planes$'
# negative control: the 6 production files (GuestMemory.hpp/.cpp, ShaderResources.hpp/.cpp, Texture.hpp/.cpp) restored from main
ninja -C build agc_driver_recorder_tests agc_driver_native_multisample_depth_tests
ctest --test-dir build --output-on-failure -R '^agc_untracked_'
env VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 ctest --test-dir build -V -R '^agc_driver_native_depth_uniform_planes$'
# merged files restored, rebuilt
ctest --test-dir build --output-on-failure --repeat until-fail:5 -R '^agc_untracked_|^agc_write_tracking$'
git status --porcelain   # empty

Results

Check Result
git diff --check clean
check_conventions.py all checks passed
Configure / build / libs (script) ok
Selected tests (script) 2,232 run, 2,111 passed, 114 skipped (all expected), 0 new failures, 0 timeouts; the 7 known failures also fail on main
agc_untracked_forget, agc_untracked_revalidate, agc_untracked_hint_proof, agc_write_tracking pass, 5 of 5 in a row; each takes under 0.2 s
Validation (script): new VUID in agc_driver_native_depth_uniform_planes not from this PR. The test is newer than the baseline (d1ae628bc2), so the script had no main result to compare with. With main's production files I get the same 4 × VUID-vkCmdDispatch-groupCountX-00386. The test passes in both.
Validation layer loaded 769 of 770 tests; layer_missing_in is empty
uniform_planes with main's production files
1/1 Test #1852: agc_driver_native_depth_uniform_planes ...   Passed    0.40 sec
4 × Validation Error: [ VUID-vkCmdDispatch-groupCountX-00386 ] | MessageID = 0x8e927036

Negative control

I restored only the six production files from main and rebuilt. All three new tests fail:

output
agc_untracked_revalidate: AGC graphics: a sampled template over untracked memory took the full walk in the same collect epoch
agc_untracked_hint_proof: the block has no write-watch hint: its proofs are expected to follow the collect epoch
                          AGC graphics: a sampled template over untracked memory took the full walk in the same collect epoch
0% tests passed, 3 tests failed out of 3

These failures come from #6192's in-epoch part, which this branch carries. On Linux, UntrackedHint returns 0, so agc_untracked_hint_proof takes its "no hint" branch. The hinted stamp this PR adds (untrackedRangeStamp's hinted[0] != 0 branch, HintedComparison, the hinted proofKey) never runs on this machine, and this control does not cover it. The red/green for that path is the author's RTX 3070 run on Windows. I restored the merged files afterwards; git status --porcelain is empty.

Findings

Blocking

None.

Non-blocking

  1. APS5_VERIFY_UNTRACKED_PROOFS can't detect a stale view or storage image. The check is at core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp:3880. It counts a disagreement only when fullWalk() returns false.
    • fullWalk compares only pointer identity: cachedTexture(...) != textures[textureIndex] at ShaderResources.cpp:3806 and expected != storageTextures[storageIndex] at ShaderResources.cpp:3817.
    • A storage image (and a view of one) is refreshed in place, so the lookup returns the same pointer. A missed store into a view's or storage image's untracked range is therefore never counted.
    • The full walk also refreshes the image as a side effect, so verify mode hides the stale content it is meant to catch.
    • In this PR the hinted stamp applies exactly to views and storage images (through HintedComparison). The "0 disagreed" figures (38,000 in Village, 300,000 in GTA V) are therefore evidence only for snapshots.
    • Suggested fix: record each validatedTextures[i].source and storageTextures[i] Version() before the full walk, and also count a disagreement when any of them moves.
  2. The speed claim doesn't isolate the hinted stamp. CnRJay raised this, and it is still open in the description:
    • The Village pair and Nesyth's GTA V pair measure #6192 and this PR together.
    • The only isolated runs, chitters2004's North Yankton pair and Story split, show no measurable gain from the hinted stamp.
    • The isolated Village pair the author said was queued is not in the description yet.
    • The rules are met (summary lines from two commits and traces are attached), but a run of main + #6192 against main + #6192 + this PR on the Village menu would show whether this PR's own lines pay off.
  3. Not verified here: thread safety of HintedComparison. It reads the mutable, non-atomic comparedRanges of a StorageTexture from captureValidation; compareUntracked writes that array. Please confirm that both run under the same lock (the GPU mutex) or on the same thread.

Not verified

  • The hinted path itself (Windows only). I took the hint-key behaviour, the cross-thread cases in agc_untracked_hint_proof, and CheckUntrackedHintAcrossThreads in agc_write_tracking (compiled only under _WIN32) from the author's RTX 3070 report.
  • Titles. I launched none; per the review rules, no title or game is run.
  • Other GPUs. I tested only lavapipe.

To get this to a good state

  • Make the self-check compare image versions (finding 1). Then rerun it on a title where hinted stamps are taken, so that "0 disagreed" also covers views and storage images.
  • Add the isolated #6192-vs-#6192+this-PR Village measurement, or state in the description that the gain shown is #6192's.
  • Confirm the lock under which HintedComparison reads comparedRanges.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5751970594 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12921#pullrequestreview-5751970594). Originally posted by [XairRrR](https://github.com/XairRrR) on 2026-11-03T12:14:31Z. **Review:** COMMENTED --- # Reviewed — comments On Linux/lavapipe the merge is clean, it builds, the checks pass, and the three new `agc_untracked_*` tests pass here and fail on `main`'s production code. Two limits: the PR's own hinted stamp only runs on Windows, so this machine can't exercise it, and the `APS5_VERIFY_UNTRACKED_PROOFS` self-check cannot detect a stale view or storage image. ## What I ran Head `8468301cddcc8d5ba3992077b94084c449293b1f`, `main` `4f41f4c375f5abb487dbd184fbc150f31994d762`, merged tree `5ae2065315ccc0445f9f5092dfbd6ec1d619d5ce`. Debian 13 VM (Xeon Gold 6136), GCC 14.2.0, Release, lavapipe (Mesa 26.1.6, LLVM 19). ``` git diff --check 4f41f4c375f5abb487dbd184fbc150f31994d762...8468301cddcc8d5ba3992077b94084c449293b1f python3 tools/check_conventions.py --base 4f41f4c375f5abb487dbd184fbc150f31994d762 env VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 ctest --test-dir build -V -R '^agc_driver_native_depth_uniform_planes$' # negative control: the 6 production files (GuestMemory.hpp/.cpp, ShaderResources.hpp/.cpp, Texture.hpp/.cpp) restored from main ninja -C build agc_driver_recorder_tests agc_driver_native_multisample_depth_tests ctest --test-dir build --output-on-failure -R '^agc_untracked_' env VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 ctest --test-dir build -V -R '^agc_driver_native_depth_uniform_planes$' # merged files restored, rebuilt ctest --test-dir build --output-on-failure --repeat until-fail:5 -R '^agc_untracked_|^agc_write_tracking$' git status --porcelain # empty ``` ## Results | Check | Result | |---|---| | `git diff --check` | clean | | `check_conventions.py` | all checks passed | | Configure / build / libs (script) | ok | | Selected tests (script) | 2,232 run, 2,111 passed, 114 skipped (all expected), 0 new failures, 0 timeouts; the 7 known failures also fail on `main` | | `agc_untracked_forget`, `agc_untracked_revalidate`, `agc_untracked_hint_proof`, `agc_write_tracking` | pass, 5 of 5 in a row; each takes under 0.2 s | | Validation (script): new VUID in `agc_driver_native_depth_uniform_planes` | **not from this PR.** The test is newer than the baseline (`d1ae628bc2`), so the script had no `main` result to compare with. With `main`'s production files I get the same 4 × `VUID-vkCmdDispatch-groupCountX-00386`. The test passes in both. | | Validation layer loaded | 769 of 770 tests; `layer_missing_in` is empty | <details><summary>uniform_planes with main's production files</summary> ``` 1/1 Test #1852: agc_driver_native_depth_uniform_planes ... Passed 0.40 sec 4 × Validation Error: [ VUID-vkCmdDispatch-groupCountX-00386 ] | MessageID = 0x8e927036 ``` </details> ## Negative control I restored only the six production files from `main` and rebuilt. All three new tests fail: <details><summary>output</summary> ``` agc_untracked_revalidate: AGC graphics: a sampled template over untracked memory took the full walk in the same collect epoch agc_untracked_hint_proof: the block has no write-watch hint: its proofs are expected to follow the collect epoch AGC graphics: a sampled template over untracked memory took the full walk in the same collect epoch 0% tests passed, 3 tests failed out of 3 ``` </details> These failures come from #6192's in-epoch part, which this branch carries. On Linux, `UntrackedHint` returns 0, so `agc_untracked_hint_proof` takes its "no hint" branch. The hinted stamp this PR adds (`untrackedRangeStamp`'s `hinted[0] != 0` branch, `HintedComparison`, the hinted `proofKey`) never runs on this machine, and this control does not cover it. The red/green for that path is the author's RTX 3070 run on Windows. I restored the merged files afterwards; `git status --porcelain` is empty. ## Findings ### Blocking None. ### Non-blocking 1. **`APS5_VERIFY_UNTRACKED_PROOFS` can't detect a stale view or storage image.** The check is at `core/libs/prx/libSceAgcDriver/Graphics/src/ShaderResources.cpp:3880`. It counts a disagreement only when `fullWalk()` returns false. - `fullWalk` compares only pointer identity: `cachedTexture(...) != textures[textureIndex]` at `ShaderResources.cpp:3806` and `expected != storageTextures[storageIndex]` at `ShaderResources.cpp:3817`. - A storage image (and a view of one) is refreshed in place, so the lookup returns the same pointer. A missed store into a view's or storage image's untracked range is therefore never counted. - The full walk also refreshes the image as a side effect, so verify mode hides the stale content it is meant to catch. - In this PR the hinted stamp applies exactly to views and storage images (through `HintedComparison`). The "0 disagreed" figures (38,000 in Village, 300,000 in GTA V) are therefore evidence only for snapshots. - Suggested fix: record each `validatedTextures[i].source` and `storageTextures[i]` `Version()` before the full walk, and also count a disagreement when any of them moves. 2. **The speed claim doesn't isolate the hinted stamp.** CnRJay raised this, and it is still open in the description: - The Village pair and Nesyth's GTA V pair measure #6192 and this PR together. - The only isolated runs, chitters2004's North Yankton pair and Story split, show no measurable gain from the hinted stamp. - The isolated Village pair the author said was queued is not in the description yet. - The rules are met (summary lines from two commits and traces are attached), but a run of `main` + #6192 against `main` + #6192 + this PR on the Village menu would show whether this PR's own lines pay off. 3. **Not verified here: thread safety of `HintedComparison`.** It reads the mutable, non-atomic `comparedRanges` of a `StorageTexture` from `captureValidation`; `compareUntracked` writes that array. Please confirm that both run under the same lock (the GPU mutex) or on the same thread. ## Not verified - **The hinted path itself (Windows only).** I took the hint-key behaviour, the cross-thread cases in `agc_untracked_hint_proof`, and `CheckUntrackedHintAcrossThreads` in `agc_write_tracking` (compiled only under `_WIN32`) from the author's RTX 3070 report. - **Titles.** I launched none; per the review rules, no title or game is run. - **Other GPUs.** I tested only lavapipe. ## To get this to a good state - Make the self-check compare image versions (finding 1). Then rerun it on a title where hinted stamps are taken, so that "0 disagreed" also covers views and storage images. - Add the isolated #6192-vs-#6192+this-PR Village measurement, or state in the description that the gain shown is #6192's. - Confirm the lock under which `HintedComparison` reads `comparedRanges`. <!-- anyps5-bots job=2297 head=8468301cddcc8d5ba3992077b94084c449293b1f -->

Pull request closed

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!12921
No description provided.