perf(agc): bypass the draw cache while its hit rate is under 5% #12478

Closed
EagleBearerYS wants to merge 13 commits from upstream-pr/12478 into main
EagleBearerYS commented 2026-10-28 15:43:37 +00:00 (Migrated from github.com)

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


What

Based on @bcortezf's #5404, which they closed on 2026-10-22. This is their bypass on current main, with their co-authorship in the commit.

When two windows of 2,048 draw-cache lookups in a row each have fewer than 5% useful lookups, the next 2,048 draws neither look up nor insert draw entries. Each further low window in a row doubles that, up to 16,384, and a window at or above 5% ends the run. A lookup counts as useful when the whole draw hits, when a cached draw of the same shape is found (before its data and push-offset checks decide whether a stage is reused), or when its draw key was seen before, since the cache admits the draw at that sighting.

  • APS5_DRAW_CACHE_BYPASS_PERCENT sets the threshold (default 5). 0 never bypasses, and values above 100 count as 100. Its row is in ENVIRONMENT.md.
  • With APS5_PROFILE_DRAW, [draw-cache] bypassed N draws (10 s): useful lookups stayed under 5% for two or more windows in a row reports how many draws skipped the cache. The bypass counts them in an atomic, so a bypassed draw takes no lock.
  • The bypassed draws take the path useDrawEntries == false already takes (the same as APS5_NO_DRAW_SRT_ENTRIES), so no new draw path is added.

On @oneandonlydean's review of #5404 (comment):

  • Stage hits now count (ab71996739). useDrawEntries still gates stageEntries, so a bypassed draw also skips stage reuse. But the window now counts a lookup as useful when the whole draw hits, or when a cached draw of the same shape is found for one of its stages (the data-only path), before the data and push-offset checks decide whether that stage is reused. So a scene whose whole-draw keys miss while its stages hit keeps the cache, as you suggested.

    On Resident Evil Village (PPSA01556)'s main menu, stage reuse was small anyway. These are the [draw-cache] lines of two profiled runs of the same menu on a local tree without the bypass, at menu +15 min:

    • with the 256 MiB budget, 0 whole-draw hits and 0 stage validations in about 3,000 lookups per 10 s;
    • with the budget off, 88 to 115 whole-draw hits per 10 s (about 4%), and 176 to 230 of 424 to 512 stage validations equal.
  • One window word (ab71996739). The window's hits and lookups are now one 64-bit word updated by a single compare-exchange, so exactly one caller closes each window.

  • The exact threshold (b7001db47d). The minimum is ceil(2048 × percent / 100), 103 hits at 5%. So 102 hits in 2,048 lookups (4.98%) bypasses and 103 keeps the cache, matching "fewer than 5%".

  • Speed at main's defaults (the 256 MiB budget from #9129 on, the bypass at 5%): this description claims no speed gain for the current head.

    • Before the warm-up fix below, a8e7e2f8a7 ran Resident Evil Village (PPSA01556)'s menu 26% faster than main 319621ba2e, and saved no memory (Tested).
    • On 14209e93ba, with the warm-up fix, a pair on main ebb4075168 shows no measurable gain (Tested).
    • On 167947744a, a pair on main 6472c708ae ran 13.3% faster. But in a profiled boot of that tree the bypass starts in none of the measured window's 57 ten-second blocks, so that gain isn't attributed to this change (Tested).
    • Why it doesn't start at that menu: every lookup there finds no entry, so a window's useful lookups can only be sightings of draw keys seen before, which the warm-up rule counts. They keep each window above 5%. The 3.8 GB saving in the older pair below was measured with the budget off.

On @adriadam10's review and @bcortezf's warm-up report (review, report):

  • Warm-up (c7981bcb3b). With second-sight admission a draw hits only at its third sighting. So on a cold scene of about 1,000 or more draws, the first window had almost no hits and started a bypass, during which no sightings were recorded either. Both suggested fixes are in:
    • a lookup whose draw key DrawKeySightings has seen before now counts as useful;
    • the bypass needs two low windows in a row. It starts at 2,048 draws and doubles with each further low window, up to 16,384.
    • Draws whose keys never repeat still reach the 16,384-draw bypass after a few windows.
  • No lock on the bypass path (40973d322a). DrawCacheBypass counts the draws it skips in an atomic, and the draw-cache report takes and resets that count.
  • What the window counts is spelled out above and in the ENVIRONMENT.md row.
  • Base: 14209e93ba merges main ebb4075168. The draw-cache tests ran again on it (Tested), and the Village pair on the new base is in Tested.

On @MarcZX10's review of 14209e93ba (review):

  • Window results apply in window order (11e29b3107).
    • A window closed with one compare-exchange, but its low-window streak was set afterwards with a separate load and store. So a closer preempted in between could overwrite the reset of a useful window closed after it.
    • The window's lookups and useful lookups, the streak and the draws left to bypass now share one 64-bit atomic. The compare-exchange that closes a window also sets its streak and the bypass it starts, and Skip takes its draw from the same word.
    • The policy is unchanged: the existing cases pass unchanged.
  • Base: 05d2faab6c merges main 76fd1c09e9, and the draw-cache tests and the validation comparison ran on it (Tested).

Overlap: tools/pr_overlap.py finds no conflict with any open pull request that merges cleanly with main.

  • #9243 merges cleanly with this change, checked with git merge-tree after its own merge with main.
  • Among those that couldn't be compared because they conflict with main already, #5609 and #6188 share the draw-cache files:
    • #5609 reuses cached stages when only buffer bases moved, so more lookups should hit, and the window counts them;
    • #6188 moves eviction into evictDrawEntries, and also edits DrawCacheStatistics.cpp and DrawCacheReuse.cpp. Whichever merges second keeps both sides there.

Related: #5404, #9129

Profiled boot of 14209e93ba on Resident Evil Village (PPSA01556)'s menu (profiled, not a timing run). It ran under the warm-up fix's rule, where a lookup whose key was seen before counts as useful.

  • Setup: APS5_PROFILE_DRAW=1 with the usual APS5_LAZY_SHADER_PREPARE=1 APS5_NO_GPL=1 APS5_HOST_IMPORT_MIB=6400 APS5_TRACE_SUMMARY_EVERY=10 and the pad script, and no draw-cache variables. RTX 3070 Laptop GPU (NVIDIA 617.42), held 12 min past the menu.
  • Bypass: 9 [draw-cache] bypassed lines in 80 ten-second blocks, 112,640 draws bypassed in all (2,048, 4,096, 8,192, then 16,384 six times). All 9 are in the 8th to 18th blocks, none after.
  • Lookups: 331,056 of 331,072 found no entry, with 2 hits, and the byte budget evicted 33,539 entries.
  • Next: a pair on a variant where a second sighting of a key the budget evicted no longer counts as useful, with the cold-scene case still green. Its result goes into Tested.

The pairs, the captures, the profiled bypassed lines and the light-title run are in Tested.

Tested

  • Tests: agc_driver_draw_cache_low_hit_bypass (default) and agc_driver_draw_cache_low_hit_bypass_off (APS5_DRAW_CACHE_BYPASS_PERCENT=0) run four new cases in DrawCacheReuse.cpp, and agc_driver_draw_cache_cold_scene and its _off run a fifth. The draw-level cases draw only the lookups whose outcome they check and note the rest of each 2,048-lookup window on the driver's bypass (167947744a, below).

    • LowHitRateBypassesTheCache checks that:
      • a window with 103 useful lookups in 2,048 (102 hits and the second sighting that admits a key) keeps the cache, and so does a single window of 102;
      • after two windows of 102 in a row, the next draws are neither looked up nor inserted, and a draw whose pixel constant changed still writes the new colour;
      • the driver's bypass then has 2,046 of its 2,048 draws left, and the draw after them looks up and hits its cached entry;
      • with the bypass off, the same draws are looked up.
    • StageHitsKeepTheCacheLookedUp: after one low window, a window whose only useful lookups are 103 draws whose keys miss but whose vertex stages are reused from the cache keeps the next draw looked up.
    • ConcurrentNotesCloseEachWindowOnce:
      • four threads noting only hits never close a window short;
      • one window of misses then starts no bypass, and a second bypasses exactly 2,048 draws;
      • four threads draining the next bypass skip 4,096 draws, and the bypass's count returns all 6,144 once.
    • LowWindowsLengthenTheBypass: a run of low windows bypasses 2,048, 4,096, 8,192 and then 16,384 draws. A window at 5% ends the run, and the next bypass again waits for two low windows and starts at 2,048. No draw is bypassed before the window that starts the bypass has closed.
    • ConcurrentClosesKeepTheirOrder: a low window closes on one thread while three others note the next, useful window, 256 times. The bypass the two low windows started must be exactly 2,048 draws, one more low window must start none, and a second must start 2,048.
    • ColdSceneKeepsTheCacheLookedUp (--cold-scene): a scene of 1,000 new draws, repeated every frame from cold, hits at least 90% by its fourth frame, with the bypass on and off.
    • Each commit's new cases, red on its parent (Linux, Ubuntu 24.04, GCC 13.3, Release; ^agc_driver_draw_cache ×10 at each commit, 13 tests, 130 of 130 runs, 0 skipped):
      • ab71996739's two cases fail on 3e4d8e25f2;
      • b7001db47d's 102-against-103 case fails on ab71996739 ("draws after a window of 102 hits in 2048 lookups were still looked up or inserted").
    • GitHub, red/green on main 04fefebe90, ×10, for the first commit: on Linux the new case fails with main's code and passes 10 of 10 with this change (13 tests, 0 skipped), and the libc and libkernel suites run with 0 failed (run). On Windows all 13 build and skip, and the suites run with 0 failed.
    • c7981bcb3b's cold-scene case, red on the head before it:
      • With the case added unchanged to 58171b22e8, agc_driver_draw_cache_cold_scene fails on Linux and its _off arm passes (run). On Windows both skip, since the runner has no Vulkan device.
      • 40973d322a's count check uses the TakeBypassed that commit adds, so it doesn't build on its parent.
      • 11e29b3107's ConcurrentClosesKeepTheirOrder passes on both 11e29b3107 and its parent. The old code's gap can't be forced through the API without a hook in production code. Every existing case passes unchanged on 11e29b3107, which shows the single-threaded policy is the same.
    • GitHub ×10 on a8e7e2f8a7, a merge of main 319621ba2e (clean; the PR's patch-id is unchanged) (run):
      • Linux: 13 run, 13 pass, 0 skip.
      • Windows: 13 skip, since the runner has no Vulkan device.
      • With APS5_SKIP_TIMING_TESTS=1, the libc and libkernel suites run 171 and 291 tests on Linux and 199 and 314 on Windows, with 0 failed.
    • Windows on an RTX 3070 Laptop GPU, for the first commit, on the pair's tree (the same code, 7bc49ce4d0): both pass, in 24.3 s and 5.6 s. The GitHub Windows runner skips them, as it has no Vulkan device.
  • check_conventions.py passes, with no comment lines added.

  • Validation comparison (VERIFY_VALIDATION=1 on GitHub's Linux runner, llvmpipe (LLVM 20.1.2, Mesa 25.2.8), the two bypass tests and every ^agc_driver_draw_cache test):

    • a8e7e2f8a7's tree (7157a5bf59, main 319621ba2e against it): 13 passed, 0 skipped. VUID-VkDeviceCreateInfo-pNext-pNext appears in both arms, and the change adds none (run).
    • The first commit (main 04fefebe90 against 3e4d8e25f2): the same result (run).
    • Windows: the GitHub runner skips the tests, as it has no Vulkan device.
  • Resident Evil Village (PPSA01556), draw cache at main's defaults, static main menu, on a8e7e2f8a7 (before the warm-up fix). 16 min each run after a warm-up past the menu, unprofiled, B A A B, 2026-10-28.

    • Machine: Windows 11 (10.0.26300), RTX 3070 Laptop GPU (NVIDIA 617.42), Ryzen 9 5900HS, 16 GB. GPU clocks weren't held: 0% of the 250 ms samples were in P8, and the mean graphics clocks were within about 5% across the four runs (1,298 to 1,367 MHz).
    • Trees:
      • A = main 319621ba2e; B = a8e7e2f8a7, this PR's head at the time.
      • Both have #11580 and #10304 merged locally, plus a local scePadOpen answer for port types 3 and 4.
      • The builds' commits, which the summary lines name, are on the fork: A is 103015a9ca66 (branch measure/12478-a-main-319621ba2e) and B is bd421aa3c2fb (branch measure/12478-b-head-a8e7e2f8a7). Each is its arm's commit, then the scePadOpen answer (e054dfdca2 in A, e09dff7347 in B), then merges of #11580 at fedf3e91a7 and #10304 at e0d6e062a9.
      • Without #11580, the title stops in its intro on #8898's converted 16-bit image refusal. Without #10304, it aborts in the intro on "guest buffer has no GPU owner" after a host import fails.
      • Counting all boots, warm-ups included: 6 boots without #10304 had 2 hit a failed build import, and both aborted, one in each arm. 6 boots with it had 1 hit the same failure and ran on, and none aborted.
    • Environment: APS5_LAZY_SHADER_PREPARE=1 APS5_NO_GPL=1 APS5_HOST_IMPORT_MIB=6400 APS5_TRACE_SUMMARY_EVERY=10, with no draw-cache variables (budget 256 MiB, bypass 5% in B). Each arm used its own shader cache. These four runs take their numbers from the APS5_TRACE_SUMMARY_EVERY intervals; the captures below follow the form.
    B: this head A: main
    presents over menu +5 to +15 min (fps) 543 (0.905) / 496 (0.827) 445 (0.742) / 381 (0.635)
    frame p50 / p90 1.1 / 1.1 s and 1.2 / 1.3 s 1.3 / 1.5 s and 1.5 / 1.9 s
    private bytes at menu +15 min 14,111 / 14,197 MB 13,972 / 14,445 MB
    Driver.Packet ms per frame 3,006 / 3,444 3,768 / 4,347
    Driver.Packet.memory_wait ms per frame 1,733 / 2,000 2,192 / 2,425
    Driver.Draw ms per frame 784 / 906 995 / 1,028
    • Speed: B's mean is 0.866 fps against A's 0.688 (+26%), and B is ahead in both adjacent pairs (0.905 vs 0.742, then 0.827 vs 0.635).

    • Memory: no difference. B is 55 MB lower on the mean, inside A's own 473 MB spread.

    • [draw-cache] lines at this menu, from one profiled B boot (APS5_PROFILE_DRAW=1 added, to menu +10; not a timing run):

      • bypassed 16384 draws (10 s) in 23 of the 25 ten-second blocks, 376,832 draws in all, from the second block on.
      • Between bypasses, the windows that stay looked up counted 54,859 lookups with 0 hits (all "no entry", no stage data hits) and 3,384 inserts.
      • The cache still filled to its budget: 432 entries, ~255.5 MiB of 256.0 MiB, with 2,952 evictions by the byte budget.
    • Captures, as the Performance report form describes: one traced run per arm on the same trees and caches as the pair, A then B in one session on 2026-10-28 (PT).

      • Environment: APS5_LAZY_SHADER_PREPARE=1 APS5_NO_GPL=1 APS5_HOST_IMPORT_MIB=6400 APS5_TRACE_SECONDS=960:30 and the pad replay (APS5_PAD_INPUT_FILE), with no other APS5_TRACE_* or APS5_PROFILE_* switch. Each arm wrote its trace and summary line into its own working directory.
      • The 30 s window opens 960 s after the title's first present, at about menu +10 min in both. Neither trace dropped events.
      • GPU clocks weren't held: A ran 97% of the 250 ms samples in P0, and B 88% in P0 and 10% in P5. The mean graphics clock was 1,356 MHz in A and 1,351 MHz in B.
      • B against A over the window:
        • 24 presents against 19; frame p50 1,264 against 1,510 ms (-16%), p90 1,638 against 1,868 ms (-12%), p99 1,664 against 2,204 ms (-25%);
        • Driver.Packet 3,666 against 4,499 ms per frame (-19%), of which memory_wait 2,133 against 2,668 and Packet.draw 970 against 1,217;
        • Packet.dispatch 526 against 565 ms, and GPU busy per present 244 against 232 ms.
      • These replace two captures from earlier on 2026-10-28 that also set APS5_TRACE_SUMMARY_EVERY=10 and APS5_TRACE_DIR, which the form doesn't allow. In those, B was also ahead (p50 1,080 against 1,178 ms), and Packet.dispatch was higher in B (564 against 492 ms).
      • The traces: A aps5-trace-103015a9ca66-13244.json.gz (2.4 MB) and B aps5-trace-bd421aa3c2fb-33348.json.gz (2.7 MB).
      • The summary lines, as aps5-summary.jsonl holds them (A, then B):
      {"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":3194,"ms":30115.819},"presents":19,"frame_ms":{"p50":1509.629,"p90":1868.179,"p99":2204.493,"max":2204.493},"gpu_busy_ms_per_present":232.162,"worker_busy_pct":{"queue worker 0x0":99.534,"queue worker 0x38":0.095,"queue worker 0x20":90.176,"queue worker 0x28":94.220},"top_phases_ms_per_frame":{"Driver.Packet":4498.822,"Driver.Packet.memory_wait":2667.696,"Driver.Packet.draw":1216.779,"Driver.Draw":1215.543,"Graphics.Draw":987.323,"Graphics.Draw.draw_and_resource_release":964.399,"Driver.Packet.dispatch":565.069,"Driver.Dispatch":523.953},"trace_dropped":false,"trace":"aps5-trace-103015a9ca66-13244.json.gz"}
      {"commit":"bd421aa3c2fb","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":3346,"ms":31244.555},"presents":24,"frame_ms":{"p50":1264.279,"p90":1637.960,"p99":1663.592,"max":1663.592},"gpu_busy_ms_per_present":244.214,"worker_busy_pct":{"queue worker 0x0":99.499,"queue worker 0x38":0.064,"queue worker 0x20":88.775,"queue worker 0x28":93.574},"top_phases_ms_per_frame":{"Driver.Packet":3666.451,"Driver.Packet.memory_wait":2132.717,"Driver.Packet.draw":969.522,"Driver.Draw":968.475,"Graphics.Draw":859.305,"Graphics.Draw.draw_and_resource_release":840.225,"Driver.Packet.dispatch":525.755,"Driver.Dispatch":483.792},"trace_dropped":false,"trace":"aps5-trace-bd421aa3c2fb-33348.json.gz"}
      
    A (main 319621ba2e + #11580 + #10304): trace_digest.py

    seconds 960:30 from present 3194: 19 presents, frame p50 1509.6 / p90 1868.2 / p99 2204.5 / max 2204.5 ms, GPU busy 232.2 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":3194,"ms":30115.819},"presents":19,"frame_ms":{"p50":1509.629,"p90":1868.179,"p99":2204.493,"max":2204.493},"gpu_busy_ms_per_present":232.162,"worker_busy_pct":{"queue worker 0x0":99.534,"queue worker 0x38":0.095,"queue worker 0x20":90.176,"queue worker 0x28":94.22},"top_phases_ms_per_frame":{"Driver.Packet":4498.822,"Driver.Packet.memory_wait":2667.696,"Driver.Packet.draw":1216.779,"Driver.Draw":1215.543,"Graphics.Draw":987.323,"Graphics.Draw.draw_and_resource_release":964.399,"Driver.Packet.dispatch":565.069,"Driver.Dispatch":523.953},"trace_dropped":false,"trace":"aps5-trace-103015a9ca66-13244.json.gz"}
    

    Slowest frames (largest slices inside each, inclusive)

    • present 3200: 2204.5 ms at 9605 ms: Driver.WorkerWait (queue worker 0x38) 2200.6, Driver.WorkerWait.dequeue_order (queue worker 0x38) 2193.2, Driver.Packet (queue worker 0x0) 2182.2, Driver.Packet (queue worker 0x28) 2112.9
    • present 3208: 1868.2 ms at 22628 ms: Driver.WorkerWait (queue worker 0x38) 1866.8, Driver.WorkerWait.dequeue_order (queue worker 0x38) 1860.4, Driver.Packet (queue worker 0x0) 1849.5, Driver.Packet (queue worker 0x28) 1791.4
    • present 3204: 1851.0 ms at 16043 ms: Driver.WorkerWait (queue worker 0x38) 1848.2, Driver.WorkerWait.dequeue_order (queue worker 0x38) 1841.8, Driver.Packet (queue worker 0x0) 1830.7, Driver.Packet (queue worker 0x28) 1764.5
    • present 3197: 1840.2 ms at 4500 ms: Driver.WorkerWait (queue worker 0x38) 1838.7, Driver.WorkerWait.dequeue_order (queue worker 0x38) 1832.2, Driver.Packet (queue worker 0x0) 1819.8, Driver.Packet (queue worker 0x28) 1752.8
    • present 3205: 1778.4 ms at 17894 ms: Driver.WorkerWait (queue worker 0x38) 1775.8, Driver.WorkerWait.dequeue_order (queue worker 0x38) 1767.7, Driver.Packet (queue worker 0x0) 1759.7, Driver.Packet (queue worker 0x28) 1690.9

    Threads (ms per frame)

    thread busy wait untraced in slices < 20 us largest
    queue worker 0x0 1119.8 (71 %) 451.8 (29 %) 13.4 88.6 Driver.Packet 1567.0
    draw committer 704.4 (44 %) 31.7 (2 %) 849.0 4.5 Graphics.Draw 719.1, Recorder.Submit 2.2
    presenter 3.6 (0 %) 0.2 (0 %) 1581.3 0.1 VideoOut.Flip 3.7, Driver.Present 0.1
    queue worker 0x38 1.2 (0 %) 1429.1 (90 %) 154.7 0.7 Driver.Packet 1.3, Driver.EndSubmission 0.1
    queue worker 0x20 132.0 (8 %) 1444.1 (91 %) 9.0 4.8 Driver.Packet 1426.2, Driver.EndSubmission 2.4
    queue worker 0x28 18.9 (1 %) 1553.9 (98 %) 12.3 0.2 Driver.Packet 1492.9, Driver.EndSubmission 0.5
    gpu 244.9 (15 %) 0.0 (0 %) 1340.2 0.0 batch 244.9

    Largest slices (ms per frame, inclusive, all threads): Driver.Packet 4487.4, Driver.Packet.memory_wait 2667.5, Driver.WorkerWait 1659.9, Driver.WorkerWait.dequeue_order 1423.1, Driver.Packet.draw 1215.9, Driver.Draw 1214.6, Graphics.Draw 986.8, Graphics.Draw.draw_and_resource_release 963.7, Driver.Packet.dispatch 564.2, Driver.Dispatch 523.0

    Longest waits

    • Driver.WorkerWait (queue worker 0x38) 2200.4 ms at 9609 ms, present 3200
    • Driver.Packet.memory_wait (queue worker 0x28) 1939.0 ms at 9765 ms, present 3200
    • Driver.WorkerWait (queue worker 0x38) 1866.8 ms at 22630 ms, present 3208
    • Driver.WorkerWait (queue worker 0x38) 1848.2 ms at 16046 ms, present 3204
    • Driver.WorkerWait (queue worker 0x38) 1838.9 ms at 4502 ms, present 3197
    • Driver.WorkerWait (queue worker 0x38) 1775.8 ms at 17897 ms, present 3205
    • Driver.WorkerWait (queue worker 0x38) 1755.1 ms at 7850 ms, present 3199
    • Driver.Packet.memory_wait (queue worker 0x20) 1708.3 ms at 9724 ms, present 3200
    • Driver.Packet.memory_wait (queue worker 0x28) 1625.6 ms at 22781 ms, present 3208
    • Driver.Packet.memory_wait (queue worker 0x28) 1605.6 ms at 4632 ms, present 3197

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

    • batch 251: 41.9 ms at 6476 ms, present 3198: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 0.5, Driver.Packet.dispatch (queue worker 0x0) 0.5, Driver.Dispatch (queue worker 0x0) 0.4, Driver.Packet.flush_between_packets (queue worker 0x0) 0.1
    • batch 622: 41.6 ms at 16211 ms, present 3204: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 2.4, Driver.Packet.dispatch (queue worker 0x0) 2.1, Driver.Dispatch (queue worker 0x0) 2.0, Vulkan.DispatchRecipe (queue worker 0x0) 0.9
    • batch 1048: 41.6 ms at 27452 ms, present 3211: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 3.3, Driver.Packet.dispatch (queue worker 0x0) 3.0, Driver.Dispatch (queue worker 0x0) 2.9, Vulkan.DispatchRecipe (queue worker 0x0) 1.4
    • batch 744: 41.6 ms at 19805 ms, present 3206: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 0.7, Driver.Packet.dispatch (queue worker 0x0) 0.6, Driver.Dispatch (queue worker 0x0) 0.6, Vulkan.DispatchRecipe (queue worker 0x0) 0.1
    • batch 441: 41.6 ms at 11965 ms, present 3201: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 2.0, Driver.Packet.dispatch (queue worker 0x0) 1.8, Driver.Dispatch (queue worker 0x0) 1.7, Driver.Dispatch.lookup_cache (queue worker 0x0) 0.2
    B (this head + #11580 + #10304): trace_digest.py

    seconds 960:30 from present 3346: 24 presents, frame p50 1264.3 / p90 1638.0 / p99 1663.6 / max 1663.6 ms, GPU busy 244.2 ms per present
    NVIDIA GeForce RTX 3070 Laptop GPU, NVIDIA 617.42, Windows 10.0.26300, 3840x2160, commit bd421aa3c2fb, dropped: no

    {"commit":"bd421aa3c2fb","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":3346,"ms":31244.555},"presents":24,"frame_ms":{"p50":1264.279,"p90":1637.96,"p99":1663.592,"max":1663.592},"gpu_busy_ms_per_present":244.214,"worker_busy_pct":{"queue worker 0x0":99.499,"queue worker 0x38":0.064,"queue worker 0x20":88.775,"queue worker 0x28":93.574},"top_phases_ms_per_frame":{"Driver.Packet":3666.451,"Driver.Packet.memory_wait":2132.717,"Driver.Packet.draw":969.522,"Driver.Draw":968.475,"Graphics.Draw":859.305,"Graphics.Draw.draw_and_resource_release":840.225,"Driver.Packet.dispatch":525.755,"Driver.Dispatch":483.792},"trace_dropped":false,"trace":"aps5-trace-bd421aa3c2fb-33348.json.gz"}
    

    Slowest frames (largest slices inside each, inclusive)

    • present 3354: 1663.6 ms at 10085 ms: Driver.WorkerWait (queue worker 0x38) 1662.7, Driver.WorkerWait.dequeue_order (queue worker 0x38) 1657.7, Driver.Packet (queue worker 0x0) 1646.1, Driver.Packet (queue worker 0x28) 1579.5
    • present 3362: 1662.1 ms at 20923 ms: Driver.WorkerWait (queue worker 0x38) 1661.5, Driver.WorkerWait.dequeue_order (queue worker 0x38) 1655.5, Driver.Packet (queue worker 0x0) 1643.4, Driver.Packet (queue worker 0x28) 1562.6
    • present 3357: 1638.0 ms at 14491 ms: Driver.WorkerWait (queue worker 0x38) 1637.4, Driver.WorkerWait.dequeue_order (queue worker 0x38) 1632.5, Driver.Packet (queue worker 0x0) 1621.5, Driver.Packet (queue worker 0x28) 1519.4
    • present 3346: 1491.3 ms at 0 ms: Driver.Packet (queue worker 0x0) 1467.4, Driver.Packet (queue worker 0x20) 1330.1, Driver.Packet (queue worker 0x28) 1293.5, Driver.Packet.memory_wait (queue worker 0x28) 1277.6
    • present 3355: 1460.3 ms at 11749 ms: Driver.WorkerWait (queue worker 0x38) 1459.3, Driver.WorkerWait.dequeue_order (queue worker 0x38) 1453.0, Driver.Packet (queue worker 0x0) 1442.5, Driver.Packet (queue worker 0x28) 1381.2

    Threads (ms per frame)

    thread busy wait untraced in slices < 20 us largest
    queue worker 0x0 886.1 (68 %) 403.4 (31 %) 12.4 91.5 Driver.Packet 1285.5
    draw committer 613.3 (47 %) 34.5 (3 %) 654.1 5.3 Graphics.Draw 628.1, Recorder.Submit 1.8
    presenter 3.4 (0 %) 0.3 (0 %) 1298.1 0.1 VideoOut.Flip 3.5, Driver.Present 0.3
    queue worker 0x38 0.7 (0 %) 1183.7 (91 %) 117.5 0.9 Driver.Packet 0.6, Driver.EndSubmission 0.1
    queue worker 0x20 118.1 (9 %) 1176.9 (90 %) 6.9 4.9 Driver.Packet 1152.0, Driver.EndSubmission 3.1
    queue worker 0x28 17.9 (1 %) 1276.2 (98 %) 7.8 0.2 Driver.Packet 1217.7, Driver.EndSubmission 0.4
    gpu 244.4 (19 %) 0.0 (0 %) 1057.5 0.0 batch 244.4

    Largest slices (ms per frame, inclusive, all threads): Driver.Packet 3655.9, Driver.Packet.memory_wait 2132.6, Driver.WorkerWait 1403.0, Driver.WorkerWait.dequeue_order 1178.5, Driver.Packet.draw 968.5, Driver.Draw 967.4, Graphics.Draw 858.5, Graphics.Draw.draw_and_resource_release 839.2, Driver.Packet.dispatch 524.4, Driver.Dispatch 482.3

    Longest waits

    • Driver.WorkerWait (queue worker 0x38) 1662.1 ms at 10087 ms, present 3354
    • Driver.WorkerWait (queue worker 0x38) 1661.9 ms at 20924 ms, present 3362
    • Driver.WorkerWait (queue worker 0x38) 1637.0 ms at 14492 ms, present 3357
    • Driver.WorkerWait (queue worker 0x38) 1459.5 ms at 11750 ms, present 3355
    • Driver.WorkerWait (queue worker 0x38) 1449.6 ms at 26190 ms, present 3366
    • Driver.Packet.memory_wait (queue worker 0x28) 1440.4 ms at 10208 ms, present 3354
    • Driver.Packet.memory_wait (queue worker 0x28) 1437.2 ms at 21032 ms, present 3362
    • Driver.WorkerWait (queue worker 0x38) 1398.8 ms at 16130 ms, present 3358
    • Driver.Packet.memory_wait (queue worker 0x28) 1392.2 ms at 14602 ms, present 3357
    • Driver.WorkerWait (queue worker 0x38) 1280.7 ms at 13211 ms, present 3356

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

    • batch 655: 41.7 ms at 14605 ms, present 3357: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 1.5, Driver.Packet.dispatch (queue worker 0x0) 1.3, Driver.Dispatch (queue worker 0x0) 1.3, Vulkan.DispatchRecipe (queue worker 0x0) 0.4
    • batch 184: 41.6 ms at 4148 ms, present 3349: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 0.3, Driver.Packet.dispatch (queue worker 0x0) 0.2, Driver.Dispatch (queue worker 0x0) 0.2, Vulkan.DispatchRecipe (queue worker 0x0) 0.1
    • batch 418: 41.6 ms at 8994 ms, present 3353: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 1.0, Driver.Packet.dispatch (queue worker 0x0) 0.9, Driver.Dispatch (queue worker 0x0) 0.9, Vulkan.DispatchRecipe (queue worker 0x0) 0.4
    • batch 716: 41.5 ms at 16275 ms, present 3358: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 2.3, Driver.Packet.dispatch (queue worker 0x0) 2.1, Driver.Dispatch (queue worker 0x0) 2.1, Vulkan.DispatchRecipe (queue worker 0x0) 0.8
    • batch 948: 41.5 ms at 21035 ms, present 3362: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 0.3, Driver.Packet.dispatch (queue worker 0x0) 0.2, Driver.Dispatch (queue worker 0x0) 0.2, Vulkan.DispatchRecipe (queue worker 0x0) 0.2
    - **A title where the cache pays:** Planet of Lana (PPSA19450), one profiled boot of a8e7e2f8a7 (the same build, relinked for that title), with its own usual switches: `APS5_STORAGE_CACHE_ENTRIES=1024 APS5_THREAD_PRIORITY=high APS5_PROFILE_DRAW=1` (`APS5_STORAGE_CACHE_ENTRIES` is #14220's cap, which isn't on `main`), no LAZY or NO_GPL, and a cold shader cache. It ran 15 min through the logos into its menu. Not a timing run. - **No `bypassed` line in the whole run.** The hit rate per 10 s block stayed between 15.8% and 75.0%, median 19.8%: 1,262,160 hits in 6,381,888 lookups. - The cache sat at its 4,096-entry cap, ~14-15.5 MiB of the 256 MiB budget, turning over by entry count.
  • Resident Evil Village (PPSA01556), with the draw-cache budget off (an earlier pair, 2026-10-28 morning). Static main menu, 16 min each run after an unmeasured warm-up, unprofiled, B A A B.

    • Machine: Windows 11 (10.0.26300), RTX 3070 Laptop GPU (NVIDIA 617.42), Ryzen 9 5900HS, 16 GB. GPU clocks weren't held, so frame times are rough.
    • Binary: one binary for all four runs, a local tree with the same code as this PR: main 85a4d7f8c8 plus #9129 and #8926 (both merged since), our local table-index and Village-harness commits, a local scePadOpen answer and a diagnostic print, with the bypass commit on top (7bc49ce4d0).
    • Environment: APS5_LAZY_SHADER_PREPARE=1 APS5_NO_GPL=1 APS5_HOST_IMPORT_MIB=6400 APS5_TRACE_SUMMARY_EVERY=10, and APS5_DRAW_CACHE_BYTES=1099511627776 (budget off) in every run.
    • Arms: A sets APS5_DRAW_CACHE_BYPASS_PERCENT=0 (no bypass); B leaves it unset (5%).
    B: bypass A: no bypass
    private bytes at menu +15 min 19,466 / 19,310 MB 23,187 / 23,186 MB
    private bytes at menu +1 min 16,732 / 16,623 MB 19,074 / 18,253 MB
    presents over menu +5 to +15 min (fps) 286 (0.477) / 279 (0.465) 246 (0.410) / 212 (0.353)
    frame p50 / p90 2.1 / 2.4 s and 2.1 / 2.3 s 2.4 / 2.9 s and 2.9 / 3.6 s
    Driver.Packet ms per frame 5,987 / 6,211 7,173 / 8,228
    Driver.Packet.memory_wait ms per frame 3,620 / 3,728 4,397 / 5,081
    • Memory: B is 3.8 GB lower at menu +15, and its two runs agree within 0.2 GB.
    • Speed: A slowed between its runs (0.410 to 0.353) while B held, so the gap is 0.06 to 0.12 fps.
    • All four runs are in the title's high host-import mode. B's second run made 172 GB of imports against 62 to 71 GB in the others, with private bytes and fps matching its first run.
    Summary lines (the last interval of B's and A's first runs)
    {"commit":"7bc49ce4d0c9","dirty":false,"env":{"APS5_DRAW_CACHE_BYTES":"1099511627776","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":2733,"ms":10862.659},"interval_start_s":1257.191,"interval_end_s":1268.054,"presents":6,"frame_ms":{"p50":1836.380,"p90":1928.612,"p99":1928.612,"max":1928.612},"gpu_busy_ms_per_present":266.715,"worker_busy_pct":{"queue worker 0x0":99.663,"queue worker 0x38":0.126,"queue worker 0x20":93.060,"queue worker 0x28":96.135},"top_phases_ms_per_frame":{"Driver.Packet":5229.249,"Driver.Packet.memory_wait":3160.711,"Driver.Packet.draw":1490.415,"Driver.Draw":1489.694,"Graphics.Draw":1355.575,"Graphics.Draw.draw_and_resource_release":1337.340,"Resources.Complete":598.582,"Driver.Packet.dispatch":515.536},"trace_dropped":false,"trace":""}
    {"commit":"7bc49ce4d0c9","dirty":false,"env":{"APS5_DRAW_CACHE_BYPASS_PERCENT":"0","APS5_DRAW_CACHE_BYTES":"1099511627776","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":2514,"ms":10370.633},"interval_start_s":1225.751,"interval_end_s":1236.122,"presents":5,"frame_ms":{"p50":2120.289,"p90":2197.734,"p99":2197.734,"max":2197.734},"gpu_busy_ms_per_present":269.083,"worker_busy_pct":{"queue worker 0x0":99.701,"queue worker 0x38":0.114,"queue worker 0x20":93.775,"queue worker 0x28":96.549},"top_phases_ms_per_frame":{"Driver.Packet":6013.220,"Driver.Packet.memory_wait":3677.704,"Driver.Packet.draw":1713.861,"Driver.Draw":1713.070,"Graphics.Draw":1491.831,"Graphics.Draw.draw_and_resource_release":1471.150,"Resources.Complete":683.281,"Driver.Packet.dispatch":522.495},"trace_dropped":false,"trace":""}
    

    The traces themselves, the four runs' aps5-summary.jsonl files with every 10 s interval, stay on the test machine. tools/trace_digest.py's text output for the same two runs is in a comment. Those lines share one commit because the arms differ only in the environment. The pair above compares main and this PR as two builds.

  • 58171b22e8, a merge of main edf6804cf5 (run, validation run). The merge was clean: CMakeLists.txt, Driver.hpp and ENVIRONMENT.md merged without conflicts, and the PR's patch-id is unchanged. The Village pair, the captures and the profiled runs above were measured on a8e7e2f8a7, whose patch this merge doesn't change.

    • The two bypass tests and every ^agc_driver_draw_cache test ×10. Linux: 13 run, 13 pass, 0 skip, 0 fail. Windows: 13 run, 0 pass, 13 skip, 0 fail, since the runner has no Vulkan device. The libc and libkernel suites run 191 and 291 tests on Linux and 220 and 314 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.
    • Validation (VERIFY_VALIDATION=1 on GitHub's Linux runner, llvmpipe (LLVM 20.1.2, Mesa 25.2.8)), main edf6804cf5 against 58171b22e8: 13 passed, 0 skipped. main has no bypass tests, so its arm ran the other ^agc_driver_draw_cache tests. VUID-VkDeviceCreateInfo-pNext-pNext appears in both arms, and the merge adds none.
  • 14209e93ba, a merge of main ebb4075168, on top of c7981bcb3b and 40973d322a (run, validation run). The merge was clean.

    • Every ^agc_driver_draw_cache test ×10, the bypass and cold-scene tests included:
      • Linux: 15 run, 15 pass, 0 skip, 0 fail.
      • Windows: 15 run, 0 pass, 15 skip, 0 fail, since the runner has no Vulkan device.
      • The libc and libkernel suites run 193 and 294 tests on Linux and 223 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.
    • Validation (VERIFY_VALIDATION=1 on GitHub's Linux runner, llvmpipe (LLVM 20.1.2, Mesa 25.2.8)), main ebb4075168 against this head:
      • 15 passed, 0 skipped. main has no bypass or cold-scene tests, so its arm ran the other ^agc_driver_draw_cache tests.
      • VUID-VkDeviceCreateInfo-pNext-pNext appears in both arms, and the change adds none.
  • 05d2faab6c: 11e29b3107, the window race fix, then a merge of main 76fd1c09e9 (run, validation run). The merge was clean.

    • Every ^agc_driver_draw_cache test ×10, ConcurrentClosesKeepTheirOrder included:
      • Linux: 15 run, 15 pass, 0 skip, 0 fail.
      • Windows: 15 run, 0 pass, 15 skip, 0 fail, since the runner has no Vulkan device.
      • 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.
    • Validation (VERIFY_VALIDATION=1 on GitHub's Linux runner, llvmpipe (LLVM 20.1.2, Mesa 25.2.8)), main 76fd1c09e9 against this head:
      • 15 passed, 0 skipped.
      • VUID-VkDeviceCreateInfo-pNext-pNext appears in both arms, and the change adds none.
  • Resident Evil Village (PPSA01556) on the new base, draw cache at main's defaults, static main menu, B A A B, one block, 2026-10-29 (PT), unprofiled.

    • Machine: the same as the pair above. GPU clocks weren't held.
    • Trees:
      • A = main ebb4075168, B = 14209e93ba, each with the same local scePadOpen answer and #11580 and #10304 merged. The A-to-B diff is exactly this PR's diff over main.
    • Environment: APS5_LAZY_SHADER_PREPARE=1 APS5_NO_GPL=1 APS5_HOST_IMPORT_MIB=6400 APS5_TRACE_SUMMARY_EVERY=10 and the pad replay, no draw-cache variables, one shader cache warmed by an unmeasured cold run; 0 misses after b1's first 10 s.
    B: 14209e93ba A: main ebb4075168
    fps over menu +5 to +15 min 0.523 / 0.495 0.527 / 0.651
    frame p50 / p90 1.82 / 2.19 s and 1.93 / 2.36 s 1.83 / 2.31 s and 1.43 / 1.79 s
    Driver.Packet ms per frame (median) 5,163 / 5,641 5,283 / 4,150
    Driver.Packet.memory_wait ms per frame (median) 3,051 / 3,270 3,133 / 2,450
    • No measurable gain in this pair.
      • B averages 0.509 fps and A 0.589.
      • A's own spread is 21.1 % (its second run is the high one), and B's is 5.5 %.
      • The b1/a1 same-phase pair is a tie (−0.8 %).
      • One block can't say more than that.
  • 167947744a, the tests' cost (test-only):

    • Why: on an NVIDIA RTX 2000 Ada with the validation layers on, the four bypass tests ran past ctest's 120 s timeout and took 146 to 326 s alone. There, each draw that misses the cache or is bypassed costs about 10 to 20 ms.

    • What changed: the low-hit-rate and stage-hit cases draw only the lookups whose outcome they check, and note the rest of each 2,048-lookup window on the driver's bypass through DriverTestAccess. The cold-scene case keeps only its 1,000-draw scene, the one that is red on the head before the warm-up fix. No production code changed.

    • What moved: the draw-level checks stay draw-level, with fewer draws, including the draw whose pixel constant changed and must write the new colour. The third low window's 4,096-draw bypass, the draw after it, and the window of hits that ends a run are LowWindowsLengthenTheBypass's, which now also requires that no draw is bypassed before the window that starts the bypass has closed. The stage-hit case now notes one low window first, so stage hits that didn't count as useful would start a bypass.

    • Times on GitHub's Linux runner (llvmpipe), 05d2faab6c against this head:

      test ×10, without validation with validation
      agc_driver_draw_cache_cold_scene 8.83–11.50 s → 0.88–1.10 s 18.78 s → 2.87 s
      agc_driver_draw_cache_cold_scene_off 8.78–11.57 s → 0.85–1.12 s 19.13 s → 2.83 s
      agc_driver_draw_cache_low_hit_bypass 8.31–10.49 s → 0.44–0.65 s 17.45 s → 1.16 s
      agc_driver_draw_cache_low_hit_bypass_off 5.65–6.59 s → 0.50–0.67 s 10.47 s → 1.04 s
    • ×10 (run), every ^agc_driver_draw_cache test:

      • Linux: 15 run, 15 pass, 0 skip, 0 fail.
      • Windows: 15 run, 0 pass, 15 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.
    • Validation (run), main 76fd1c09e9 against this head: 15 passed. VUID-VkDeviceCreateInfo-pNext-pNext appears in both arms, and the change adds none.

    • Still red on 58171b22e8, the head before the warm-up fix (run): the trimmed agc_driver_draw_cache_cold_scene fails with "frame 4 of a scene that repeats the same 1000 new draws every frame hit 0 of them, expected at least 90%", and its _off arm passes. On Windows both skip.

  • Resident Evil Village (PPSA01556) on 167947744a, main 6472c708ae, draw cache at main's defaults, static main menu. B A A B, one block, 2026-10-30 (PT), unprofiled.

    • Machine: the same as the pairs above. GPU clocks weren't held: 90–96% of samples were in P0, with mean graphics clocks of 1,312–1,369 MHz.
    • Trees (both on the fork):
    • Environment: APS5_LAZY_SHADER_PREPARE=1 APS5_NO_GPL=1 APS5_HOST_IMPORT_MIB=6400 APS5_TRACE_SUMMARY_EVERY=10 and the pad replay, with no draw-cache variables. One shader cache was warmed by an unmeasured run of A; its key, 5ccd6c63be592224, was the same before and after every run.
    run fps over menu +5 to +15 min frame p50 / p90 private bytes at menu +15
    b1 (B) 0.666 1.43 / 1.86 s 14,123 MB
    a1 (A) 0.588 1.65 / 2.08 s 14,139 MB
    a2 (A) 0.583 1.70 / 2.06 s 13,941 MB
    b2 (B) 0.660 1.47 / 1.76 s 14,085 MB
    • As measured: B's mean is 0.663 fps against A's 0.585 (+13.3%), and both B runs are above both A runs. The two A runs are within 0.9% of each other, and the two B runs within 1.0%. Median phases, B against A: Driver.Packet 4,176 against 4,828 ms per frame, Driver.Packet.draw 1,120 against 1,294, and memory_wait 13.8% lower.

    • Load: non-game CPU in the window was 43.8, 42.9, 41.8 and 36.1%. b2 ran lighter than the other three. On the three within 2 points of each other, b1 against the A mean is +13.9%.

    • Health: no failed host imports and no stop line, and the menu was first seen at +5.5 to +6.2 min. a1, a2 and b2 each logged one presenter FATAL at close time, after the window. Pixel comparison of the static regions at menu +10 shows B rendering like A.

    • Not attributed to this change. One profiled boot of each tree, with APS5_PROFILE_DRAW=1 added, over the same window. That switch turns off the finisher hand-off, so the boots are compared only with each other:

      • The bypass: B printed [draw-cache] bypassed in 0 of the window's 57 ten-second blocks. All 12 of its bypass lines came during loading, 50 to 610 s after launch.
      • The cache, in both: 0 hits in every block. It sat at 255 of its 256 MiB, and every eviction was over the byte budget. Lookups per 10 s were about the number of draw packets (medians: A 4,288, B 5,208).
      • The code: with the bypass off, this head does no less work per draw than main. It adds a drawKeySeen lookup under drawCacheMutex for each lookup that doesn't hit, a relaxed atomic load per draw and a compare-exchange per lookup.
      • The profiled boots' times aren't compared: A's boot ran with 48.7% non-game CPU against B's 37.4%.
      • So the pair's gain isn't explained by the bypass, and this description claims no speed gain.
    • Captures, as the Performance report form describes: one traced run per arm on the same trees and cache, A (16:21–16:43) then B (16:44–17:06) in one session, with APS5_TRACE_SECONDS=960:30 and the pad replay, and no other trace or profile switch. The window opens 960 s after the first present, at about menu +11 min. Neither trace dropped events. GPU clocks weren't logged for these two runs.

      • B against A over the window: 22 presents each; frame p50 1,358 against 1,401 ms, p90 1,505 against 1,709 ms, p99 1,681 against 1,986 ms; Driver.Packet 3,884 against 4,051 ms per frame, of which memory_wait 2,284 against 2,363 and Packet.draw 1,054 against 1,065; GPU busy per present 237 against 248 ms.
      • The traces: A aps5-trace-237e88d4ff9c-28876.json.gz (2.6 MB) and B aps5-trace-05bae016f8dd-11428.json.gz (2.4 MB). Their tools/trace_digest.py output is in this comment.
      • Both summary lines say "dirty": true. That's trace_revision.cmake's porcelain check seeing only 3rdparty/freetype as modified: main's new freetype pin has a nested subprojects/dlg that can't be fetched. With submodule content ignored, the status is empty, the same in both trees, so neither tree has a source change beyond its commit.
      • The summary lines, as aps5-summary.jsonl holds them (A, then B):
      {"commit":"237e88d4ff9c","dirty":true,"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":2821,"ms":31663.912},"presents":22,"frame_ms":{"p50":1400.899,"p90":1708.722,"p99":1985.646,"max":1985.646},"gpu_busy_ms_per_present":248.362,"worker_busy_pct":{"queue worker 0x0":99.512,"queue worker 0x38":0.083,"queue worker 0x28":93.381,"queue worker 0x20":88.858},"top_phases_ms_per_frame":{"Driver.Packet":4051.385,"Driver.Packet.memory_wait":2363.248,"Driver.Packet.draw":1064.743,"Driver.Draw":1063.573,"Graphics.Draw":834.753,"Graphics.Draw.draw_and_resource_release":812.4,"Driver.Packet.dispatch":565.972,"Driver.Dispatch":515.708},"trace_dropped":false,"trace":"aps5-trace-237e88d4ff9c-28876.json.gz"}
      {"commit":"05bae016f8dd","dirty":true,"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":2834,"ms":30167.48},"presents":22,"frame_ms":{"p50":1358.259,"p90":1505.007,"p99":1680.983,"max":1680.983},"gpu_busy_ms_per_present":237.445,"worker_busy_pct":{"queue worker 0x0":99.552,"queue worker 0x38":0.053,"queue worker 0x20":89.735,"queue worker 0x28":94.132},"top_phases_ms_per_frame":{"Driver.Packet":3883.824,"Driver.Packet.memory_wait":2284.046,"Driver.Packet.draw":1054.258,"Driver.Draw":1053.291,"Graphics.Draw":846.766,"Graphics.Draw.draw_and_resource_release":828.217,"Driver.Packet.dispatch":505.62,"Driver.Dispatch":445.217},"trace_dropped":false,"trace":"aps5-trace-05bae016f8dd-11428.json.gz"}
      
  • eaafdf934b, the cold-scene case's cost (test-only; DrawCacheReuse.cpp, +6 −3). The pair above ran on 167947744a's library code, which this head doesn't change.

    • Why: on TechLevelZero's NVIDIA run of 167947744a, agc_driver_draw_cache_cold_scene and _off took 93.3 and 94.8 s with the validation layers on. Each arm drew a 1,000-draw scene for 4 frames, 4,000 draws.
      • Under the two-low-windows rule, that scene had also stopped depending on the warm-up: its first window held 48 hits and its second was useful, so it stayed green with the warm-up taken out.
    • What changed: the case notes one low window on the driver's bypass, as the stage-hit case does. It then draws a 128-draw scene for 4 frames and closes the window after the second frame: 512 draws per arm.
      • With the warm-up, the window's 128 second sightings are useful (more than the 103 of 5% of 2,048), so the run of low windows ends and frame 4 hits.
      • Without it, that window is the second low one in a row, and frame 4 is bypassed.
      • The assertion (at least 90% hits in frame 4), the frame count and the _off arm are unchanged.
    • Red (Linux, lavapipe), each mutation built and reverted:
      • the warm-up off (|| drawKeySeen(drawKey) removed from drawCacheBypass.Note(...)): the default arm fails, "frame 4 of a scene that repeats the same 128 new draws every frame, after a low window and with the scene's first two frames closing the next one, hit 0 of them, expected at least 90%";
      • that plus APS5_DRAW_CACHE_BYPASS_PERCENT ignored: the _off arm fails too;
      • the bypass after one low window (LowWindowsToBypass = 1): the default arm fails.
      • 167947744a's 1,000-draw case passes all three.
    • Times on lavapipe, three runs each: plain, 0.89 s before and 0.21 s after; with the validation layer, 2.3 s before and 0.47 s after. On NVIDIA, TechLevelZero's run on this head (report) took 15.3 and 14.8 s for the two arms with the validation layers on, against 93.3 and 94.8 s on 167947744a. It passed with 0 new failures and no new validation IDs.
    • ×10 (run), every ^agc_driver_draw_cache_ test:
      • Linux: 15 run, 15 pass, 0 skip, 0 fail.
      • Windows: 15 run, 0 pass, 15 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.
  • da441e01cc, 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_draw_cache_reuse_tests.cmake (+12 lines). Nothing else conflicted. Apart from the move, this PR's diff is unchanged. With -DBUILD_TESTING=ON, ctest -N gives 3079 tests: main's 3075 plus its 4 tests, each listed once. The 16 tests matching ^agc_driver_draw_cache_ pass 10 runs in a row. Linux: 16 run, 16 pass, 0 skip, 0 fail. Windows: 16 run, 0 pass, 16 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.

  • NVIDIA, TechLevelZero's GPU runner (report): da441e01cc merged onto main 0836dfdf4f, NVIDIA RTX 2000 Ada Generation, driver 595.99.02, Linux. Passed: 2,447 passed, 0 new failures (4 fail on main too, and 2 are unstable there), and no new validation IDs against main over 928 tests run on the GPU.

Checklist

  • Based on current main; no other open PR implements the same functions (see Overlap)
  • 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: n/a, none added
  • 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: n/a, none
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: none
  • GPUs tested: NVIDIA GeForce RTX 3070 Laptop GPU, driver 617.42, Windows 11 (10.0.26300); llvmpipe (lavapipe) on GitHub's Linux runner
  • AI-assisted: yes
<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5053344944 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12478). Originally posted by [EagleBearerYS](https://github.com/EagleBearerYS) on 2026-10-28T15:43:37Z. --- ### What Based on @bcortezf's #5404, which they closed on 2026-10-22. This is their bypass on current `main`, with their co-authorship in the commit. When two windows of 2,048 draw-cache lookups in a row each have fewer than 5% useful lookups, the next 2,048 draws neither look up nor insert draw entries. Each further low window in a row doubles that, up to 16,384, and a window at or above 5% ends the run. A lookup counts as useful when the whole draw hits, when a cached draw of the same shape is found (before its data and push-offset checks decide whether a stage is reused), or when its draw key was seen before, since the cache admits the draw at that sighting. - `APS5_DRAW_CACHE_BYPASS_PERCENT` sets the threshold (default 5). `0` never bypasses, and values above 100 count as 100. Its row is in `ENVIRONMENT.md`. - With `APS5_PROFILE_DRAW`, `[draw-cache] bypassed N draws (10 s): useful lookups stayed under 5% for two or more windows in a row` reports how many draws skipped the cache. The bypass counts them in an atomic, so a bypassed draw takes no lock. - The bypassed draws take the path `useDrawEntries == false` already takes (the same as `APS5_NO_DRAW_SRT_ENTRIES`), so no new draw path is added. **On @oneandonlydean's review of #5404** ([comment](https://github.com/boykopovar/AnyPS5/pull/5404#issuecomment-6243432597)): - **Stage hits now count** (ab71996739). `useDrawEntries` still gates `stageEntries`, so a bypassed draw also skips stage reuse. But the window now counts a lookup as useful when the whole draw hits, or when a cached draw of the same shape is found for one of its stages (the data-only path), before the data and push-offset checks decide whether that stage is reused. So a scene whose whole-draw keys miss while its stages hit keeps the cache, as you suggested. On Resident Evil Village (PPSA01556)'s main menu, stage reuse was small anyway. These are the `[draw-cache]` lines of two profiled runs of the same menu on a local tree without the bypass, at menu +15 min: - with the 256 MiB budget, 0 whole-draw hits and 0 stage validations in about 3,000 lookups per 10 s; - with the budget off, 88 to 115 whole-draw hits per 10 s (about 4%), and 176 to 230 of 424 to 512 stage validations equal. - **One window word** (ab71996739). The window's hits and lookups are now one 64-bit word updated by a single compare-exchange, so exactly one caller closes each window. - **The exact threshold** (b7001db47d). The minimum is `ceil(2048 × percent / 100)`, 103 hits at 5%. So 102 hits in 2,048 lookups (4.98%) bypasses and 103 keeps the cache, matching "fewer than 5%". - **Speed at `main`'s defaults** (the 256 MiB budget from #9129 on, the bypass at 5%): this description claims no speed gain for the current head. - Before the warm-up fix below, a8e7e2f8a7 ran Resident Evil Village (PPSA01556)'s menu 26% faster than `main` 319621ba2e, and saved no memory (Tested). - On 14209e93ba, with the warm-up fix, a pair on `main` ebb4075168 shows no measurable gain (Tested). - On 167947744a, a pair on `main` 6472c708ae ran 13.3% faster. But in a profiled boot of that tree the bypass starts in none of the measured window's 57 ten-second blocks, so that gain isn't attributed to this change (Tested). - **Why it doesn't start at that menu:** every lookup there finds no entry, so a window's useful lookups can only be sightings of draw keys seen before, which the warm-up rule counts. They keep each window above 5%. The 3.8 GB saving in the older pair below was measured with the budget off. **On @adriadam10's review and @bcortezf's warm-up report** ([review](https://github.com/boykopovar/AnyPS5/pull/12478#pullrequestreview-5705567975), [report](https://github.com/boykopovar/AnyPS5/pull/12478#issuecomment-6498590618)): - **Warm-up** (c7981bcb3b). With second-sight admission a draw hits only at its third sighting. So on a cold scene of about 1,000 or more draws, the first window had almost no hits and started a bypass, during which no sightings were recorded either. Both suggested fixes are in: - a lookup whose draw key `DrawKeySightings` has seen before now counts as useful; - the bypass needs two low windows in a row. It starts at 2,048 draws and doubles with each further low window, up to 16,384. - Draws whose keys never repeat still reach the 16,384-draw bypass after a few windows. - **No lock on the bypass path** (40973d322a). `DrawCacheBypass` counts the draws it skips in an atomic, and the draw-cache report takes and resets that count. - **What the window counts** is spelled out above and in the `ENVIRONMENT.md` row. - **Base:** 14209e93ba merges `main` ebb4075168. The draw-cache tests ran again on it (Tested), and the Village pair on the new base is in Tested. **On @MarcZX10's review of 14209e93ba** ([review](https://github.com/boykopovar/AnyPS5/pull/12478#pullrequestreview-5706775643)): - **Window results apply in window order** (11e29b3107). - A window closed with one compare-exchange, but its low-window streak was set afterwards with a separate load and store. So a closer preempted in between could overwrite the reset of a useful window closed after it. - The window's lookups and useful lookups, the streak and the draws left to bypass now share one 64-bit atomic. The compare-exchange that closes a window also sets its streak and the bypass it starts, and `Skip` takes its draw from the same word. - The policy is unchanged: the existing cases pass unchanged. - **Base:** 05d2faab6c merges `main` 76fd1c09e9, and the draw-cache tests and the validation comparison ran on it (Tested). **Overlap:** `tools/pr_overlap.py` finds no conflict with any open pull request that merges cleanly with `main`. - #9243 merges cleanly with this change, checked with `git merge-tree` after its own merge with `main`. - Among those that couldn't be compared because they conflict with `main` already, #5609 and #6188 share the draw-cache files: - #5609 reuses cached stages when only buffer bases moved, so more lookups should hit, and the window counts them; - #6188 moves eviction into `evictDrawEntries`, and also edits `DrawCacheStatistics.cpp` and `DrawCacheReuse.cpp`. Whichever merges second keeps both sides there. Related: #5404, #9129 **Profiled boot of 14209e93ba on Resident Evil Village (PPSA01556)'s menu** (profiled, not a timing run). It ran under the warm-up fix's rule, where a lookup whose key was seen before counts as useful. - **Setup:** `APS5_PROFILE_DRAW=1` with the usual `APS5_LAZY_SHADER_PREPARE=1 APS5_NO_GPL=1 APS5_HOST_IMPORT_MIB=6400 APS5_TRACE_SUMMARY_EVERY=10` and the pad script, and no draw-cache variables. RTX 3070 Laptop GPU (NVIDIA 617.42), held 12 min past the menu. - **Bypass:** 9 `[draw-cache] bypassed` lines in 80 ten-second blocks, 112,640 draws bypassed in all (2,048, 4,096, 8,192, then 16,384 six times). All 9 are in the 8th to 18th blocks, none after. - **Lookups:** 331,056 of 331,072 found no entry, with 2 hits, and the byte budget evicted 33,539 entries. - **Next:** a pair on a variant where a second sighting of a key the budget evicted no longer counts as useful, with the cold-scene case still green. Its result goes into Tested. The pairs, the captures, the profiled `bypassed` lines and the light-title run are in Tested. ### Tested - **Tests:** `agc_driver_draw_cache_low_hit_bypass` (default) and `agc_driver_draw_cache_low_hit_bypass_off` (`APS5_DRAW_CACHE_BYPASS_PERCENT=0`) run four new cases in `DrawCacheReuse.cpp`, and `agc_driver_draw_cache_cold_scene` and its `_off` run a fifth. The draw-level cases draw only the lookups whose outcome they check and note the rest of each 2,048-lookup window on the driver's bypass (167947744a, below). - **`LowHitRateBypassesTheCache`** checks that: - a window with 103 useful lookups in 2,048 (102 hits and the second sighting that admits a key) keeps the cache, and so does a single window of 102; - after two windows of 102 in a row, the next draws are neither looked up nor inserted, and a draw whose pixel constant changed still writes the new colour; - the driver's bypass then has 2,046 of its 2,048 draws left, and the draw after them looks up and hits its cached entry; - with the bypass off, the same draws are looked up. - **`StageHitsKeepTheCacheLookedUp`:** after one low window, a window whose only useful lookups are 103 draws whose keys miss but whose vertex stages are reused from the cache keeps the next draw looked up. - **`ConcurrentNotesCloseEachWindowOnce`:** - four threads noting only hits never close a window short; - one window of misses then starts no bypass, and a second bypasses exactly 2,048 draws; - four threads draining the next bypass skip 4,096 draws, and the bypass's count returns all 6,144 once. - **`LowWindowsLengthenTheBypass`:** a run of low windows bypasses 2,048, 4,096, 8,192 and then 16,384 draws. A window at 5% ends the run, and the next bypass again waits for two low windows and starts at 2,048. No draw is bypassed before the window that starts the bypass has closed. - **`ConcurrentClosesKeepTheirOrder`:** a low window closes on one thread while three others note the next, useful window, 256 times. The bypass the two low windows started must be exactly 2,048 draws, one more low window must start none, and a second must start 2,048. - **`ColdSceneKeepsTheCacheLookedUp`** (`--cold-scene`): a scene of 1,000 new draws, repeated every frame from cold, hits at least 90% by its fourth frame, with the bypass on and off. - **Each commit's new cases, red on its parent** (Linux, Ubuntu 24.04, GCC 13.3, Release; `^agc_driver_draw_cache` ×10 at each commit, 13 tests, 130 of 130 runs, 0 skipped): - ab71996739's two cases fail on 3e4d8e25f2; - b7001db47d's 102-against-103 case fails on ab71996739 ("draws after a window of 102 hits in 2048 lookups were still looked up or inserted"). - **GitHub, red/green on `main` 04fefebe90, ×10, for the first commit:** on Linux the new case fails with main's code and passes 10 of 10 with this change (13 tests, 0 skipped), and the libc and libkernel suites run with 0 failed ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/40707968703)). On Windows all 13 build and skip, and the suites run with 0 failed. - **c7981bcb3b's cold-scene case, red on the head before it:** - With the case added unchanged to 58171b22e8, `agc_driver_draw_cache_cold_scene` fails on Linux and its `_off` arm passes ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/40958026458)). On Windows both skip, since the runner has no Vulkan device. - 40973d322a's count check uses the `TakeBypassed` that commit adds, so it doesn't build on its parent. - 11e29b3107's `ConcurrentClosesKeepTheirOrder` passes on both 11e29b3107 and its parent. The old code's gap can't be forced through the API without a hook in production code. Every existing case passes unchanged on 11e29b3107, which shows the single-threaded policy is the same. - **GitHub ×10 on a8e7e2f8a7**, a merge of `main` 319621ba2e (clean; the PR's patch-id is unchanged) ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/40762876072)): - Linux: 13 run, 13 pass, 0 skip. - Windows: 13 skip, since the runner has no Vulkan device. - With `APS5_SKIP_TIMING_TESTS=1`, the libc and libkernel suites run 171 and 291 tests on Linux and 199 and 314 on Windows, with 0 failed. - **Windows on an RTX 3070 Laptop GPU,** for the first commit, on the pair's tree (the same code, 7bc49ce4d0): both pass, in 24.3 s and 5.6 s. The GitHub Windows runner skips them, as it has no Vulkan device. - `check_conventions.py` passes, with no comment lines added. - **Validation comparison** (`VERIFY_VALIDATION=1` on GitHub's Linux runner, llvmpipe (LLVM 20.1.2, Mesa 25.2.8), the two bypass tests and every `^agc_driver_draw_cache` test): - **a8e7e2f8a7's tree** (7157a5bf59, `main` 319621ba2e against it): 13 passed, 0 skipped. `VUID-VkDeviceCreateInfo-pNext-pNext` appears in both arms, and the change adds none ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/40762432535)). - **The first commit** (`main` 04fefebe90 against 3e4d8e25f2): the same result ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/40718085027)). - **Windows:** the GitHub runner skips the tests, as it has no Vulkan device. - **Resident Evil Village (PPSA01556), draw cache at `main`'s defaults, static main menu, on a8e7e2f8a7 (before the warm-up fix).** 16 min each run after a warm-up past the menu, unprofiled, B A A B, 2026-10-28. - **Machine:** Windows 11 (10.0.26300), RTX 3070 Laptop GPU (NVIDIA 617.42), Ryzen 9 5900HS, 16 GB. GPU clocks weren't held: 0% of the 250 ms samples were in P8, and the mean graphics clocks were within about 5% across the four runs (1,298 to 1,367 MHz). - **Trees:** - A = `main` 319621ba2e; B = a8e7e2f8a7, this PR's head at the time. - Both have #11580 and #10304 merged locally, plus a local `scePadOpen` answer for port types 3 and 4. - The builds' commits, which the summary lines name, are on the fork: A is [103015a9ca66](https://github.com/EagleBearerYS/AnyPS5/commit/103015a9ca66e711a7b99fa7778139de9c658b0c) (branch [`measure/12478-a-main-319621ba2e`](https://github.com/EagleBearerYS/AnyPS5/commits/measure/12478-a-main-319621ba2e)) and B is [bd421aa3c2fb](https://github.com/EagleBearerYS/AnyPS5/commit/bd421aa3c2fba5388bdc6f79c3e25f62b785aec7) (branch [`measure/12478-b-head-a8e7e2f8a7`](https://github.com/EagleBearerYS/AnyPS5/commits/measure/12478-b-head-a8e7e2f8a7)). Each is its arm's commit, then the `scePadOpen` answer (e054dfdca2 in A, e09dff7347 in B), then merges of #11580 at fedf3e91a7 and #10304 at e0d6e062a9. - Without #11580, the title stops in its intro on #8898's converted 16-bit image refusal. Without #10304, it aborts in the intro on "guest buffer has no GPU owner" after a host import fails. - Counting all boots, warm-ups included: 6 boots without #10304 had 2 hit a failed build import, and both aborted, one in each arm. 6 boots with it had 1 hit the same failure and ran on, and none aborted. - **Environment:** `APS5_LAZY_SHADER_PREPARE=1 APS5_NO_GPL=1 APS5_HOST_IMPORT_MIB=6400 APS5_TRACE_SUMMARY_EVERY=10`, with no draw-cache variables (budget 256 MiB, bypass 5% in B). Each arm used its own shader cache. These four runs take their numbers from the `APS5_TRACE_SUMMARY_EVERY` intervals; the captures below follow the form. | | B: this head | A: `main` | |---|---|---| | presents over menu +5 to +15 min (fps) | 543 (0.905) / 496 (0.827) | 445 (0.742) / 381 (0.635) | | frame p50 / p90 | 1.1 / 1.1 s and 1.2 / 1.3 s | 1.3 / 1.5 s and 1.5 / 1.9 s | | private bytes at menu +15 min | 14,111 / 14,197 MB | 13,972 / 14,445 MB | | `Driver.Packet` ms per frame | 3,006 / 3,444 | 3,768 / 4,347 | | `Driver.Packet.memory_wait` ms per frame | 1,733 / 2,000 | 2,192 / 2,425 | | `Driver.Draw` ms per frame | 784 / 906 | 995 / 1,028 | - **Speed:** B's mean is 0.866 fps against A's 0.688 (+26%), and B is ahead in both adjacent pairs (0.905 vs 0.742, then 0.827 vs 0.635). - **Memory:** no difference. B is 55 MB lower on the mean, inside A's own 473 MB spread. - **`[draw-cache]` lines at this menu, from one profiled B boot** (`APS5_PROFILE_DRAW=1` added, to menu +10; not a timing run): - `bypassed 16384 draws (10 s)` in 23 of the 25 ten-second blocks, 376,832 draws in all, from the second block on. - Between bypasses, the windows that stay looked up counted 54,859 lookups with 0 hits (all "no entry", no stage data hits) and 3,384 inserts. - The cache still filled to its budget: 432 entries, ~255.5 MiB of 256.0 MiB, with 2,952 evictions by the byte budget. - **Captures,** as the Performance report form describes: one traced run per arm on the same trees and caches as the pair, A then B in one session on 2026-10-28 (PT). - **Environment:** `APS5_LAZY_SHADER_PREPARE=1 APS5_NO_GPL=1 APS5_HOST_IMPORT_MIB=6400 APS5_TRACE_SECONDS=960:30` and the pad replay (`APS5_PAD_INPUT_FILE`), with no other `APS5_TRACE_*` or `APS5_PROFILE_*` switch. Each arm wrote its trace and summary line into its own working directory. - The 30 s window opens 960 s after the title's first present, at about menu +10 min in both. Neither trace dropped events. - GPU clocks weren't held: A ran 97% of the 250 ms samples in P0, and B 88% in P0 and 10% in P5. The mean graphics clock was 1,356 MHz in A and 1,351 MHz in B. - B against A over the window: - 24 presents against 19; frame p50 1,264 against 1,510 ms (-16%), p90 1,638 against 1,868 ms (-12%), p99 1,664 against 2,204 ms (-25%); - `Driver.Packet` 3,666 against 4,499 ms per frame (-19%), of which `memory_wait` 2,133 against 2,668 and `Packet.draw` 970 against 1,217; - `Packet.dispatch` 526 against 565 ms, and GPU busy per present 244 against 232 ms. - These replace two captures from earlier on 2026-10-28 that also set `APS5_TRACE_SUMMARY_EVERY=10` and `APS5_TRACE_DIR`, which the form doesn't allow. In those, B was also ahead (p50 1,080 against 1,178 ms), and `Packet.dispatch` was higher in B (564 against 492 ms). - The traces: A [`aps5-trace-103015a9ca66-13244.json.gz`](https://github.com/EagleBearerYS/AnyPS5/releases/download/traces-12478/aps5-trace-103015a9ca66-13244.json.gz) (2.4 MB) and B [`aps5-trace-bd421aa3c2fb-33348.json.gz`](https://github.com/EagleBearerYS/AnyPS5/releases/download/traces-12478/aps5-trace-bd421aa3c2fb-33348.json.gz) (2.7 MB). - The summary lines, as `aps5-summary.jsonl` holds them (A, then B): ```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":3194,"ms":30115.819},"presents":19,"frame_ms":{"p50":1509.629,"p90":1868.179,"p99":2204.493,"max":2204.493},"gpu_busy_ms_per_present":232.162,"worker_busy_pct":{"queue worker 0x0":99.534,"queue worker 0x38":0.095,"queue worker 0x20":90.176,"queue worker 0x28":94.220},"top_phases_ms_per_frame":{"Driver.Packet":4498.822,"Driver.Packet.memory_wait":2667.696,"Driver.Packet.draw":1216.779,"Driver.Draw":1215.543,"Graphics.Draw":987.323,"Graphics.Draw.draw_and_resource_release":964.399,"Driver.Packet.dispatch":565.069,"Driver.Dispatch":523.953},"trace_dropped":false,"trace":"aps5-trace-103015a9ca66-13244.json.gz"} {"commit":"bd421aa3c2fb","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":3346,"ms":31244.555},"presents":24,"frame_ms":{"p50":1264.279,"p90":1637.960,"p99":1663.592,"max":1663.592},"gpu_busy_ms_per_present":244.214,"worker_busy_pct":{"queue worker 0x0":99.499,"queue worker 0x38":0.064,"queue worker 0x20":88.775,"queue worker 0x28":93.574},"top_phases_ms_per_frame":{"Driver.Packet":3666.451,"Driver.Packet.memory_wait":2132.717,"Driver.Packet.draw":969.522,"Driver.Draw":968.475,"Graphics.Draw":859.305,"Graphics.Draw.draw_and_resource_release":840.225,"Driver.Packet.dispatch":525.755,"Driver.Dispatch":483.792},"trace_dropped":false,"trace":"aps5-trace-bd421aa3c2fb-33348.json.gz"} ``` <details><summary>A (main 319621ba2e + #11580 + #10304): trace_digest.py</summary> **seconds 960:30** from present 3194: 19 presents, frame p50 1509.6 / p90 1868.2 / p99 2204.5 / max 2204.5 ms, GPU busy 232.2 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":3194,"ms":30115.819},"presents":19,"frame_ms":{"p50":1509.629,"p90":1868.179,"p99":2204.493,"max":2204.493},"gpu_busy_ms_per_present":232.162,"worker_busy_pct":{"queue worker 0x0":99.534,"queue worker 0x38":0.095,"queue worker 0x20":90.176,"queue worker 0x28":94.22},"top_phases_ms_per_frame":{"Driver.Packet":4498.822,"Driver.Packet.memory_wait":2667.696,"Driver.Packet.draw":1216.779,"Driver.Draw":1215.543,"Graphics.Draw":987.323,"Graphics.Draw.draw_and_resource_release":964.399,"Driver.Packet.dispatch":565.069,"Driver.Dispatch":523.953},"trace_dropped":false,"trace":"aps5-trace-103015a9ca66-13244.json.gz"} ``` **Slowest frames** (largest slices inside each, inclusive) - present 3200: 2204.5 ms at 9605 ms: Driver.WorkerWait (queue worker 0x38) 2200.6, Driver.WorkerWait.dequeue_order (queue worker 0x38) 2193.2, Driver.Packet (queue worker 0x0) 2182.2, Driver.Packet (queue worker 0x28) 2112.9 - present 3208: 1868.2 ms at 22628 ms: Driver.WorkerWait (queue worker 0x38) 1866.8, Driver.WorkerWait.dequeue_order (queue worker 0x38) 1860.4, Driver.Packet (queue worker 0x0) 1849.5, Driver.Packet (queue worker 0x28) 1791.4 - present 3204: 1851.0 ms at 16043 ms: Driver.WorkerWait (queue worker 0x38) 1848.2, Driver.WorkerWait.dequeue_order (queue worker 0x38) 1841.8, Driver.Packet (queue worker 0x0) 1830.7, Driver.Packet (queue worker 0x28) 1764.5 - present 3197: 1840.2 ms at 4500 ms: Driver.WorkerWait (queue worker 0x38) 1838.7, Driver.WorkerWait.dequeue_order (queue worker 0x38) 1832.2, Driver.Packet (queue worker 0x0) 1819.8, Driver.Packet (queue worker 0x28) 1752.8 - present 3205: 1778.4 ms at 17894 ms: Driver.WorkerWait (queue worker 0x38) 1775.8, Driver.WorkerWait.dequeue_order (queue worker 0x38) 1767.7, Driver.Packet (queue worker 0x0) 1759.7, Driver.Packet (queue worker 0x28) 1690.9 **Threads** (ms per frame) | thread | busy | wait | untraced | in slices < 20 us | largest | |---|---|---|---|---|---| | queue worker 0x0 | 1119.8 (71 %) | 451.8 (29 %) | 13.4 | 88.6 | Driver.Packet 1567.0 | | draw committer | 704.4 (44 %) | 31.7 (2 %) | 849.0 | 4.5 | Graphics.Draw 719.1, Recorder.Submit 2.2 | | presenter | 3.6 (0 %) | 0.2 (0 %) | 1581.3 | 0.1 | VideoOut.Flip 3.7, Driver.Present 0.1 | | queue worker 0x38 | 1.2 (0 %) | 1429.1 (90 %) | 154.7 | 0.7 | Driver.Packet 1.3, Driver.EndSubmission 0.1 | | queue worker 0x20 | 132.0 (8 %) | 1444.1 (91 %) | 9.0 | 4.8 | Driver.Packet 1426.2, Driver.EndSubmission 2.4 | | queue worker 0x28 | 18.9 (1 %) | 1553.9 (98 %) | 12.3 | 0.2 | Driver.Packet 1492.9, Driver.EndSubmission 0.5 | | gpu | 244.9 (15 %) | 0.0 (0 %) | 1340.2 | 0.0 | batch 244.9 | **Largest slices** (ms per frame, inclusive, all threads): Driver.Packet 4487.4, Driver.Packet.memory_wait 2667.5, Driver.WorkerWait 1659.9, Driver.WorkerWait.dequeue_order 1423.1, Driver.Packet.draw 1215.9, Driver.Draw 1214.6, Graphics.Draw 986.8, Graphics.Draw.draw_and_resource_release 963.7, Driver.Packet.dispatch 564.2, Driver.Dispatch 523.0 **Longest waits** - Driver.WorkerWait (queue worker 0x38) 2200.4 ms at 9609 ms, present 3200 - Driver.Packet.memory_wait (queue worker 0x28) 1939.0 ms at 9765 ms, present 3200 - Driver.WorkerWait (queue worker 0x38) 1866.8 ms at 22630 ms, present 3208 - Driver.WorkerWait (queue worker 0x38) 1848.2 ms at 16046 ms, present 3204 - Driver.WorkerWait (queue worker 0x38) 1838.9 ms at 4502 ms, present 3197 - Driver.WorkerWait (queue worker 0x38) 1775.8 ms at 17897 ms, present 3205 - Driver.WorkerWait (queue worker 0x38) 1755.1 ms at 7850 ms, present 3199 - Driver.Packet.memory_wait (queue worker 0x20) 1708.3 ms at 9724 ms, present 3200 - Driver.Packet.memory_wait (queue worker 0x28) 1625.6 ms at 22781 ms, present 3208 - Driver.Packet.memory_wait (queue worker 0x28) 1605.6 ms at 4632 ms, present 3197 **Largest GPU batches** (GPU ranges inside, and the CPU slices that recorded each, inclusive) - batch 251: 41.9 ms at 6476 ms, present 3198: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 0.5, Driver.Packet.dispatch (queue worker 0x0) 0.5, Driver.Dispatch (queue worker 0x0) 0.4, Driver.Packet.flush_between_packets (queue worker 0x0) 0.1 - batch 622: 41.6 ms at 16211 ms, present 3204: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 2.4, Driver.Packet.dispatch (queue worker 0x0) 2.1, Driver.Dispatch (queue worker 0x0) 2.0, Vulkan.DispatchRecipe (queue worker 0x0) 0.9 - batch 1048: 41.6 ms at 27452 ms, present 3211: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 3.3, Driver.Packet.dispatch (queue worker 0x0) 3.0, Driver.Dispatch (queue worker 0x0) 2.9, Vulkan.DispatchRecipe (queue worker 0x0) 1.4 - batch 744: 41.6 ms at 19805 ms, present 3206: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 0.7, Driver.Packet.dispatch (queue worker 0x0) 0.6, Driver.Dispatch (queue worker 0x0) 0.6, Vulkan.DispatchRecipe (queue worker 0x0) 0.1 - batch 441: 41.6 ms at 11965 ms, present 3201: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 2.0, Driver.Packet.dispatch (queue worker 0x0) 1.8, Driver.Dispatch (queue worker 0x0) 1.7, Driver.Dispatch.lookup_cache (queue worker 0x0) 0.2 </details> <details><summary>B (this head + #11580 + #10304): trace_digest.py</summary> **seconds 960:30** from present 3346: 24 presents, frame p50 1264.3 / p90 1638.0 / p99 1663.6 / max 1663.6 ms, GPU busy 244.2 ms per present NVIDIA GeForce RTX 3070 Laptop GPU, NVIDIA 617.42, Windows 10.0.26300, 3840x2160, commit bd421aa3c2fb, dropped: no ```json {"commit":"bd421aa3c2fb","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":3346,"ms":31244.555},"presents":24,"frame_ms":{"p50":1264.279,"p90":1637.96,"p99":1663.592,"max":1663.592},"gpu_busy_ms_per_present":244.214,"worker_busy_pct":{"queue worker 0x0":99.499,"queue worker 0x38":0.064,"queue worker 0x20":88.775,"queue worker 0x28":93.574},"top_phases_ms_per_frame":{"Driver.Packet":3666.451,"Driver.Packet.memory_wait":2132.717,"Driver.Packet.draw":969.522,"Driver.Draw":968.475,"Graphics.Draw":859.305,"Graphics.Draw.draw_and_resource_release":840.225,"Driver.Packet.dispatch":525.755,"Driver.Dispatch":483.792},"trace_dropped":false,"trace":"aps5-trace-bd421aa3c2fb-33348.json.gz"} ``` **Slowest frames** (largest slices inside each, inclusive) - present 3354: 1663.6 ms at 10085 ms: Driver.WorkerWait (queue worker 0x38) 1662.7, Driver.WorkerWait.dequeue_order (queue worker 0x38) 1657.7, Driver.Packet (queue worker 0x0) 1646.1, Driver.Packet (queue worker 0x28) 1579.5 - present 3362: 1662.1 ms at 20923 ms: Driver.WorkerWait (queue worker 0x38) 1661.5, Driver.WorkerWait.dequeue_order (queue worker 0x38) 1655.5, Driver.Packet (queue worker 0x0) 1643.4, Driver.Packet (queue worker 0x28) 1562.6 - present 3357: 1638.0 ms at 14491 ms: Driver.WorkerWait (queue worker 0x38) 1637.4, Driver.WorkerWait.dequeue_order (queue worker 0x38) 1632.5, Driver.Packet (queue worker 0x0) 1621.5, Driver.Packet (queue worker 0x28) 1519.4 - present 3346: 1491.3 ms at 0 ms: Driver.Packet (queue worker 0x0) 1467.4, Driver.Packet (queue worker 0x20) 1330.1, Driver.Packet (queue worker 0x28) 1293.5, Driver.Packet.memory_wait (queue worker 0x28) 1277.6 - present 3355: 1460.3 ms at 11749 ms: Driver.WorkerWait (queue worker 0x38) 1459.3, Driver.WorkerWait.dequeue_order (queue worker 0x38) 1453.0, Driver.Packet (queue worker 0x0) 1442.5, Driver.Packet (queue worker 0x28) 1381.2 **Threads** (ms per frame) | thread | busy | wait | untraced | in slices < 20 us | largest | |---|---|---|---|---|---| | queue worker 0x0 | 886.1 (68 %) | 403.4 (31 %) | 12.4 | 91.5 | Driver.Packet 1285.5 | | draw committer | 613.3 (47 %) | 34.5 (3 %) | 654.1 | 5.3 | Graphics.Draw 628.1, Recorder.Submit 1.8 | | presenter | 3.4 (0 %) | 0.3 (0 %) | 1298.1 | 0.1 | VideoOut.Flip 3.5, Driver.Present 0.3 | | queue worker 0x38 | 0.7 (0 %) | 1183.7 (91 %) | 117.5 | 0.9 | Driver.Packet 0.6, Driver.EndSubmission 0.1 | | queue worker 0x20 | 118.1 (9 %) | 1176.9 (90 %) | 6.9 | 4.9 | Driver.Packet 1152.0, Driver.EndSubmission 3.1 | | queue worker 0x28 | 17.9 (1 %) | 1276.2 (98 %) | 7.8 | 0.2 | Driver.Packet 1217.7, Driver.EndSubmission 0.4 | | gpu | 244.4 (19 %) | 0.0 (0 %) | 1057.5 | 0.0 | batch 244.4 | **Largest slices** (ms per frame, inclusive, all threads): Driver.Packet 3655.9, Driver.Packet.memory_wait 2132.6, Driver.WorkerWait 1403.0, Driver.WorkerWait.dequeue_order 1178.5, Driver.Packet.draw 968.5, Driver.Draw 967.4, Graphics.Draw 858.5, Graphics.Draw.draw_and_resource_release 839.2, Driver.Packet.dispatch 524.4, Driver.Dispatch 482.3 **Longest waits** - Driver.WorkerWait (queue worker 0x38) 1662.1 ms at 10087 ms, present 3354 - Driver.WorkerWait (queue worker 0x38) 1661.9 ms at 20924 ms, present 3362 - Driver.WorkerWait (queue worker 0x38) 1637.0 ms at 14492 ms, present 3357 - Driver.WorkerWait (queue worker 0x38) 1459.5 ms at 11750 ms, present 3355 - Driver.WorkerWait (queue worker 0x38) 1449.6 ms at 26190 ms, present 3366 - Driver.Packet.memory_wait (queue worker 0x28) 1440.4 ms at 10208 ms, present 3354 - Driver.Packet.memory_wait (queue worker 0x28) 1437.2 ms at 21032 ms, present 3362 - Driver.WorkerWait (queue worker 0x38) 1398.8 ms at 16130 ms, present 3358 - Driver.Packet.memory_wait (queue worker 0x28) 1392.2 ms at 14602 ms, present 3357 - Driver.WorkerWait (queue worker 0x38) 1280.7 ms at 13211 ms, present 3356 **Largest GPU batches** (GPU ranges inside, and the CPU slices that recorded each, inclusive) - batch 655: 41.7 ms at 14605 ms, present 3357: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 1.5, Driver.Packet.dispatch (queue worker 0x0) 1.3, Driver.Dispatch (queue worker 0x0) 1.3, Vulkan.DispatchRecipe (queue worker 0x0) 0.4 - batch 184: 41.6 ms at 4148 ms, present 3349: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 0.3, Driver.Packet.dispatch (queue worker 0x0) 0.2, Driver.Dispatch (queue worker 0x0) 0.2, Vulkan.DispatchRecipe (queue worker 0x0) 0.1 - batch 418: 41.6 ms at 8994 ms, present 3353: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 1.0, Driver.Packet.dispatch (queue worker 0x0) 0.9, Driver.Dispatch (queue worker 0x0) 0.9, Vulkan.DispatchRecipe (queue worker 0x0) 0.4 - batch 716: 41.5 ms at 16275 ms, present 3358: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 2.3, Driver.Packet.dispatch (queue worker 0x0) 2.1, Driver.Dispatch (queue worker 0x0) 2.1, Vulkan.DispatchRecipe (queue worker 0x0) 0.8 - batch 948: 41.5 ms at 21035 ms, present 3362: GPU no ranges; recorded by Driver.Packet (queue worker 0x0) 0.3, Driver.Packet.dispatch (queue worker 0x0) 0.2, Driver.Dispatch (queue worker 0x0) 0.2, Vulkan.DispatchRecipe (queue worker 0x0) 0.2 </details> - **A title where the cache pays:** Planet of Lana (PPSA19450), one profiled boot of a8e7e2f8a7 (the same build, relinked for that title), with its own usual switches: `APS5_STORAGE_CACHE_ENTRIES=1024 APS5_THREAD_PRIORITY=high APS5_PROFILE_DRAW=1` (`APS5_STORAGE_CACHE_ENTRIES` is #14220's cap, which isn't on `main`), no LAZY or NO_GPL, and a cold shader cache. It ran 15 min through the logos into its menu. Not a timing run. - **No `bypassed` line in the whole run.** The hit rate per 10 s block stayed between 15.8% and 75.0%, median 19.8%: 1,262,160 hits in 6,381,888 lookups. - The cache sat at its 4,096-entry cap, ~14-15.5 MiB of the 256 MiB budget, turning over by entry count. - **Resident Evil Village (PPSA01556), with the draw-cache budget off** (an earlier pair, 2026-10-28 morning). Static main menu, 16 min each run after an unmeasured warm-up, unprofiled, B A A B. - **Machine:** Windows 11 (10.0.26300), RTX 3070 Laptop GPU (NVIDIA 617.42), Ryzen 9 5900HS, 16 GB. GPU clocks weren't held, so frame times are rough. - **Binary:** one binary for all four runs, a local tree with the same code as this PR: `main` 85a4d7f8c8 plus #9129 and #8926 (both merged since), our local table-index and Village-harness commits, a local scePadOpen answer and a diagnostic print, with the bypass commit on top (7bc49ce4d0). - **Environment:** `APS5_LAZY_SHADER_PREPARE=1 APS5_NO_GPL=1 APS5_HOST_IMPORT_MIB=6400 APS5_TRACE_SUMMARY_EVERY=10`, and `APS5_DRAW_CACHE_BYTES=1099511627776` (budget off) in every run. - **Arms:** A sets `APS5_DRAW_CACHE_BYPASS_PERCENT=0` (no bypass); B leaves it unset (5%). | | B: bypass | A: no bypass | |---|---|---| | private bytes at menu +15 min | 19,466 / 19,310 MB | 23,187 / 23,186 MB | | private bytes at menu +1 min | 16,732 / 16,623 MB | 19,074 / 18,253 MB | | presents over menu +5 to +15 min (fps) | 286 (0.477) / 279 (0.465) | 246 (0.410) / 212 (0.353) | | frame p50 / p90 | 2.1 / 2.4 s and 2.1 / 2.3 s | 2.4 / 2.9 s and 2.9 / 3.6 s | | `Driver.Packet` ms per frame | 5,987 / 6,211 | 7,173 / 8,228 | | `Driver.Packet.memory_wait` ms per frame | 3,620 / 3,728 | 4,397 / 5,081 | - Memory: B is 3.8 GB lower at menu +15, and its two runs agree within 0.2 GB. - Speed: A slowed between its runs (0.410 to 0.353) while B held, so the gap is 0.06 to 0.12 fps. - All four runs are in the title's high host-import mode. B's second run made 172 GB of imports against 62 to 71 GB in the others, with private bytes and fps matching its first run. <details><summary>Summary lines (the last interval of B's and A's first runs)</summary> ``` {"commit":"7bc49ce4d0c9","dirty":false,"env":{"APS5_DRAW_CACHE_BYTES":"1099511627776","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":2733,"ms":10862.659},"interval_start_s":1257.191,"interval_end_s":1268.054,"presents":6,"frame_ms":{"p50":1836.380,"p90":1928.612,"p99":1928.612,"max":1928.612},"gpu_busy_ms_per_present":266.715,"worker_busy_pct":{"queue worker 0x0":99.663,"queue worker 0x38":0.126,"queue worker 0x20":93.060,"queue worker 0x28":96.135},"top_phases_ms_per_frame":{"Driver.Packet":5229.249,"Driver.Packet.memory_wait":3160.711,"Driver.Packet.draw":1490.415,"Driver.Draw":1489.694,"Graphics.Draw":1355.575,"Graphics.Draw.draw_and_resource_release":1337.340,"Resources.Complete":598.582,"Driver.Packet.dispatch":515.536},"trace_dropped":false,"trace":""} {"commit":"7bc49ce4d0c9","dirty":false,"env":{"APS5_DRAW_CACHE_BYPASS_PERCENT":"0","APS5_DRAW_CACHE_BYTES":"1099511627776","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":2514,"ms":10370.633},"interval_start_s":1225.751,"interval_end_s":1236.122,"presents":5,"frame_ms":{"p50":2120.289,"p90":2197.734,"p99":2197.734,"max":2197.734},"gpu_busy_ms_per_present":269.083,"worker_busy_pct":{"queue worker 0x0":99.701,"queue worker 0x38":0.114,"queue worker 0x20":93.775,"queue worker 0x28":96.549},"top_phases_ms_per_frame":{"Driver.Packet":6013.220,"Driver.Packet.memory_wait":3677.704,"Driver.Packet.draw":1713.861,"Driver.Draw":1713.070,"Graphics.Draw":1491.831,"Graphics.Draw.draw_and_resource_release":1471.150,"Resources.Complete":683.281,"Driver.Packet.dispatch":522.495},"trace_dropped":false,"trace":""} ``` </details> The traces themselves, the four runs' `aps5-summary.jsonl` files with every 10 s interval, stay on the test machine. `tools/trace_digest.py`'s text output for the same two runs is in [a comment](https://github.com/boykopovar/AnyPS5/pull/12478#issuecomment-6515078802). Those lines share one commit because the arms differ only in the environment. The pair above compares `main` and this PR as two builds. - **58171b22e8, a merge of `main` edf6804cf5** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/40833481793), validation [run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/40833526775)). The merge was clean: `CMakeLists.txt`, `Driver.hpp` and `ENVIRONMENT.md` merged without conflicts, and the PR's patch-id is unchanged. The Village pair, the captures and the profiled runs above were measured on a8e7e2f8a7, whose patch this merge doesn't change. - The two bypass tests and every `^agc_driver_draw_cache` test ×10. Linux: 13 run, 13 pass, 0 skip, 0 fail. Windows: 13 run, 0 pass, 13 skip, 0 fail, since the runner has no Vulkan device. The libc and libkernel suites run 191 and 291 tests on Linux and 220 and 314 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. - **Validation** (`VERIFY_VALIDATION=1` on GitHub's Linux runner, llvmpipe (LLVM 20.1.2, Mesa 25.2.8)), `main` edf6804cf5 against 58171b22e8: 13 passed, 0 skipped. `main` has no bypass tests, so its arm ran the other `^agc_driver_draw_cache` tests. `VUID-VkDeviceCreateInfo-pNext-pNext` appears in both arms, and the merge adds none. - **14209e93ba, a merge of `main` ebb4075168**, on top of c7981bcb3b and 40973d322a ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/40964058282), validation [run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/40964328058)). The merge was clean. - Every `^agc_driver_draw_cache` test ×10, the bypass and cold-scene tests included: - Linux: 15 run, 15 pass, 0 skip, 0 fail. - Windows: 15 run, 0 pass, 15 skip, 0 fail, since the runner has no Vulkan device. - The libc and libkernel suites run 193 and 294 tests on Linux and 223 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. - **Validation** (`VERIFY_VALIDATION=1` on GitHub's Linux runner, llvmpipe (LLVM 20.1.2, Mesa 25.2.8)), `main` ebb4075168 against this head: - 15 passed, 0 skipped. `main` has no bypass or cold-scene tests, so its arm ran the other `^agc_driver_draw_cache` tests. - `VUID-VkDeviceCreateInfo-pNext-pNext` appears in both arms, and the change adds none. - **05d2faab6c: 11e29b3107, the window race fix, then a merge of `main` 76fd1c09e9** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/40982361801), validation [run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/40982536053)). The merge was clean. - Every `^agc_driver_draw_cache` test ×10, `ConcurrentClosesKeepTheirOrder` included: - Linux: 15 run, 15 pass, 0 skip, 0 fail. - Windows: 15 run, 0 pass, 15 skip, 0 fail, since the runner has no Vulkan device. - 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. - **Validation** (`VERIFY_VALIDATION=1` on GitHub's Linux runner, llvmpipe (LLVM 20.1.2, Mesa 25.2.8)), `main` 76fd1c09e9 against this head: - 15 passed, 0 skipped. - `VUID-VkDeviceCreateInfo-pNext-pNext` appears in both arms, and the change adds none. - **Resident Evil Village (PPSA01556) on the new base, draw cache at `main`'s defaults, static main menu**, B A A B, one block, 2026-10-29 (PT), unprofiled. - **Machine:** the same as the pair above. GPU clocks weren't held. - **Trees:** - A = `main` ebb4075168, B = 14209e93ba, each with the same local `scePadOpen` answer and #11580 and #10304 merged. The A-to-B diff is exactly this PR's diff over `main`. - **Environment:** `APS5_LAZY_SHADER_PREPARE=1 APS5_NO_GPL=1 APS5_HOST_IMPORT_MIB=6400 APS5_TRACE_SUMMARY_EVERY=10` and the pad replay, no draw-cache variables, one shader cache warmed by an unmeasured cold run; 0 misses after b1's first 10 s. | | B: 14209e93ba | A: `main` ebb4075168 | |---|---|---| | fps over menu +5 to +15 min | 0.523 / 0.495 | 0.527 / 0.651 | | frame p50 / p90 | 1.82 / 2.19 s and 1.93 / 2.36 s | 1.83 / 2.31 s and 1.43 / 1.79 s | | `Driver.Packet` ms per frame (median) | 5,163 / 5,641 | 5,283 / 4,150 | | `Driver.Packet.memory_wait` ms per frame (median) | 3,051 / 3,270 | 3,133 / 2,450 | - **No measurable gain in this pair.** - B averages 0.509 fps and A 0.589. - A's own spread is 21.1 % (its second run is the high one), and B's is 5.5 %. - The b1/a1 same-phase pair is a tie (−0.8 %). - One block can't say more than that. - **167947744a, the tests' cost** (test-only): - **Why:** on an NVIDIA RTX 2000 Ada with the validation layers on, the four bypass tests ran past ctest's 120 s timeout and took 146 to 326 s alone. There, each draw that misses the cache or is bypassed costs about 10 to 20 ms. - **What changed:** the low-hit-rate and stage-hit cases draw only the lookups whose outcome they check, and note the rest of each 2,048-lookup window on the driver's bypass through `DriverTestAccess`. The cold-scene case keeps only its 1,000-draw scene, the one that is red on the head before the warm-up fix. No production code changed. - **What moved:** the draw-level checks stay draw-level, with fewer draws, including the draw whose pixel constant changed and must write the new colour. The third low window's 4,096-draw bypass, the draw after it, and the window of hits that ends a run are `LowWindowsLengthenTheBypass`'s, which now also requires that no draw is bypassed before the window that starts the bypass has closed. The stage-hit case now notes one low window first, so stage hits that didn't count as useful would start a bypass. - **Times on GitHub's Linux runner** (llvmpipe), 05d2faab6c against this head: | test | ×10, without validation | with validation | |---|---|---| | `agc_driver_draw_cache_cold_scene` | 8.83–11.50 s → 0.88–1.10 s | 18.78 s → 2.87 s | | `agc_driver_draw_cache_cold_scene_off` | 8.78–11.57 s → 0.85–1.12 s | 19.13 s → 2.83 s | | `agc_driver_draw_cache_low_hit_bypass` | 8.31–10.49 s → 0.44–0.65 s | 17.45 s → 1.16 s | | `agc_driver_draw_cache_low_hit_bypass_off` | 5.65–6.59 s → 0.50–0.67 s | 10.47 s → 1.04 s | - **×10** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/40995918186)), every `^agc_driver_draw_cache` test: - Linux: 15 run, 15 pass, 0 skip, 0 fail. - Windows: 15 run, 0 pass, 15 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. - **Validation** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/40996005609)), `main` 76fd1c09e9 against this head: 15 passed. `VUID-VkDeviceCreateInfo-pNext-pNext` appears in both arms, and the change adds none. - **Still red on 58171b22e8**, the head before the warm-up fix ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/40996093150)): the trimmed `agc_driver_draw_cache_cold_scene` fails with "frame 4 of a scene that repeats the same 1000 new draws every frame hit 0 of them, expected at least 90%", and its `_off` arm passes. On Windows both skip. - **Resident Evil Village (PPSA01556) on 167947744a, `main` 6472c708ae, draw cache at `main`'s defaults, static main menu.** B A A B, one block, 2026-10-30 (PT), unprofiled. - **Machine:** the same as the pairs above. GPU clocks weren't held: 90–96% of samples were in P0, with mean graphics clocks of 1,312–1,369 MHz. - **Trees** (both on the fork): - A = [237e88d4ff](https://github.com/EagleBearerYS/AnyPS5/commit/237e88d4ff9c6800ad9b6a97500cc130256c3c5f) ([`measure/12478-a-main-6472c708ae`](https://github.com/EagleBearerYS/AnyPS5/commits/measure/12478-a-main-6472c708ae)): `main` 6472c708ae, plus the local `scePadOpen` answer (a0486e8917), QRMOE's #11580 (fedf3e91a7, dbf2107ba6) and Ondra97's #10304 (e0d6e062a9). - B = [05bae016f8](https://github.com/EagleBearerYS/AnyPS5/commit/05bae016f8ddf8278fed0c94c905e67e8c265a79) ([`measure/12478-b-head-167947744a`](https://github.com/EagleBearerYS/AnyPS5/commits/measure/12478-b-head-167947744a)): the same, with 167947744a merged. The A-to-B diff is exactly this head's 8 files. - Both were built in one build directory, with the same flags. Of the 393 staged libraries, 386 are byte-identical; `libSceAgcDriver.prx` differs by this head's code, and five others differ only in PE timestamp and checksum bytes. - **Environment:** `APS5_LAZY_SHADER_PREPARE=1 APS5_NO_GPL=1 APS5_HOST_IMPORT_MIB=6400 APS5_TRACE_SUMMARY_EVERY=10` and the pad replay, with no draw-cache variables. One shader cache was warmed by an unmeasured run of A; its key, 5ccd6c63be592224, was the same before and after every run. | run | fps over menu +5 to +15 min | frame p50 / p90 | private bytes at menu +15 | |---|---|---|---| | b1 (B) | 0.666 | 1.43 / 1.86 s | 14,123 MB | | a1 (A) | 0.588 | 1.65 / 2.08 s | 14,139 MB | | a2 (A) | 0.583 | 1.70 / 2.06 s | 13,941 MB | | b2 (B) | 0.660 | 1.47 / 1.76 s | 14,085 MB | - **As measured:** B's mean is 0.663 fps against A's 0.585 (+13.3%), and both B runs are above both A runs. The two A runs are within 0.9% of each other, and the two B runs within 1.0%. Median phases, B against A: `Driver.Packet` 4,176 against 4,828 ms per frame, `Driver.Packet.draw` 1,120 against 1,294, and `memory_wait` 13.8% lower. - **Load:** non-game CPU in the window was 43.8, 42.9, 41.8 and 36.1%. b2 ran lighter than the other three. On the three within 2 points of each other, b1 against the A mean is +13.9%. - **Health:** no failed host imports and no stop line, and the menu was first seen at +5.5 to +6.2 min. a1, a2 and b2 each logged one presenter FATAL at close time, after the window. Pixel comparison of the static regions at menu +10 shows B rendering like A. - **Not attributed to this change.** One profiled boot of each tree, with `APS5_PROFILE_DRAW=1` added, over the same window. That switch turns off the finisher hand-off, so the boots are compared only with each other: - **The bypass:** B printed `[draw-cache] bypassed` in 0 of the window's 57 ten-second blocks. All 12 of its bypass lines came during loading, 50 to 610 s after launch. - **The cache, in both:** 0 hits in every block. It sat at 255 of its 256 MiB, and every eviction was over the byte budget. Lookups per 10 s were about the number of draw packets (medians: A 4,288, B 5,208). - **The code:** with the bypass off, this head does no less work per draw than `main`. It adds a `drawKeySeen` lookup under `drawCacheMutex` for each lookup that doesn't hit, a relaxed atomic load per draw and a compare-exchange per lookup. - **The profiled boots' times aren't compared:** A's boot ran with 48.7% non-game CPU against B's 37.4%. - So the pair's gain isn't explained by the bypass, and this description claims no speed gain. - **Captures,** as the Performance report form describes: one traced run per arm on the same trees and cache, A (16:21–16:43) then B (16:44–17:06) in one session, with `APS5_TRACE_SECONDS=960:30` and the pad replay, and no other trace or profile switch. The window opens 960 s after the first present, at about menu +11 min. Neither trace dropped events. GPU clocks weren't logged for these two runs. - B against A over the window: 22 presents each; frame p50 1,358 against 1,401 ms, p90 1,505 against 1,709 ms, p99 1,681 against 1,986 ms; `Driver.Packet` 3,884 against 4,051 ms per frame, of which `memory_wait` 2,284 against 2,363 and `Packet.draw` 1,054 against 1,065; GPU busy per present 237 against 248 ms. - The traces: A [`aps5-trace-237e88d4ff9c-28876.json.gz`](https://github.com/EagleBearerYS/AnyPS5/releases/download/traces-12478/aps5-trace-237e88d4ff9c-28876.json.gz) (2.6 MB) and B [`aps5-trace-05bae016f8dd-11428.json.gz`](https://github.com/EagleBearerYS/AnyPS5/releases/download/traces-12478/aps5-trace-05bae016f8dd-11428.json.gz) (2.4 MB). Their `tools/trace_digest.py` output is in [this comment](https://github.com/boykopovar/AnyPS5/pull/12478#issuecomment-6538576016). - Both summary lines say `"dirty": true`. That's `trace_revision.cmake`'s porcelain check seeing only `3rdparty/freetype` as modified: `main`'s new freetype pin has a nested `subprojects/dlg` that can't be fetched. With submodule content ignored, the status is empty, the same in both trees, so neither tree has a source change beyond its commit. - The summary lines, as `aps5-summary.jsonl` holds them (A, then B): ```json {"commit":"237e88d4ff9c","dirty":true,"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":2821,"ms":31663.912},"presents":22,"frame_ms":{"p50":1400.899,"p90":1708.722,"p99":1985.646,"max":1985.646},"gpu_busy_ms_per_present":248.362,"worker_busy_pct":{"queue worker 0x0":99.512,"queue worker 0x38":0.083,"queue worker 0x28":93.381,"queue worker 0x20":88.858},"top_phases_ms_per_frame":{"Driver.Packet":4051.385,"Driver.Packet.memory_wait":2363.248,"Driver.Packet.draw":1064.743,"Driver.Draw":1063.573,"Graphics.Draw":834.753,"Graphics.Draw.draw_and_resource_release":812.4,"Driver.Packet.dispatch":565.972,"Driver.Dispatch":515.708},"trace_dropped":false,"trace":"aps5-trace-237e88d4ff9c-28876.json.gz"} {"commit":"05bae016f8dd","dirty":true,"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":2834,"ms":30167.48},"presents":22,"frame_ms":{"p50":1358.259,"p90":1505.007,"p99":1680.983,"max":1680.983},"gpu_busy_ms_per_present":237.445,"worker_busy_pct":{"queue worker 0x0":99.552,"queue worker 0x38":0.053,"queue worker 0x20":89.735,"queue worker 0x28":94.132},"top_phases_ms_per_frame":{"Driver.Packet":3883.824,"Driver.Packet.memory_wait":2284.046,"Driver.Packet.draw":1054.258,"Driver.Draw":1053.291,"Graphics.Draw":846.766,"Graphics.Draw.draw_and_resource_release":828.217,"Driver.Packet.dispatch":505.62,"Driver.Dispatch":445.217},"trace_dropped":false,"trace":"aps5-trace-05bae016f8dd-11428.json.gz"} ``` - **eaafdf934b, the cold-scene case's cost** (test-only; `DrawCacheReuse.cpp`, +6 −3). The pair above ran on 167947744a's library code, which this head doesn't change. - **Why:** on TechLevelZero's NVIDIA run of 167947744a, `agc_driver_draw_cache_cold_scene` and `_off` took 93.3 and 94.8 s with the validation layers on. Each arm drew a 1,000-draw scene for 4 frames, 4,000 draws. - Under the two-low-windows rule, that scene had also stopped depending on the warm-up: its first window held 48 hits and its second was useful, so it stayed green with the warm-up taken out. - **What changed:** the case notes one low window on the driver's bypass, as the stage-hit case does. It then draws a 128-draw scene for 4 frames and closes the window after the second frame: 512 draws per arm. - With the warm-up, the window's 128 second sightings are useful (more than the 103 of 5% of 2,048), so the run of low windows ends and frame 4 hits. - Without it, that window is the second low one in a row, and frame 4 is bypassed. - The assertion (at least 90% hits in frame 4), the frame count and the `_off` arm are unchanged. - **Red** (Linux, lavapipe), each mutation built and reverted: - the warm-up off (`|| drawKeySeen(drawKey)` removed from `drawCacheBypass.Note(...)`): the default arm fails, "frame 4 of a scene that repeats the same 128 new draws every frame, after a low window and with the scene's first two frames closing the next one, hit 0 of them, expected at least 90%"; - that plus `APS5_DRAW_CACHE_BYPASS_PERCENT` ignored: the `_off` arm fails too; - the bypass after one low window (`LowWindowsToBypass = 1`): the default arm fails. - 167947744a's 1,000-draw case passes all three. - **Times on lavapipe,** three runs each: plain, 0.89 s before and 0.21 s after; with the validation layer, 2.3 s before and 0.47 s after. On NVIDIA, TechLevelZero's run on this head ([report](https://github.com/boykopovar/AnyPS5/pull/12478#issuecomment-6538913952)) took 15.3 and 14.8 s for the two arms with the validation layers on, against 93.3 and 94.8 s on 167947744a. It passed with 0 new failures and no new validation IDs. - **×10** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41151411057)), every `^agc_driver_draw_cache_` test: - Linux: 15 run, 15 pass, 0 skip, 0 fail. - Windows: 15 run, 0 pass, 15 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. - **da441e01cc, a merge of `main` 0836dfdf4f** ([run](https://github.com/EagleBearerYS/AnyPS5/actions/runs/41239556589)). #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_draw_cache_reuse_tests.cmake` (+12 lines). Nothing else conflicted. Apart from the move, this PR's diff is unchanged. With `-DBUILD_TESTING=ON`, `ctest -N` gives 3079 tests: `main`'s 3075 plus its 4 tests, each listed once. The 16 tests matching `^agc_driver_draw_cache_` pass 10 runs in a row. Linux: 16 run, 16 pass, 0 skip, 0 fail. Windows: 16 run, 0 pass, 16 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. - **NVIDIA, TechLevelZero's GPU runner** ([report](https://github.com/boykopovar/AnyPS5/pull/12478#issuecomment-6550110969)): da441e01cc merged onto `main` 0836dfdf4f, NVIDIA RTX 2000 Ada Generation, driver 595.99.02, Linux. Passed: 2,447 passed, 0 new failures (4 fail on `main` too, and 2 are unstable there), and no new validation IDs against `main` over 928 tests run on the GPU. ### 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 (see Overlap) - [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: n/a, none added - [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: n/a, none - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: none - [x] GPUs tested: NVIDIA GeForce RTX 3070 Laptop GPU, driver 617.42, Windows 11 (10.0.26300); llvmpipe (lavapipe) on GitHub's Linux runner - [x] AI-assisted: yes
MarcZX10 commented 2026-10-28 15:46:18 +00:00 (Migrated from github.com)

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

Review: CHANGES_REQUESTED


I reviewed the exact head 3e4d8e25f2. Two items need resolution before approval.

  1. APS5_DRAW_CACHE_BYPASS_PERCENT=5 is documented as bypassing when fewer than 5% of 2,048 lookups hit. But minimumHits = 2048 * 5 / 100 truncates to 102, and the test explicitly treats 102/2,048 (4.9805%) as meeting the threshold. If the documented percentage is literal, the minimum count should be ceil(2048 * percent / 100) (103 for 5%), and the boundary test should cover 102 versus 103. Alternatively, document that the integer threshold is rounded down and test that contract.

  2. The perf evidence still does not show the required main-versus-change capture. The summary lines in the body use commit 7bc49ce4d0c9 for both bypass-on and bypass-off runs; setting APS5_DRAW_CACHE_BYPASS_PERCENT=0 on the changed binary is a useful control, but it is not a capture on main. The red/green test run is on main 04fefebe90, and the requested VERIFY_VALIDATION=1 comparison is still listed as running. Please add matched main and exact-head captures/traces/digests and finish the validation comparison on the current base f8f5b24b77ad. I did not independently run the GPU tests or capture.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5685508277 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12478#pullrequestreview-5685508277). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-28T15:46:18Z. **Review:** CHANGES_REQUESTED --- I reviewed the exact head `3e4d8e25f2`. Two items need resolution before approval. 1. `APS5_DRAW_CACHE_BYPASS_PERCENT=5` is documented as bypassing when fewer than 5% of 2,048 lookups hit. But `minimumHits = 2048 * 5 / 100` truncates to 102, and the test explicitly treats 102/2,048 (4.9805%) as meeting the threshold. If the documented percentage is literal, the minimum count should be `ceil(2048 * percent / 100)` (103 for 5%), and the boundary test should cover 102 versus 103. Alternatively, document that the integer threshold is rounded down and test that contract. 2. The `perf` evidence still does not show the required main-versus-change capture. The summary lines in the body use commit `7bc49ce4d0c9` for both bypass-on and bypass-off runs; setting `APS5_DRAW_CACHE_BYPASS_PERCENT=0` on the changed binary is a useful control, but it is not a capture on `main`. The red/green test run is on `main` `04fefebe90`, and the requested `VERIFY_VALIDATION=1` comparison is still listed as running. Please add matched `main` and exact-head captures/traces/digests and finish the validation comparison on the current base `f8f5b24b77ad`. I did not independently run the GPU tests or capture.
MarcZX10 commented 2026-10-29 05:22:51 +00:00 (Migrated from github.com)

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

Review: CHANGES_REQUESTED


Re-checked — changes requested

The new report fixes the threshold/stage-hit findings and includes paired traces and digest output, but it still does not meet the performance form’s capture requirements, and this head is based on an older main that changed two touched paths.

What I ran

  • Reviewed exact head a8e7e2f8a72888acfc3aa9bcb4c9a90bb711f0b8 against current main 52c09d567d2fa453494dd720fcf53a98149468e4.
  • Ran git merge-tree --write-tree, git diff --check, and compared paths changed on current main since the PR merge base.
  • Inspected the updated threshold/concurrency implementation and tests, validation results, performance comparison, trace links, digest output, and the current performance report form.

Results

Check Result
Current-main preview Clean; tree c2666560a7cb061410bce876ecbe3881bbca4589
Branch base Merge base 319621ba2e578bd053b0baba2877fe70520e0737; current main has 204 later commits
Same paths changed on current main core/libs/prx/libSceAgcDriver/CMakeLists.txt and core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp
Focused tests Author reports 13/13 Linux tests on exact PR head and red/green tests for the earlier commits; Windows GPU tests ran only on the first commit, while the GitHub Windows runner has no Vulkan device
Validation comparison Author reports 13/13 tests with no new VUIDs on llvmpipe for head a8e7e2f8a7 vs main 319621ba2e
Performance comparison Author provides main/head runs on the same Resident Evil Village menu, Windows 11, RTX 3070 Laptop GPU, driver 617.42, Ryzen 9 5900HS, and trace digests; reports +26% mean FPS and lower frame p90
Report-form gaps No raw aps5-summary.jsonl lines are pasted for the paired main/head captures. The captures set APS5_TRACE_SUMMARY_EVERY=10, an additional APS5_TRACE_* switch prohibited by the form
Raw output
$ git merge-tree --write-tree refs/review/main-20261029b refs/review/pr-12478-20261029
c2666560a7cb061410bce876ecbe3881bbca4589
exit=0
merge-base: 319621ba2e578bd053b0baba2877fe70520e0737
current main: 52c09d567d2fa453494dd720fcf53a98149468e4
main commits after base: 204
changed-path intersection:
core/libs/prx/libSceAgcDriver/CMakeLists.txt
core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp
$ git diff --check refs/review/main-20261029b...refs/review/pr-12478-20261029
(no output)

Negative control

  • The author reports the new boundary test fails with 102/2,048 hits on the previous floor-threshold commit and passes with the corrected ceiling threshold; the stage-hit and concurrent-window tests also distinguish the earlier implementation. I did not rerun these locally.

Findings

Blocking

  • The performance report describes the two JSON blocks as trace_digest.py output and says the aps5-summary.jsonl files stay on the test machine. The report form requires the actual summary line for each compared capture. Please paste the exact aps5-summary.jsonl line from the main run and the exact line from this-head run; the digest JSON objects are not substitutes for those lines.
  • The paired captures include APS5_TRACE_SUMMARY_EVERY=10, in addition to the permitted APS5_TRACE_SECONDS=960:40. The form explicitly says to set no other APS5_TRACE_* or APS5_PROFILE_* switch because they cost time. Please recapture the same main/head scene without that extra switch, paste both summary lines, attach the two traces, and include trace_digest.py output for those exact traces.
  • Rebase onto current main and rerun the focused draw-cache tests and validation comparison on that exact integrated head. Current main changed both CMakeLists.txt and Driver.hpp after this branch’s base, so the existing exact-head test and performance reports do not cover the current tree.

Non-blocking

  • The updated implementation now uses a 64-bit compare-exchange window, counts stage hits, and rounds the minimum hit count up; the focused cases cover the 102/103 boundary, cache resume, stage reuse and concurrent closure. Those changes address the earlier code findings.
  • The reported main-menu capture shows no material memory reduction at the default 256 MiB budget; it reports a speed improvement, but Packet.dispatch is higher on the change. Keep both effects visible in the report.

Sources

Not verified

  • I did not rerun the tests, validation comparison, captures, or digest locally. The tests and performance evidence are author-reported. The current-main preview is clean but does not substitute for a current-base test run.

To get this to a good state

Rebase onto current main, rerun the focused draw-cache/validation tests, then capture main and the rebased head on the same machine and scene with only the required trace setting. Paste the exact two aps5-summary.jsonl lines, attach those two traces, and include digest output generated from those same traces.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5693225229 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12478#pullrequestreview-5693225229). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-29T05:22:51Z. **Review:** CHANGES_REQUESTED --- # Re-checked — changes requested The new report fixes the threshold/stage-hit findings and includes paired traces and digest output, but it still does not meet the performance form’s capture requirements, and this head is based on an older `main` that changed two touched paths. ## What I ran - Reviewed exact head `a8e7e2f8a72888acfc3aa9bcb4c9a90bb711f0b8` against current `main` `52c09d567d2fa453494dd720fcf53a98149468e4`. - Ran `git merge-tree --write-tree`, `git diff --check`, and compared paths changed on current `main` since the PR merge base. - Inspected the updated threshold/concurrency implementation and tests, validation results, performance comparison, trace links, digest output, and the current performance report form. ## Results | Check | Result | |---|---| | Current-main preview | Clean; tree `c2666560a7cb061410bce876ecbe3881bbca4589` | | Branch base | Merge base `319621ba2e578bd053b0baba2877fe70520e0737`; current main has 204 later commits | | Same paths changed on current main | `core/libs/prx/libSceAgcDriver/CMakeLists.txt` and `core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp` | | Focused tests | Author reports 13/13 Linux tests on exact PR head and red/green tests for the earlier commits; Windows GPU tests ran only on the first commit, while the GitHub Windows runner has no Vulkan device | | Validation comparison | Author reports 13/13 tests with no new VUIDs on llvmpipe for head `a8e7e2f8a7` vs main `319621ba2e` | | Performance comparison | Author provides main/head runs on the same Resident Evil Village menu, Windows 11, RTX 3070 Laptop GPU, driver 617.42, Ryzen 9 5900HS, and trace digests; reports +26% mean FPS and lower frame p90 | | Report-form gaps | No raw `aps5-summary.jsonl` lines are pasted for the paired main/head captures. The captures set `APS5_TRACE_SUMMARY_EVERY=10`, an additional `APS5_TRACE_*` switch prohibited by the form | <details> <summary>Raw output</summary> ```text $ git merge-tree --write-tree refs/review/main-20261029b refs/review/pr-12478-20261029 c2666560a7cb061410bce876ecbe3881bbca4589 exit=0 merge-base: 319621ba2e578bd053b0baba2877fe70520e0737 current main: 52c09d567d2fa453494dd720fcf53a98149468e4 main commits after base: 204 changed-path intersection: core/libs/prx/libSceAgcDriver/CMakeLists.txt core/libs/prx/libSceAgcDriver/Execution/include/Driver/Driver.hpp $ git diff --check refs/review/main-20261029b...refs/review/pr-12478-20261029 (no output) ``` </details> ## Negative control - The author reports the new boundary test fails with 102/2,048 hits on the previous floor-threshold commit and passes with the corrected ceiling threshold; the stage-hit and concurrent-window tests also distinguish the earlier implementation. I did not rerun these locally. ## Findings ### Blocking - The performance report describes the two JSON blocks as `trace_digest.py` output and says the `aps5-summary.jsonl` files stay on the test machine. The report form requires the actual summary line for each compared capture. Please paste the exact `aps5-summary.jsonl` line from the main run and the exact line from this-head run; the digest JSON objects are not substitutes for those lines. - The paired captures include `APS5_TRACE_SUMMARY_EVERY=10`, in addition to the permitted `APS5_TRACE_SECONDS=960:40`. The form explicitly says to set no other `APS5_TRACE_*` or `APS5_PROFILE_*` switch because they cost time. Please recapture the same main/head scene without that extra switch, paste both summary lines, attach the two traces, and include `trace_digest.py` output for those exact traces. - Rebase onto current `main` and rerun the focused draw-cache tests and validation comparison on that exact integrated head. Current main changed both `CMakeLists.txt` and `Driver.hpp` after this branch’s base, so the existing exact-head test and performance reports do not cover the current tree. ### Non-blocking - The updated implementation now uses a 64-bit compare-exchange window, counts stage hits, and rounds the minimum hit count up; the focused cases cover the 102/103 boundary, cache resume, stage reuse and concurrent closure. Those changes address the earlier code findings. - The reported main-menu capture shows no material memory reduction at the default 256 MiB budget; it reports a speed improvement, but `Packet.dispatch` is higher on the change. Keep both effects visible in the report. ## Sources - [Performance capture protocol at current main](https://github.com/boykopovar/AnyPS5/blob/52c09d567d2fa453494dd720fcf53a98149468e4/.github/ISSUE_TEMPLATE/performance.yml#L8-L15) - [Required summary lines, traces and digest fields](https://github.com/boykopovar/AnyPS5/blob/52c09d567d2fa453494dd720fcf53a98149468e4/.github/ISSUE_TEMPLATE/performance.yml#L31-L45) - [AGC validation requirement at current main](https://github.com/boykopovar/AnyPS5/blob/52c09d567d2fa453494dd720fcf53a98149468e4/CONTRIBUTING.md#L70-L70) - [Draw-cache implementation at reviewed head](https://github.com/boykopovar/AnyPS5/tree/a8e7e2f8a72888acfc3aa9bcb4c9a90bb711f0b8/core/libs/prx/libSceAgcDriver/Execution) - [Draw-cache regression tests at reviewed head](https://github.com/boykopovar/AnyPS5/blob/a8e7e2f8a72888acfc3aa9bcb4c9a90bb711f0b8/core/libs/prx/libSceAgcDriver/Execution/tests/execution/DrawCacheReuse.cpp) ## Not verified - I did not rerun the tests, validation comparison, captures, or digest locally. The tests and performance evidence are author-reported. The current-main preview is clean but does not substitute for a current-base test run. ## To get this to a good state Rebase onto current `main`, rerun the focused draw-cache/validation tests, then capture main and the rebased head on the same machine and scene with only the required trace setting. Paste the exact two `aps5-summary.jsonl` lines, attach those two traces, and include digest output generated from those same traces.
MarcZX10 commented 2026-10-29 08:36:04 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-29T08:36:04Z.

Review: CHANGES_REQUESTED


Re-reviewed exact head 58171b22e89daedc60672482d0eb349b36609ac1 and your new test report. The draw-cache tests on this head and the validation-layer comparison are useful; they address the focused correctness run. The branch’s merge base is still edf6804cf52c62eacafc592dd6142cb4efe5bd05, not current main 4c7d275bef89d309313d16bc2bc05d37a1b50be2. Current main changed CMakeLists.txt and Driver.hpp, both touched by this PR. The report’s perf pair also remains against an older baseline, so please integrate current main, rerun the focused validation comparison, and refresh the matched performance capture against that current main and the resulting head. Merge preview is clean; diff check and conventions pass. I did not run GPU tests locally.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5694873965 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12478#pullrequestreview-5694873965). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-29T08:36:04Z. **Review:** CHANGES_REQUESTED --- Re-reviewed exact head `58171b22e89daedc60672482d0eb349b36609ac1` and your new test report. The draw-cache tests on this head and the validation-layer comparison are useful; they address the focused correctness run. The branch’s merge base is still `edf6804cf52c62eacafc592dd6142cb4efe5bd05`, not current `main` `4c7d275bef89d309313d16bc2bc05d37a1b50be2`. Current main changed `CMakeLists.txt` and `Driver.hpp`, both touched by this PR. The report’s perf pair also remains against an older baseline, so please integrate current main, rerun the focused validation comparison, and refresh the matched performance capture against that current main and the resulting head. Merge preview is clean; diff check and conventions pass. I did not run GPU tests locally.
adriadam10 commented 2026-10-29 22:03:44 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-29T22:03:44Z.

Review: CHANGES_REQUESTED


Thanks for the work. The threshold, the single-word window and the tests look right. What blocks it:

  • Cold-start regression (reported by @bcortezf with a table): DrawCacheBypass::Note (Draw.cpp:664) counts a hit only when a cached draw of the same shape exists. With second-sight admission the first two sightings of every draw miss, so on a cold start with more than ~700 distinct draws per frame the first 2,048-lookup window stays under 5% and the bypass starts. While it runs no sightings or inserts happen, so warm-up takes 14-19 frames against 2 on main. You agreed in your reply; please push that fix. A lookup whose key DrawKeySightings has already seen should count towards the window, or the bypass should need two consecutive low windows. Scenes whose keys never repeat must still bypass.
  • Test for it: a cold start followed by the same F distinct draws every frame (F = 1,000 to 4,096), asserting the cache reaches a high hit rate as fast as with APS5_DRAW_CACHE_BYPASS_PERCENT=0. It has to fail on this head.
  • Lock on the cheap path: Draw.cpp:391 takes drawCacheMutex for every bypassed draw only to bump bypassed; make it an atomic.
  • Description: it says a stage is "reused", but the window counts "a cached draw of the same shape exists" (dataCandidates not empty) before the data and push-offset checks. Say what is counted, here and in ENVIRONMENT.md.
  • Base: integrate current main (it changed CMakeLists.txt and Driver.hpp) and rerun the draw-cache tests and the perf pair on the new base.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5705567975 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12478#pullrequestreview-5705567975). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-29T22:03:44Z. **Review:** CHANGES_REQUESTED --- Thanks for the work. The threshold, the single-word window and the tests look right. What blocks it: - **Cold-start regression** (reported by @bcortezf with a table): `DrawCacheBypass::Note` (`Draw.cpp:664`) counts a hit only when a cached draw of the same shape exists. With second-sight admission the first two sightings of every draw miss, so on a cold start with more than ~700 distinct draws per frame the first 2,048-lookup window stays under 5% and the bypass starts. While it runs no sightings or inserts happen, so warm-up takes 14-19 frames against 2 on `main`. You agreed in your reply; please push that fix. A lookup whose key `DrawKeySightings` has already seen should count towards the window, or the bypass should need two consecutive low windows. Scenes whose keys never repeat must still bypass. - **Test for it:** a cold start followed by the same F distinct draws every frame (F = 1,000 to 4,096), asserting the cache reaches a high hit rate as fast as with `APS5_DRAW_CACHE_BYPASS_PERCENT=0`. It has to fail on this head. - **Lock on the cheap path:** `Draw.cpp:391` takes `drawCacheMutex` for every bypassed draw only to bump `bypassed`; make it an atomic. - **Description:** it says a stage is "reused", but the window counts "a cached draw of the same shape exists" (`dataCandidates` not empty) before the data and push-offset checks. Say what is counted, here and in `ENVIRONMENT.md`. - **Base:** integrate current `main` (it changed `CMakeLists.txt` and `Driver.hpp`) and rerun the draw-cache tests and the perf pair on the new base.
MarcZX10 commented 2026-10-30 00:42:14 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-30T00:42:14Z.

Review: CHANGES_REQUESTED


Reviewed — changes requested

The new head adds the warm-up and accounting changes, but concurrent window closures can violate the documented rule that a useful window resets the low-hit streak; current-main tests and a current-base performance pair are also still missing.

What I ran

  • Reviewed exact PR head 14209e93badbf5cc32aa2122a803c3bc2052b0c0. Its merge base is ebb4075168e9d96a2b3f177d9e6cda6900326e27; freshly fetched upstream main is 401e4babaa18afaf02d3f0c32ba13f9b8c8e4d66.
  • Environment: Linux x86-64, source and repository checks only; no compiler, build, test, or GPU capture was run locally.
  • The merge preview against current main was clean. Current main and this PR both change core/libs/prx/libSceAgcDriver/CMakeLists.txt and docs/dev/ENVIRONMENT.md.
git fetch upstream main refs/pull/12478/head:refs/review/pr-12478-current
git merge-tree --write-tree upstream/main refs/review/pr-12478-current
git diff --check upstream/main...refs/review/pr-12478-current
python tools/check_conventions.py --base upstream/main --head refs/review/pr-12478-current
base=$(git merge-base upstream/main refs/review/pr-12478-current)
comm -12 <(git diff --name-only "$base"..upstream/main | sort) <(git diff --name-only upstream/main...refs/review/pr-12478-current | sort)

Results

Check Result
Current-main merge preview Clean
Diff check Passed (exit 0)
Conventions Passed
Shared changed paths since merge base CMake test registration and ENVIRONMENT.md
Focused tests and validation The PR description reports 15/15 draw-cache tests and a validation-layer comparison on head 14209e93ba against main ebb4075168; I did not run them.
Performance report The description still says the Resident Evil Village pair on the current base/head is pending. Existing captures are from older commits.
Unedited output from the local checks
main=401e4babaa18afaf02d3f0c32ba13f9b8c8e4d66
head=14209e93badbf5cc32aa2122a803c3bc2052b0c0
merge_base=ebb4075168e9d96a2b3f177d9e6cda6900326e27
baedb2d01e9dda65dd31e47c2cdcdb050753c598
merge_tree_exit=0
diff_check_exit=0
All conventions checks passed.
conventions_exit=0
core/libs/prx/libSceAgcDriver/CMakeLists.txt
docs/dev/ENVIRONMENT.md

Negative control

Assertion Change to code under test Did the new test fail?
A useful window clears the low-window streak even when adjacent windows close concurrently No mutation or concurrent low/useful-window interleaving was run; the added concurrency test uses all-hit windows followed by sequential low windows. Not exercised

Findings

Blocking

  • Window results are not applied in completion order. The atomic window compare-exchange closes each 2,048-lookup window, but each closing thread updates lowWindows afterward using a separate load/store. If a low-window closer reads the old streak, pauses, and a following useful-window closer stores zero, the first closer can then store its stale increment. One subsequent low window can therefore start bypass even though a useful window intervened, contrary to the documented “a useful window ends the run” behavior. Please make the streak update linearizable in window order and add a concurrency regression that verifies a useful window resets the streak when adjacent close handling overlaps.
  • The current-main validation and performance evidence do not cover the current integration. This head is based on ebb4075168, while current main is 401e4babaa; both changed CMakeLists.txt, which this PR also changes. Please validate the focused tests and validation comparison on an integration with current main. The PR description also says the matched Resident Evil Village capture pair for the new head is pending. The performance form requires same-machine, same-session base/change captures and their summary lines; please add the exact lines, traces, and digest output for current main and the corrected head.

Non-blocking

  • The exact-head source diff remains mergeable with current main; the merge preview alone does not substitute for tests on the integrated tree.

Sources

Not verified

I did not build or run tests, validation layers, a console/game session, or performance captures locally. The PR’s reported test/validation runs cover its stated ebb4075168 integration, not current main 401e4babaa. Hosted Windows passed; product Linux and specialized jobs were skipped.

To get this to a good state

Serialize the low-window streak decision with window completion, add a concurrent reset regression, integrate or otherwise validate against current main, and attach the matched performance pair for that resulting head. I will rerun the same source checks and reassess the exact new head and reported tests/captures.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5706775643 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12478#pullrequestreview-5706775643). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-30T00:42:14Z. **Review:** CHANGES_REQUESTED --- # Reviewed — changes requested The new head adds the warm-up and accounting changes, but concurrent window closures can violate the documented rule that a useful window resets the low-hit streak; current-main tests and a current-base performance pair are also still missing. ## What I ran - Reviewed exact PR head `14209e93badbf5cc32aa2122a803c3bc2052b0c0`. Its merge base is `ebb4075168e9d96a2b3f177d9e6cda6900326e27`; freshly fetched upstream `main` is `401e4babaa18afaf02d3f0c32ba13f9b8c8e4d66`. - Environment: Linux x86-64, source and repository checks only; no compiler, build, test, or GPU capture was run locally. - The merge preview against current `main` was clean. Current `main` and this PR both change `core/libs/prx/libSceAgcDriver/CMakeLists.txt` and `docs/dev/ENVIRONMENT.md`. ```sh git fetch upstream main refs/pull/12478/head:refs/review/pr-12478-current git merge-tree --write-tree upstream/main refs/review/pr-12478-current git diff --check upstream/main...refs/review/pr-12478-current python tools/check_conventions.py --base upstream/main --head refs/review/pr-12478-current base=$(git merge-base upstream/main refs/review/pr-12478-current) comm -12 <(git diff --name-only "$base"..upstream/main | sort) <(git diff --name-only upstream/main...refs/review/pr-12478-current | sort) ``` ## Results | Check | Result | |---|---| | Current-main merge preview | Clean | | Diff check | Passed (exit 0) | | Conventions | Passed | | Shared changed paths since merge base | CMake test registration and `ENVIRONMENT.md` | | Focused tests and validation | The PR description reports 15/15 draw-cache tests and a validation-layer comparison on head `14209e93ba` against `main` `ebb4075168`; I did not run them. | | Performance report | The description still says the Resident Evil Village pair on the current base/head is pending. Existing captures are from older commits. | <details> <summary>Unedited output from the local checks</summary> ```text main=401e4babaa18afaf02d3f0c32ba13f9b8c8e4d66 head=14209e93badbf5cc32aa2122a803c3bc2052b0c0 merge_base=ebb4075168e9d96a2b3f177d9e6cda6900326e27 baedb2d01e9dda65dd31e47c2cdcdb050753c598 merge_tree_exit=0 diff_check_exit=0 All conventions checks passed. conventions_exit=0 core/libs/prx/libSceAgcDriver/CMakeLists.txt docs/dev/ENVIRONMENT.md ``` </details> ## Negative control | Assertion | Change to code under test | Did the new test fail? | |---|---|---| | A useful window clears the low-window streak even when adjacent windows close concurrently | No mutation or concurrent low/useful-window interleaving was run; the added concurrency test uses all-hit windows followed by sequential low windows. | Not exercised | ## Findings ### Blocking - **Window results are not applied in completion order.** The atomic `window` compare-exchange closes each 2,048-lookup window, but each closing thread updates `lowWindows` afterward using a separate load/store. If a low-window closer reads the old streak, pauses, and a following useful-window closer stores zero, the first closer can then store its stale increment. One subsequent low window can therefore start bypass even though a useful window intervened, contrary to the documented “a useful window ends the run” behavior. Please make the streak update linearizable in window order and add a concurrency regression that verifies a useful window resets the streak when adjacent close handling overlaps. - **The current-main validation and performance evidence do not cover the current integration.** This head is based on `ebb4075168`, while current `main` is `401e4babaa`; both changed `CMakeLists.txt`, which this PR also changes. Please validate the focused tests and validation comparison on an integration with current `main`. The PR description also says the matched Resident Evil Village capture pair for the new head is pending. The performance form requires same-machine, same-session base/change captures and their summary lines; please add the exact lines, traces, and digest output for current `main` and the corrected head. ### Non-blocking - The exact-head source diff remains mergeable with current `main`; the merge preview alone does not substitute for tests on the integrated tree. ## Sources - [Window rollover and low-streak updates at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/14209e93badbf5cc32aa2122a803c3bc2052b0c0/core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawCache.cpp#L54-L69) - [Concurrency test at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/14209e93badbf5cc32aa2122a803c3bc2052b0c0/core/libs/prx/libSceAgcDriver/tests/execution/DrawCacheReuse.cpp#L361-L389) - [Performance report requirements at current `main`](https://github.com/boykopovar/AnyPS5/blob/401e4babaa18afaf02d3f0c32ba13f9b8c8e4d66/.github/ISSUE_TEMPLATE/performance.yml#L8-L45) ## Not verified I did not build or run tests, validation layers, a console/game session, or performance captures locally. The PR’s reported test/validation runs cover its stated `ebb4075168` integration, not current `main` `401e4babaa`. Hosted Windows passed; product Linux and specialized jobs were skipped. ## To get this to a good state Serialize the low-window streak decision with window completion, add a concurrent reset regression, integrate or otherwise validate against current `main`, and attach the matched performance pair for that resulting head. I will rerun the same source checks and reassess the exact new head and reported tests/captures.
adriadam10 commented 2026-10-30 02:42:34 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-30T02:42:34Z.

Review: CHANGES_REQUESTED


Thanks, the five points are all in: warm-up, atomic counter, description, base, and the window-close race. I read Note/Skip and the single-word state looks correct. What still blocks it:

  • No benefit shown. The description now says the current head has no measurable gain (B 0.523/0.495 fps vs A 0.527/0.651, 21% spread), and the +26% was on a head before the warm-up fix. The PR is titled perf and adds a new window, env var and counters. Please show one scene where the bypass starts under the "seen before counts as useful" rule and the gain is outside noise, with tools/trace_digest.py summaries of main and the change from the same machine and scene. You have the profiled boot pending; post it. Without a scene where it fires and helps, the change adds complexity for nothing, and the direction would be to drop it.
  • Test cost. On the NVIDIA run (14209e9), agc_driver_draw_cache_cold_scene, _off, low_hit_bypass and _off all hit the 120 s timeout in the parallel run and passed only on a 360 s retry. Please cut their draw counts or frames so each runs well under the default timeout with validation layers on.

Everything else from the last review is met. Once a measured gain is posted this is ready to merge.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5707486613 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12478#pullrequestreview-5707486613). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-30T02:42:34Z. **Review:** CHANGES_REQUESTED --- Thanks, the five points are all in: warm-up, atomic counter, description, base, and the window-close race. I read `Note`/`Skip` and the single-word state looks correct. What still blocks it: - **No benefit shown.** The description now says the current head has no measurable gain (B 0.523/0.495 fps vs A 0.527/0.651, 21% spread), and the +26% was on a head before the warm-up fix. The PR is titled `perf` and adds a new window, env var and counters. Please show one scene where the bypass starts under the "seen before counts as useful" rule and the gain is outside noise, with `tools/trace_digest.py` summaries of `main` and the change from the same machine and scene. You have the profiled boot pending; post it. Without a scene where it fires and helps, the change adds complexity for nothing, and the direction would be to drop it. - **Test cost.** On the NVIDIA run (14209e9), `agc_driver_draw_cache_cold_scene`, `_off`, `low_hit_bypass` and `_off` all hit the 120 s timeout in the parallel run and passed only on a 360 s retry. Please cut their draw counts or frames so each runs well under the default timeout with validation layers on. Everything else from the last review is met. Once a measured gain is posted this is ready to merge.
adriadam10 commented 2026-10-30 04:33:21 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-30T04:33:21Z.

Review: CHANGES_REQUESTED


Thanks for the test commit: drawing only the lookups the cases check and noting the rest of each window on the bypass should cut the draw counts well below the 120 s timeout (the NVIDIA rerun on 167947744a will show it). One point still blocks this:

  • No benefit shown. The description still says the current head has no measurable gain, and the profiled Resident Evil Village boot is still "Pending". The PR is titled perf and adds a window, an env var and counters. Please post one scene where the bypass starts under the "seen before counts as useful" rule and the gain is outside noise, with tools/trace_digest.py summaries of main and the change from the same machine and scene. If no scene fires and helps, the direction is to drop the change.

Also, @MarcZX10 asked for the VUID-vkCmdCopyBuffer-commonparent in agc_driver_depth_clear_hle on the NVIDIA report to be attributed (same-head repeat, or the test against main); please answer that too.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5708106785 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12478#pullrequestreview-5708106785). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-30T04:33:21Z. **Review:** CHANGES_REQUESTED --- Thanks for the test commit: drawing only the lookups the cases check and noting the rest of each window on the bypass should cut the draw counts well below the 120 s timeout (the NVIDIA rerun on 167947744a will show it). One point still blocks this: - **No benefit shown.** The description still says the current head has no measurable gain, and the profiled Resident Evil Village boot is still "Pending". The PR is titled `perf` and adds a window, an env var and counters. Please post one scene where the bypass starts under the "seen before counts as useful" rule and the gain is outside noise, with `tools/trace_digest.py` summaries of `main` and the change from the same machine and scene. If no scene fires and helps, the direction is to drop the change. Also, @MarcZX10 asked for the `VUID-vkCmdCopyBuffer-commonparent` in `agc_driver_depth_clear_hle` on the NVIDIA report to be attributed (same-head repeat, or the test against `main`); please answer that too.
MarcZX10 commented 2026-10-30 16:32:17 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-30T16:32:17Z.

Review: CHANGES_REQUESTED


Re-checked — new head, changes still needed

The atomic window-state fix addresses the earlier race, but the updated performance change still lacks a matched capture pair for the reviewed head against current main.

What I ran

Reviewed head 167947744aff84d8c890b9c4ef349bae799283a1. GitHub reports the PR base snapshot as 76fd1c09e9be0465d50a7431a79d371a5a10abb2; current upstream main is 8f756acf599027be651dadb392506dbbd4b785e9. The read-only merge preview onto current main was clean (23003b378c7cbbcc136f8388348fc38d7d25c8f4). Environment: Linux x86_64, Python 3.11.2, GCC 12.2.0. No build or test executable was run.

git diff --check 8f756acf599027be651dadb392506dbbd4b785e9...167947744aff84d8c890b9c4ef349bae799283a1
python3 tools/check_conventions.py --base 8f756acf599027be651dadb392506dbbd4b785e9 --head 167947744aff84d8c890b9c4ef349bae799283a1
python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 12478
git merge-tree --write-tree 8f756acf599027be651dadb392506dbbd4b785e9 167947744aff84d8c890b9c4ef349bae799283a1

Results

Check Result
Patch whitespace Passed
Conventions and PR template Passed against current main
Current-main merge preview Clean
Draw-cache window update The reviewed code now keeps window counts, low-window streak and bypass count in one compare-exchange state; this resolves the previously reported stale streak update. The new concurrency test exercises simultaneous window closures.
No-build precheck Stable head/base; conventions and mergeability passed. Its ABI and test-quality helper steps could not run in the isolated PR copy because those helper scripts are local-only; they are not relevant to this change's ABI.
Hosted checks Windows passed; Linux and specialized jobs were skipped in the last status snapshot. A separate NVIDIA report covers this head merged onto main f6fddd6, not current main 8f756acf.
Performance evidence The latest Crysis comment reports one PR-side profile. It has no matched main capture, summary-line pair, attached traces, or trace digests for this head. Existing Village captures in the description are from older code; the description says the pair for the warm-up-fixed branch was queued.
Local build/tests Not run
Unedited output from local checks
All conventions checks passed.
23003b378c7cbbcc136f8388348fc38d7d25c8f4

git diff --check exited 0 with no output.

The isolated precheck reported these helper errors:

/usr/bin/python3: can't open file '/tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-12478-167947744aff/head-167947744aff-d880e2d9/tools/pr_abi_audit.py': [Errno 2] No such file or directory
/usr/bin/python3: can't open file '/tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-12478-167947744aff/head-167947744aff-d880e2d9/tools/pr_test_quality.py': [Errno 2] No such file or directory

Findings

Blocking

  • The performance evidence does not measure the current change against current main. The latest Crysis profile is useful evidence that a low-hit workload exists, but it reports only the changed build. The older comparison predates the warm-up and atomic window-order fixes. Since this is a perf PR and the branch still describes the bypass as cutting wasted work, please capture current main and this exact head on the same machine, title, scene, and settings. Add both aps5-summary.jsonl lines, attach both traces, and include tools/trace_digest.py output for each trace.

Non-blocking

  • The reported NVIDIA and Windows checks are useful, but the NVIDIA run used a f6fddd6 integration rather than current main; the local merge preview establishes clean application, not test coverage of that integration.
  • The new concurrency test is a stress test rather than a demonstrated negative control: the PR description says it also passes on the parent of the atomic fix. I inspected the single-state compare-exchange source change, but the test did not demonstrate that it catches the old race.

Sources

Not verified

  • I did not build or run draw-cache tests, validation layers, console/title behavior, or performance captures locally.
  • I did not reproduce the author/community-reported Linux or NVIDIA results.

To get this to a good state

Add the matched current-main/current-head capture pair, both summary lines, traces and digest output. I will rerun the same source checks and review the new evidence against the resulting head.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5715420798 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12478#pullrequestreview-5715420798). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-30T16:32:17Z. **Review:** CHANGES_REQUESTED --- # Re-checked — new head, changes still needed The atomic window-state fix addresses the earlier race, but the updated performance change still lacks a matched capture pair for the reviewed head against current `main`. ## What I ran Reviewed head `167947744aff84d8c890b9c4ef349bae799283a1`. GitHub reports the PR base snapshot as `76fd1c09e9be0465d50a7431a79d371a5a10abb2`; current upstream `main` is `8f756acf599027be651dadb392506dbbd4b785e9`. The read-only merge preview onto current `main` was clean (`23003b378c7cbbcc136f8388348fc38d7d25c8f4`). Environment: Linux x86_64, Python 3.11.2, GCC 12.2.0. No build or test executable was run. ```sh git diff --check 8f756acf599027be651dadb392506dbbd4b785e9...167947744aff84d8c890b9c4ef349bae799283a1 python3 tools/check_conventions.py --base 8f756acf599027be651dadb392506dbbd4b785e9 --head 167947744aff84d8c890b9c4ef349bae799283a1 python3 tools/pr_precheck.py --repo boykopovar/AnyPS5 --pr 12478 git merge-tree --write-tree 8f756acf599027be651dadb392506dbbd4b785e9 167947744aff84d8c890b9c4ef349bae799283a1 ``` ## Results | Check | Result | |---|---| | Patch whitespace | Passed | | Conventions and PR template | Passed against current `main` | | Current-main merge preview | Clean | | Draw-cache window update | The reviewed code now keeps window counts, low-window streak and bypass count in one compare-exchange state; this resolves the previously reported stale streak update. The new concurrency test exercises simultaneous window closures. | | No-build precheck | Stable head/base; conventions and mergeability passed. Its ABI and test-quality helper steps could not run in the isolated PR copy because those helper scripts are local-only; they are not relevant to this change's ABI. | | Hosted checks | Windows passed; Linux and specialized jobs were skipped in the last status snapshot. A separate NVIDIA report covers this head merged onto `main` `f6fddd6`, not current `main` `8f756acf`. | | Performance evidence | The latest Crysis comment reports one PR-side profile. It has no matched `main` capture, summary-line pair, attached traces, or trace digests for this head. Existing Village captures in the description are from older code; the description says the pair for the warm-up-fixed branch was queued. | | Local build/tests | Not run | <details><summary>Unedited output from local checks</summary> ```text All conventions checks passed. 23003b378c7cbbcc136f8388348fc38d7d25c8f4 ``` `git diff --check` exited 0 with no output. The isolated precheck reported these helper errors: ```text /usr/bin/python3: can't open file '/tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-12478-167947744aff/head-167947744aff-d880e2d9/tools/pr_abi_audit.py': [Errno 2] No such file or directory /usr/bin/python3: can't open file '/tmp/anyps5-pr-precheck/boykopovar-AnyPS5-pr-12478-167947744aff/head-167947744aff-d880e2d9/tools/pr_test_quality.py': [Errno 2] No such file or directory ``` </details> ## Findings ### Blocking - **The performance evidence does not measure the current change against current `main`.** The latest Crysis profile is useful evidence that a low-hit workload exists, but it reports only the changed build. The older comparison predates the warm-up and atomic window-order fixes. Since this is a `perf` PR and the branch still describes the bypass as cutting wasted work, please capture current `main` and this exact head on the same machine, title, scene, and settings. Add both `aps5-summary.jsonl` lines, attach both traces, and include `tools/trace_digest.py` output for each trace. ### Non-blocking - The reported NVIDIA and Windows checks are useful, but the NVIDIA run used a `f6fddd6` integration rather than current `main`; the local merge preview establishes clean application, not test coverage of that integration. - The new concurrency test is a stress test rather than a demonstrated negative control: the PR description says it also passes on the parent of the atomic fix. I inspected the single-state compare-exchange source change, but the test did not demonstrate that it catches the old race. ## Sources - [Performance evidence requirement in `CONTRIBUTING.md` at current `main`](https://github.com/boykopovar/AnyPS5/blob/8f756acf599027be651dadb392506dbbd4b785e9/CONTRIBUTING.md#L71) - [Capture matching, summary lines, traces and digests in the performance form at current `main`](https://github.com/boykopovar/AnyPS5/blob/8f756acf599027be651dadb392506dbbd4b785e9/.github/ISSUE_TEMPLATE/performance.yml#L8-L50) - [Atomic draw-cache window update at the reviewed head](https://github.com/boykopovar/AnyPS5/blob/167947744aff84d8c890b9c4ef349bae799283a1/core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawCache.cpp#L39-L70) - [Single-side Crysis profile posted in the PR discussion](https://github.com/boykopovar/AnyPS5/pull/12478#issuecomment-6527767233) ## Not verified - I did not build or run draw-cache tests, validation layers, console/title behavior, or performance captures locally. - I did not reproduce the author/community-reported Linux or NVIDIA results. ## To get this to a good state Add the matched current-main/current-head capture pair, both summary lines, traces and digest output. I will rerun the same source checks and review the new evidence against the resulting head.
adriadam10 commented 2026-10-31 03:49:24 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-31T03:49:24Z.

Review: CHANGES_REQUESTED


The cold-scene test change is fine: 128 draws after one noted low window, and it is red when the warm-up is removed. The library code is the same as 167947744a, which I already read. One point still blocks this, unchanged from the last two reviews:

  • No benefit shown. The description says the current head has no measurable gain. In the Resident Evil Village boot the bypass starts in none of the 57 measured blocks, and in Planet of Lana in none, so the +13.3% pair isn't attributable to this change. The change adds a window, an env var and counters on the draw path, so it needs one scene where the bypass fires under the "seen before counts as useful" rule and the gain is outside noise. Please post a main / change pair from the same machine and scene with the aps5-summary.jsonl lines and tools/trace_digest.py output, plus the [draw-cache] bypassed lines showing it fired during the measured window. @ntamas94's Crysis Remastered profile (~2% hits, 110k of 113k lookups "no entry") or the Red Dead Redemption case from #5404 are candidates. If no scene fires and helps, the direction is to drop the change.

@MarcZX10's VUID-vkCmdCopyBuffer-commonparent question in agc_driver_depth_clear_hle is answered in your reply (not repeated on 167947744a's NVIDIA run); I'm not asking for more there.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5721026634 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12478#pullrequestreview-5721026634). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-31T03:49:24Z. **Review:** CHANGES_REQUESTED --- The cold-scene test change is fine: 128 draws after one noted low window, and it is red when the warm-up is removed. The library code is the same as 167947744a, which I already read. One point still blocks this, unchanged from the last two reviews: - **No benefit shown.** The description says the current head has no measurable gain. In the Resident Evil Village boot the bypass starts in none of the 57 measured blocks, and in Planet of Lana in none, so the +13.3% pair isn't attributable to this change. The change adds a window, an env var and counters on the draw path, so it needs one scene where the bypass fires under the "seen before counts as useful" rule and the gain is outside noise. Please post a `main` / change pair from the same machine and scene with the `aps5-summary.jsonl` lines and `tools/trace_digest.py` output, plus the `[draw-cache] bypassed` lines showing it fired during the measured window. @ntamas94's Crysis Remastered profile (~2% hits, 110k of 113k lookups "no entry") or the Red Dead Redemption case from #5404 are candidates. If no scene fires and helps, the direction is to drop the change. @MarcZX10's `VUID-vkCmdCopyBuffer-commonparent` question in `agc_driver_depth_clear_hle` is answered in your reply (not repeated on 167947744a's NVIDIA run); I'm not asking for more there.
adriadam10 commented 2026-10-31 22:16:24 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-31T22:16:24Z.

Review: CHANGES_REQUESTED


The head only merges main into eaafdf934b; the range-diff of the 8 commits is empty, so the previous review stands. One point still blocks this:

  • No benefit shown. The bypass starts in none of the 57 measured blocks in Resident Evil Village and none in Planet of Lana, so the +13.3% pair isn't attributable to this change. It adds a window, an env var and counters on the draw path, so it needs one scene where the bypass fires under the "seen before counts as useful" rule and the gain is outside noise. Please post a main / change pair from the same machine and scene with the aps5-summary.jsonl lines and tools/trace_digest.py output, plus the [draw-cache] bypassed lines showing it fired in the measured window. Crysis Remastered or the Red Dead Redemption case from #5404 are candidates. If no scene fires and helps, the direction is to drop the change.
<!-- greyfinch-sync:boykopovar/AnyPS5:review:5725219211 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/12478#pullrequestreview-5725219211). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-31T22:16:24Z. **Review:** CHANGES_REQUESTED --- The head only merges main into eaafdf934b; the range-diff of the 8 commits is empty, so the previous review stands. One point still blocks this: - **No benefit shown.** The bypass starts in none of the 57 measured blocks in Resident Evil Village and none in Planet of Lana, so the +13.3% pair isn't attributable to this change. It adds a window, an env var and counters on the draw path, so it needs one scene where the bypass fires under the "seen before counts as useful" rule and the gain is outside noise. Please post a `main` / change pair from the same machine and scene with the `aps5-summary.jsonl` lines and `tools/trace_digest.py` output, plus the `[draw-cache] bypassed` lines showing it fired in the measured window. Crysis Remastered or the Red Dead Redemption case from #5404 are candidates. If no scene fires and helps, the direction is to drop the change.

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