perf(agc): accept a refreshed view in the T1 re-run when the lookup would not view the pending alias #11740

Merged
thuanquang merged 2 commits from upstream-pr/11740 into main 2026-10-30 01:01:54 +00:00
thuanquang commented 2026-10-27 06:29:28 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by thuanquang on 2026-10-27T06:29:28Z.


What

When ShaderResources::Revalidate's fast proof finds an image pending over a sampled surface, T1 (refreshOwnObjects) brings the view's own storage image up to date the way the full walk's lookup would, and the fast proof runs again. That re-run accepts the refreshed view only while ScanPending's raw found is the view's source or nothing. A pending alias of the surface (same base, size and shape, another format: StorageTexture::pendingAlias) breaks that rule. found is the alias, but cachedTexture would not view it (its copy filters drop it), and the refreshed own image has just borrowed the alias's units. So the re-run always fails, and the full walk then returns the same view.

In Persona 5 Royal's first gameplay area this happens on every draw over such surfaces: about 24,000-25,000 full walks per 10 s with "T1 fallback: re-run failed" (APS5_PROFILE_DRAW), on the draw committer, one of the three stages (with the queue worker and the GPU) that bound the frame there.

This change makes T1 and its re-run ask the lookup's own question:

  • cachedTexture's pending-source decision (FindPending, the block, repack, depth-copy and sRGB-expand filters, MetadataMoved) moves into one helper, pendingLookupSource. cachedTexture calls it with no change in behaviour.
  • T1's refreshView uses the helper instead of FindPending plus CanCopyFrom alone, with the element's depth-compare flag taken the way the full walk takes it (sampled bindings and image tables). It records that flag and whether it refreshed the source in PendingOverlap.
  • The re-run also accepts a refreshed view without DCC metadata when the helper says the lookup would view the view's own source, or no pending image while the surface's key maps to that source and T1 refreshed it. Storage elements and DCC-addressed views keep today's rule.

APS5_VERIFY_PROOFS=1 already runs the full walk beside every accepted T1 proof and aborts on another object or an upload. The new test runs under it.

Tested

Windows 11 26200, Ryzen 5 5600X, AMD Radeon RX 6700 XT (gfx1031), AMD Windows driver 32.0.21045.16010, WinLibs GCC 15.2.0 r7, Release. Head 9978af5ec7 on main efc24518bc.

  • New execution test agc_driver_own_refresh_repack_alias (runs with APS5_VERIFY_PROOFS=1; skips when the device does not import guest memory). It builds a reusable set over a surface whose view is its own storage image, then stores an 8888 UNorm alias over it twice:
    • a 10_11_11 float view (the alias is neither copied nor repack-copied, so this covers the re-run rule);
    • an R32F view sampled with a depth comparison (on main T1 takes the alias as a foreign view, so this covers T1's filter).
    • Where write tracking covers the surface (GuestMemory::Watched), each Revalidate must take ProofPath::OwnRefreshed. Where it doesn't (host imports compared instead of watched, as on the Linux lavapipe runner), the fast proof stops at the write collection on main as with this change, so the set must only be proved current and keep its view.
    • Windows (RX 6700 XT): both surfaces are write-watched. With main's ShaderResources.cpp/.hpp the test fails 3 of 3 at its first case (a set whose view refreshed its own image over a pending 8888 unorm alias took the full walk, not the own-object refresh), and its R32F case run alone fails 3 of 3 the same way. With this change it passes 3 of 3.
    • Linux, WSL2 Ubuntu 24.04.3 (kernel 5.15.167.4), Mesa 25.2.8 lavapipe, g++ 13.3, Release: passes 3 of 3. This WSL kernel has no write watch, so all guest memory is compared there and only the compared branch runs.
  • Full agc|shader suite on this head (1,165 tests, --parallel 4): 1,155 pass, 9 skip, 1 fails: agc_driver_sample_order_grid_reference (vkQueueSubmit recorder: Vulkan result -4), which fails the same way on main efc24518bc here.
  • Khronos validation layer (VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation, VK_LOADER_DEBUG=layer, ANYPS5_NO_SHADER_CACHE=1, ANYPS5_REQUIRE_VULKAN=1, ctest -V) on the new test and lookup_log_fits_build, cached_image_multisample_guard, sampled_cache_budget (3 entries), storage_one_slice_alias, bc_block_copy and depth_compare_copy: 9 of 9 pass on this head and the 8 existing ones pass on main efc24518bc. The loader inserted the layer in every test on both sides, no log has was not found but was requested, and there is no VUID- line on either side.

PPSA05110 (own dump), first gameplay area, measured on the earlier head c005abb24f (the same production change, on main 88795ed448), standing still after the fixed input route (New Game, opening movie skipped); warm shader and pipeline caches. P5R needs two other changes to reach this scene with a usable frame rate: #10913 (merged since) and #7844 (open; host import budget). So the pair is:

Counters (separate shared runs with APS5_PROFILE_DRAW, 10 s intervals in gameplay):

base candidate
full walks per 10 s 25,800-26,600 3,200-3,300
of which "pending image" with T1 fallback: re-run failed 24,000-25,000 0
T1 refreshes accepted per 10 s about 22,000
Revalidate time per 10 s 2.02-2.15 s 1.47-1.86 s

An earlier version of this change (same logic, before the review cleanups and the second test case) ran the scene for 660 s with APS5_VERIFY_PROOFS=1, which runs the full walk beside every accepted proof: no abort.

Timing, rerun on 2026-10-28 as the Performance report form asks: among the trace and profile switches only APS5_TRACE_SECONDS=560:4, with the default event buffer (the queue worker records about 51,000 slices per second in this scene, so 4 s fit the default 262,144; neither trace dropped events). APS5_TRACE_DIR names the output folder. The other variables belong to our input driver: APS5_NO_PAD_INPUT and APS5_PAD_INPUT_FILE feed the fixed pad route, and APS5_DUMP_FRAMES=1060 with APS5_DUMP_FRAMES_EVERY=20 let it see the screen. In both runs a few dumps (one per 20 frames) still fell inside the window, so both carry the same small read-back cost. The log went to a file through our launcher, as in all our runs. Exclusive GPU and build locks, warm caches, same machine and session, candidate then base back to back (03:26-03:48 local); the HUD was reached at 219 s and 324 s after New Game, and the route never entered the Load screen. A CPU monitor ran beside each run: no game was running; other processes used 12-27 % of the CPU around the windows (background services, VMware host, Steam, the WSL VM of our tools), similar in both.

run build commit presents in the 4 s window frame p50 / p90 / p99 GPU ms per present queue worker busy / committer busy, ms per frame
1 candidate 1835554de245 58 66.1 / 89.6 / 140.9 ms 44.8 51.1 / 44.6
2 base 6b5543b03d12 60 64.4 / 80.7 / 102.7 ms 44.5 47.6 / 43.6
aps5-summary.jsonl, trace window of each run
{"commit":"6b5543b03d12","dirty":false,"env":{"APS5_DUMP_FRAMES":"1060","APS5_DUMP_FRAMES_EVERY":"20","APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"560:4"},"gpu":"AMD Radeon RX 6700 XT","driver":"AMD proprietary driver 26.10.1 (AMD proprietary shader compiler)","os":"Windows 10.0.26200","cpu":"AMD Ryzen 5 5600X 6-Core Processor","cpu_threads":12,"memory_mib":32690,"title_id":"PPSA05110","title":"Persona 5 Royal","content_version":"01.000.000","resolution":"3840x2160","window":{"spec":"seconds 560:4","first_present":20596,"ms":4005.837},"presents":60,"frame_ms":{"p50":64.429,"p90":80.715,"p99":102.716,"max":102.716},"gpu_busy_ms_per_present":44.456,"worker_busy_pct":{"queue worker 0x0":97.213},"top_phases_ms_per_frame":{"Driver.Packet":64.859,"Driver.Packet.draw":54.350,"Driver.Draw":53.747,"Graphics.Draw":53.327,"Graphics.Draw.draw_and_resource_release":46.025,"Driver.Draw.shader_compile_and_link":31.062,"Shader.DrawStage":24.810,"VideoOut.Flip":19.767},"trace_dropped":false,"trace":"aps5-trace-6b5543b03d12-17712.json.gz"}
{"commit":"1835554de245","dirty":false,"env":{"APS5_DUMP_FRAMES":"1060","APS5_DUMP_FRAMES_EVERY":"20","APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"560:4"},"gpu":"AMD Radeon RX 6700 XT","driver":"AMD proprietary driver 26.10.1 (AMD proprietary shader compiler)","os":"Windows 10.0.26200","cpu":"AMD Ryzen 5 5600X 6-Core Processor","cpu_threads":12,"memory_mib":32690,"title_id":"PPSA05110","title":"Persona 5 Royal","content_version":"01.000.000","resolution":"3840x2160","window":{"spec":"seconds 560:4","first_present":18249,"ms":4051.672},"presents":58,"frame_ms":{"p50":66.119,"p90":89.551,"p99":140.888,"max":140.888},"gpu_busy_ms_per_present":44.843,"worker_busy_pct":{"queue worker 0x0":97.352},"top_phases_ms_per_frame":{"Driver.Packet":67.965,"Driver.Packet.draw":58.446,"Driver.Draw":57.887,"Graphics.Draw":54.680,"Graphics.Draw.draw_and_resource_release":47.705,"Driver.Draw.shader_compile_and_link":30.456,"Shader.DrawStage":24.504,"Driver.Draw.draw_enqueued":20.229},"trace_dropped":false,"trace":"aps5-trace-1835554de245-1080.json.gz"}

Traces and tools/trace_digest.py output: evidence/t1-rerun-p5r-traces-2 on our fork. I listed every key and string value in both traces: 95 distinct strings, all emulator scope, thread or trace-format names; no paths, title text or memory contents.

Earlier pair, supplemental only (it also set APS5_TRACE_EVENTS and APS5_TRACE_SUMMARY_EVERY, which the form excludes)

Earlier pair, kept as supplemental data only: it also set APS5_TRACE_EVENTS=1048576 and APS5_TRACE_SUMMARY_EVERY=10, which the form excludes. Timing of that pair: exclusive GPU and build locks, no other GPU user (sampled during each run), only APS5_TRACE_SUMMARY_EVERY=10 and APS5_TRACE_SECONDS=480:10 (plus a frame dump every 20th frame in every run, used to find the gameplay windows by the HUD). Base, then candidate, back to back (02:09-02:30 local), 600 s each.

run build commit gameplay windows presents per 10 s, median (min-max) frame p50 / p99, window medians GPU ms per present trace window 480-490 s: presents, frame p50 / p99 committer busy / Graphics.Draw, ms per frame queue worker busy, ms per frame
1 base 6b5543b03d12 22 159.7 (136.6-170.3) 63.1 / 82.9 ms 41.7 160, 63.5 / 80.3 ms 40.0 / 38.1 43.0
2 candidate 1835554de245 23 162.7 (138.7-166.2) 60.8 / 83.1 ms 41.1 164, 59.3 / 81.3 ms 38.8 / 36.9 41.5

"Gameplay windows" are the 10 s summary intervals whose frame dumps show the gameplay HUD. The last four columns come from tools/trace_digest.py on each trace.

Summary lines of the trace windows:

aps5-summary.jsonl, trace window of each run
{"commit":"6b5543b03d12","dirty":false,"env":{"APS5_DUMP_FRAMES":"2000","APS5_DUMP_FRAMES_EVERY":"20","APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_EVENTS":"1048576","APS5_TRACE_SECONDS":"480:10","APS5_TRACE_SUMMARY_EVERY":"10"},"gpu":"AMD Radeon RX 6700 XT","driver":"AMD proprietary driver 26.10.1 (AMD proprietary shader compiler)","os":"Windows 10.0.26200","cpu":"AMD Ryzen 5 5600X 6-Core Processor","cpu_threads":12,"memory_mib":32690,"title_id":"PPSA05110","title":"Persona 5 Royal","content_version":"01.000.000","resolution":"3840x2160","window":{"spec":"seconds 480:10","first_present":20458,"ms":10040.213},"presents":160,"frame_ms":{"p50":63.466,"p90":74.485,"p99":80.319,"max":145.572},"gpu_busy_ms_per_present":42.186,"worker_busy_pct":{"queue worker 0x0":97.334},"top_phases_ms_per_frame":{"Driver.Packet":61.038,"Driver.Packet.draw":52.356,"Driver.Draw":51.887,"Graphics.Draw":51.880,"Graphics.Draw.draw_and_resource_release":45.832,"Driver.Draw.shader_compile_and_link":26.035,"Shader.DrawStage":20.936,"Driver.Draw.draw_enqueued":19.583},"trace_dropped":false,"trace":"aps5-trace-6b5543b03d12-23260.json.gz"}
{"commit":"1835554de245","dirty":false,"env":{"APS5_DUMP_FRAMES":"2000","APS5_DUMP_FRAMES_EVERY":"20","APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_EVENTS":"1048576","APS5_TRACE_SECONDS":"480:10","APS5_TRACE_SUMMARY_EVERY":"10"},"gpu":"AMD Radeon RX 6700 XT","driver":"AMD proprietary driver 26.10.1 (AMD proprietary shader compiler)","os":"Windows 10.0.26200","cpu":"AMD Ryzen 5 5600X 6-Core Processor","cpu_threads":12,"memory_mib":32690,"title_id":"PPSA05110","title":"Persona 5 Royal","content_version":"01.000.000","resolution":"3840x2160","window":{"spec":"seconds 480:10","first_present":20124,"ms":10012.659},"presents":164,"frame_ms":{"p50":59.254,"p90":72.606,"p99":81.267,"max":140.040},"gpu_busy_ms_per_present":40.998,"worker_busy_pct":{"queue worker 0x0":97.317},"top_phases_ms_per_frame":{"Driver.Packet":59.371,"Driver.Packet.draw":50.991,"Graphics.Draw":50.537,"Driver.Draw":50.521,"Graphics.Draw.draw_and_resource_release":44.466,"Driver.Draw.shader_compile_and_link":25.546,"Shader.DrawStage":20.598,"Driver.Draw.draw_enqueued":18.802},"trace_dropped":false,"trace":"aps5-trace-1835554de245-6752.json.gz"}

Traces: evidence/t1-rerun-p5r-traces on our fork (aps5-trace-6b5543b03d12-23260.json.gz, aps5-trace-1835554de245-6752.json.gz). They hold only the emulator's scope and thread names, timestamps, durations, host process and thread IDs and the batch/present/ms counters; I listed every key and string value in both (98 distinct strings, all emulator scope, thread or trace-format names; no paths, title text or memory contents). No trace dropped events.

What this shows: the change removes about 88 % of the full walks on the draw committer (24,000-25,000 per 10 s that the re-run refused), and Revalidate time drops from 2.02-2.15 to 1.47-1.86 s per 10 s (counter runs above). At the frame level I cannot resolve a difference in this scene: in the pair that follows the form, frame time and committer busy time are the same within the noise of 4 s windows (58 vs 60 presents; committer 44.6 vs 43.6 ms per frame), and the supplemental pair showed a 1.2 ms per frame lower committer busy time with presents 159.7 vs 162.7 per 10 s. In this scene the queue worker (47-51 ms per frame) and the GPU (about 45 ms per present) bound the frame as much as the committer, so a committer saving of this size does not show in frame time.

Second vendor, from @Oscar45397 (comment): NVIDIA GeForce RTX 3080, driver 610.88, Windows 11 26200, the same nine validation-layer tests on the earlier head c005abb24f and the eight on main 88795ed448, two runs per side: all pass, the layer inserted in every test, no VUID- or SYNC-HAZARD- IDs, and agc_driver_own_refresh_repack_alias ran (not skipped).

Not tested: native Linux, including the linux job's setup (write-watched guest memory with compared imports; WSL2 has no write watch, so the Build is its first run), macOS, GPUs other than these; titles other than PPSA05110; no speed comparison on the RTX 3080.

Checklist

  • Based on current main; no other open PR implements the same functions
  • One topic per PR; follow-ups go in a new PR
  • No comments in code except technical debt
  • Unimplemented paths throw (NotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file
  • No notes, investigation .md files or images added to the repository (attach them to this PR)
  • New third-party code is a submodule built from source
  • Generic behaviour, not specific to one title
  • Depends on: none
  • Fixes: none
  • Unblocks: PPSA05110 #10872 (draw-committer time in the first gameplay area; the title does not stop there)
  • GPUs tested: AMD Radeon RX 6700 XT (gfx1031), AMD Windows driver 32.0.21045.16010, Windows 11 26200; Mesa 25.2.8 lavapipe, WSL2 Ubuntu 24.04.3, kernel 5.15.167.4 (compared branch only); NVIDIA GeForce RTX 3080, driver 610.88 (validation tests on the earlier head c005abb24f, by @Oscar45397)
  • AI-assisted: yes (Claude Code)

🤖 Generated with Claude Code

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5029640740 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11740). Originally posted by [thuanquang](https://github.com/thuanquang) on 2026-10-27T06:29:28Z. --- ### What When `ShaderResources::Revalidate`'s fast proof finds an image pending over a sampled surface, T1 (`refreshOwnObjects`) brings the view's own storage image up to date the way the full walk's lookup would, and the fast proof runs again. That re-run accepts the refreshed view only while `ScanPending`'s raw `found` is the view's source or nothing. A pending alias of the surface (same base, size and shape, another format: `StorageTexture::pendingAlias`) breaks that rule. `found` is the alias, but `cachedTexture` would not view it (its copy filters drop it), and the refreshed own image has just borrowed the alias's units. So the re-run always fails, and the full walk then returns the same view. In Persona 5 Royal's first gameplay area this happens on every draw over such surfaces: about 24,000-25,000 full walks per 10 s with "T1 fallback: re-run failed" (`APS5_PROFILE_DRAW`), on the draw committer, one of the three stages (with the queue worker and the GPU) that bound the frame there. This change makes T1 and its re-run ask the lookup's own question: - `cachedTexture`'s pending-source decision (`FindPending`, the block, repack, depth-copy and sRGB-expand filters, `MetadataMoved`) moves into one helper, `pendingLookupSource`. `cachedTexture` calls it with no change in behaviour. - T1's `refreshView` uses the helper instead of `FindPending` plus `CanCopyFrom` alone, with the element's depth-compare flag taken the way the full walk takes it (sampled bindings and image tables). It records that flag and whether it refreshed the source in `PendingOverlap`. - The re-run also accepts a refreshed view without DCC metadata when the helper says the lookup would view the view's own source, or no pending image while the surface's key maps to that source and T1 refreshed it. Storage elements and DCC-addressed views keep today's rule. `APS5_VERIFY_PROOFS=1` already runs the full walk beside every accepted T1 proof and aborts on another object or an upload. The new test runs under it. ### Tested Windows 11 26200, Ryzen 5 5600X, AMD Radeon RX 6700 XT (gfx1031), AMD Windows driver 32.0.21045.16010, WinLibs GCC 15.2.0 r7, Release. Head `9978af5ec7` on `main` `efc24518bc`. - New execution test `agc_driver_own_refresh_repack_alias` (runs with `APS5_VERIFY_PROOFS=1`; skips when the device does not import guest memory). It builds a reusable set over a surface whose view is its own storage image, then stores an 8888 UNorm alias over it twice: - a 10_11_11 float view (the alias is neither copied nor repack-copied, so this covers the re-run rule); - an R32F view sampled with a depth comparison (on `main` T1 takes the alias as a foreign view, so this covers T1's filter). - Where write tracking covers the surface (`GuestMemory::Watched`), each `Revalidate` must take `ProofPath::OwnRefreshed`. Where it doesn't (host imports compared instead of watched, as on the Linux lavapipe runner), the fast proof stops at the write collection on `main` as with this change, so the set must only be proved current and keep its view. - Windows (RX 6700 XT): both surfaces are write-watched. With `main`'s `ShaderResources.cpp/.hpp` the test fails 3 of 3 at its first case (`a set whose view refreshed its own image over a pending 8888 unorm alias took the full walk, not the own-object refresh`), and its R32F case run alone fails 3 of 3 the same way. With this change it passes 3 of 3. - Linux, WSL2 Ubuntu 24.04.3 (kernel 5.15.167.4), Mesa 25.2.8 lavapipe, g++ 13.3, Release: passes 3 of 3. This WSL kernel has no write watch, so all guest memory is compared there and only the compared branch runs. - Full `agc|shader` suite on this head (1,165 tests, `--parallel 4`): 1,155 pass, 9 skip, 1 fails: `agc_driver_sample_order_grid_reference` (`vkQueueSubmit recorder: Vulkan result -4`), which fails the same way on `main` `efc24518bc` here. - Khronos validation layer (`VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation`, `VK_LOADER_DEBUG=layer`, `ANYPS5_NO_SHADER_CACHE=1`, `ANYPS5_REQUIRE_VULKAN=1`, `ctest -V`) on the new test and `lookup_log_fits_build`, `cached_image_multisample_guard`, `sampled_cache_budget` (3 entries), `storage_one_slice_alias`, `bc_block_copy` and `depth_compare_copy`: 9 of 9 pass on this head and the 8 existing ones pass on `main` `efc24518bc`. The loader inserted the layer in every test on both sides, no log has `was not found but was requested`, and there is no `VUID-` line on either side. **PPSA05110 (own dump), first gameplay area, measured on the earlier head `c005abb24f` (the same production change, on `main` `88795ed448`), standing still after the fixed input route (New Game, opening movie skipped); warm shader and pipeline caches.** P5R needs two other changes to reach this scene with a usable frame rate: #10913 (merged since) and #7844 (open; host import budget). So the pair is: - base `6b5543b03d12` = `main` `88795ed448` + #10913 + #7844 (fork branch [`evidence/t1-rerun-p5r-base`](https://github.com/thuanquang/AnyPS5/tree/evidence/t1-rerun-p5r-base)); - candidate `1835554de245` = base + exactly the earlier head's diff (`git diff 6b5543b03d 1835554de2` is identical to `git diff 88795ed448 c005abb24f`; this head has the same production lines, only the test changed; [`evidence/t1-rerun-p5r-candidate`](https://github.com/thuanquang/AnyPS5/tree/evidence/t1-rerun-p5r-candidate)). Counters (separate shared runs with `APS5_PROFILE_DRAW`, 10 s intervals in gameplay): | | base | candidate | |---|---|---| | full walks per 10 s | 25,800-26,600 | 3,200-3,300 | | of which "pending image" with `T1 fallback: re-run failed` | 24,000-25,000 | 0 | | T1 refreshes accepted per 10 s | | about 22,000 | | `Revalidate` time per 10 s | 2.02-2.15 s | 1.47-1.86 s | An earlier version of this change (same logic, before the review cleanups and the second test case) ran the scene for 660 s with `APS5_VERIFY_PROOFS=1`, which runs the full walk beside every accepted proof: no abort. Timing, rerun on 2026-10-28 as the Performance report form asks: among the trace and profile switches only `APS5_TRACE_SECONDS=560:4`, with the default event buffer (the queue worker records about 51,000 slices per second in this scene, so 4 s fit the default 262,144; neither trace dropped events). `APS5_TRACE_DIR` names the output folder. The other variables belong to our input driver: `APS5_NO_PAD_INPUT` and `APS5_PAD_INPUT_FILE` feed the fixed pad route, and `APS5_DUMP_FRAMES=1060` with `APS5_DUMP_FRAMES_EVERY=20` let it see the screen. In both runs a few dumps (one per 20 frames) still fell inside the window, so both carry the same small read-back cost. The log went to a file through our launcher, as in all our runs. Exclusive GPU and build locks, warm caches, same machine and session, candidate then base back to back (03:26-03:48 local); the HUD was reached at 219 s and 324 s after New Game, and the route never entered the Load screen. A CPU monitor ran beside each run: no game was running; other processes used 12-27 % of the CPU around the windows (background services, VMware host, Steam, the WSL VM of our tools), similar in both. | run | build | commit | presents in the 4 s window | frame p50 / p90 / p99 | GPU ms per present | queue worker busy / committer busy, ms per frame | |---|---|---|---|---|---|---| | 1 | candidate | `1835554de245` | 58 | 66.1 / 89.6 / 140.9 ms | 44.8 | 51.1 / 44.6 | | 2 | base | `6b5543b03d12` | 60 | 64.4 / 80.7 / 102.7 ms | 44.5 | 47.6 / 43.6 | <details><summary>aps5-summary.jsonl, trace window of each run</summary> ```json {"commit":"6b5543b03d12","dirty":false,"env":{"APS5_DUMP_FRAMES":"1060","APS5_DUMP_FRAMES_EVERY":"20","APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"560:4"},"gpu":"AMD Radeon RX 6700 XT","driver":"AMD proprietary driver 26.10.1 (AMD proprietary shader compiler)","os":"Windows 10.0.26200","cpu":"AMD Ryzen 5 5600X 6-Core Processor","cpu_threads":12,"memory_mib":32690,"title_id":"PPSA05110","title":"Persona 5 Royal","content_version":"01.000.000","resolution":"3840x2160","window":{"spec":"seconds 560:4","first_present":20596,"ms":4005.837},"presents":60,"frame_ms":{"p50":64.429,"p90":80.715,"p99":102.716,"max":102.716},"gpu_busy_ms_per_present":44.456,"worker_busy_pct":{"queue worker 0x0":97.213},"top_phases_ms_per_frame":{"Driver.Packet":64.859,"Driver.Packet.draw":54.350,"Driver.Draw":53.747,"Graphics.Draw":53.327,"Graphics.Draw.draw_and_resource_release":46.025,"Driver.Draw.shader_compile_and_link":31.062,"Shader.DrawStage":24.810,"VideoOut.Flip":19.767},"trace_dropped":false,"trace":"aps5-trace-6b5543b03d12-17712.json.gz"} {"commit":"1835554de245","dirty":false,"env":{"APS5_DUMP_FRAMES":"1060","APS5_DUMP_FRAMES_EVERY":"20","APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_SECONDS":"560:4"},"gpu":"AMD Radeon RX 6700 XT","driver":"AMD proprietary driver 26.10.1 (AMD proprietary shader compiler)","os":"Windows 10.0.26200","cpu":"AMD Ryzen 5 5600X 6-Core Processor","cpu_threads":12,"memory_mib":32690,"title_id":"PPSA05110","title":"Persona 5 Royal","content_version":"01.000.000","resolution":"3840x2160","window":{"spec":"seconds 560:4","first_present":18249,"ms":4051.672},"presents":58,"frame_ms":{"p50":66.119,"p90":89.551,"p99":140.888,"max":140.888},"gpu_busy_ms_per_present":44.843,"worker_busy_pct":{"queue worker 0x0":97.352},"top_phases_ms_per_frame":{"Driver.Packet":67.965,"Driver.Packet.draw":58.446,"Driver.Draw":57.887,"Graphics.Draw":54.680,"Graphics.Draw.draw_and_resource_release":47.705,"Driver.Draw.shader_compile_and_link":30.456,"Shader.DrawStage":24.504,"Driver.Draw.draw_enqueued":20.229},"trace_dropped":false,"trace":"aps5-trace-1835554de245-1080.json.gz"} ``` </details> Traces and `tools/trace_digest.py` output: [`evidence/t1-rerun-p5r-traces-2`](https://github.com/thuanquang/AnyPS5/tree/evidence/t1-rerun-p5r-traces-2) on our fork. I listed every key and string value in both traces: 95 distinct strings, all emulator scope, thread or trace-format names; no paths, title text or memory contents. <details><summary>Earlier pair, supplemental only (it also set APS5_TRACE_EVENTS and APS5_TRACE_SUMMARY_EVERY, which the form excludes)</summary> Earlier pair, kept as supplemental data only: it also set `APS5_TRACE_EVENTS=1048576` and `APS5_TRACE_SUMMARY_EVERY=10`, which the form excludes. Timing of that pair: exclusive GPU and build locks, no other GPU user (sampled during each run), only `APS5_TRACE_SUMMARY_EVERY=10` and `APS5_TRACE_SECONDS=480:10` (plus a frame dump every 20th frame in every run, used to find the gameplay windows by the HUD). Base, then candidate, back to back (02:09-02:30 local), 600 s each. | run | build | commit | gameplay windows | presents per 10 s, median (min-max) | frame p50 / p99, window medians | GPU ms per present | trace window 480-490 s: presents, frame p50 / p99 | committer busy / `Graphics.Draw`, ms per frame | queue worker busy, ms per frame | |---|---|---|---|---|---|---|---|---|---| | 1 | base | `6b5543b03d12` | 22 | 159.7 (136.6-170.3) | 63.1 / 82.9 ms | 41.7 | 160, 63.5 / 80.3 ms | 40.0 / 38.1 | 43.0 | | 2 | candidate | `1835554de245` | 23 | 162.7 (138.7-166.2) | 60.8 / 83.1 ms | 41.1 | 164, 59.3 / 81.3 ms | 38.8 / 36.9 | 41.5 | "Gameplay windows" are the 10 s summary intervals whose frame dumps show the gameplay HUD. The last four columns come from `tools/trace_digest.py` on each trace. Summary lines of the trace windows: <details><summary>aps5-summary.jsonl, trace window of each run</summary> ```json {"commit":"6b5543b03d12","dirty":false,"env":{"APS5_DUMP_FRAMES":"2000","APS5_DUMP_FRAMES_EVERY":"20","APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_EVENTS":"1048576","APS5_TRACE_SECONDS":"480:10","APS5_TRACE_SUMMARY_EVERY":"10"},"gpu":"AMD Radeon RX 6700 XT","driver":"AMD proprietary driver 26.10.1 (AMD proprietary shader compiler)","os":"Windows 10.0.26200","cpu":"AMD Ryzen 5 5600X 6-Core Processor","cpu_threads":12,"memory_mib":32690,"title_id":"PPSA05110","title":"Persona 5 Royal","content_version":"01.000.000","resolution":"3840x2160","window":{"spec":"seconds 480:10","first_present":20458,"ms":10040.213},"presents":160,"frame_ms":{"p50":63.466,"p90":74.485,"p99":80.319,"max":145.572},"gpu_busy_ms_per_present":42.186,"worker_busy_pct":{"queue worker 0x0":97.334},"top_phases_ms_per_frame":{"Driver.Packet":61.038,"Driver.Packet.draw":52.356,"Driver.Draw":51.887,"Graphics.Draw":51.880,"Graphics.Draw.draw_and_resource_release":45.832,"Driver.Draw.shader_compile_and_link":26.035,"Shader.DrawStage":20.936,"Driver.Draw.draw_enqueued":19.583},"trace_dropped":false,"trace":"aps5-trace-6b5543b03d12-23260.json.gz"} {"commit":"1835554de245","dirty":false,"env":{"APS5_DUMP_FRAMES":"2000","APS5_DUMP_FRAMES_EVERY":"20","APS5_NO_PAD_INPUT":"1","APS5_PAD_INPUT_FILE":"<path>","APS5_TRACE_DIR":"<path>","APS5_TRACE_EVENTS":"1048576","APS5_TRACE_SECONDS":"480:10","APS5_TRACE_SUMMARY_EVERY":"10"},"gpu":"AMD Radeon RX 6700 XT","driver":"AMD proprietary driver 26.10.1 (AMD proprietary shader compiler)","os":"Windows 10.0.26200","cpu":"AMD Ryzen 5 5600X 6-Core Processor","cpu_threads":12,"memory_mib":32690,"title_id":"PPSA05110","title":"Persona 5 Royal","content_version":"01.000.000","resolution":"3840x2160","window":{"spec":"seconds 480:10","first_present":20124,"ms":10012.659},"presents":164,"frame_ms":{"p50":59.254,"p90":72.606,"p99":81.267,"max":140.040},"gpu_busy_ms_per_present":40.998,"worker_busy_pct":{"queue worker 0x0":97.317},"top_phases_ms_per_frame":{"Driver.Packet":59.371,"Driver.Packet.draw":50.991,"Graphics.Draw":50.537,"Driver.Draw":50.521,"Graphics.Draw.draw_and_resource_release":44.466,"Driver.Draw.shader_compile_and_link":25.546,"Shader.DrawStage":20.598,"Driver.Draw.draw_enqueued":18.802},"trace_dropped":false,"trace":"aps5-trace-1835554de245-6752.json.gz"} ``` </details> Traces: [`evidence/t1-rerun-p5r-traces`](https://github.com/thuanquang/AnyPS5/tree/evidence/t1-rerun-p5r-traces) on our fork (`aps5-trace-6b5543b03d12-23260.json.gz`, `aps5-trace-1835554de245-6752.json.gz`). They hold only the emulator's scope and thread names, timestamps, durations, host process and thread IDs and the `batch`/`present`/`ms` counters; I listed every key and string value in both (98 distinct strings, all emulator scope, thread or trace-format names; no paths, title text or memory contents). No trace dropped events. </details> What this shows: the change removes about 88 % of the full walks on the draw committer (24,000-25,000 per 10 s that the re-run refused), and `Revalidate` time drops from 2.02-2.15 to 1.47-1.86 s per 10 s (counter runs above). At the frame level I cannot resolve a difference in this scene: in the pair that follows the form, frame time and committer busy time are the same within the noise of 4 s windows (58 vs 60 presents; committer 44.6 vs 43.6 ms per frame), and the supplemental pair showed a 1.2 ms per frame lower committer busy time with presents 159.7 vs 162.7 per 10 s. In this scene the queue worker (47-51 ms per frame) and the GPU (about 45 ms per present) bound the frame as much as the committer, so a committer saving of this size does not show in frame time. Second vendor, from @Oscar45397 ([comment](https://github.com/boykopovar/AnyPS5/pull/11740#issuecomment-6456259932)): NVIDIA GeForce RTX 3080, driver 610.88, Windows 11 26200, the same nine validation-layer tests on the earlier head `c005abb24f` and the eight on `main` `88795ed448`, two runs per side: all pass, the layer inserted in every test, no `VUID-` or `SYNC-HAZARD-` IDs, and `agc_driver_own_refresh_repack_alias` ran (not skipped). **Not tested:** native Linux, including the `linux` job's setup (write-watched guest memory with compared imports; WSL2 has no write watch, so the Build is its first run), macOS, GPUs other than these; titles other than PPSA05110; no speed comparison on the RTX 3080. ### Checklist - [x] Based on current `main`; no other open PR implements the same functions - [x] One topic per PR; follow-ups go in a new PR - [x] No comments in code except [technical debt](https://github.com/boykopovar/AnyPS5/blob/main/docs/dev/CONVENTIONS.md) - [x] Unimplemented paths throw (`NotImplemented_nid_no_patch`); silent stubs are listed under Silent stubs in their library's [technical debt](https://github.com/boykopovar/AnyPS5/tree/main/docs/dev/debt) file - [x] No notes, investigation `.md` files or images added to the repository (attach them to this PR) - [x] New third-party code is a submodule built from source - [x] Generic behaviour, not specific to one title - [x] Depends on: none - [x] Fixes: none - [x] Unblocks: PPSA05110 #10872 (draw-committer time in the first gameplay area; the title does not stop there) - [x] GPUs tested: AMD Radeon RX 6700 XT (gfx1031), AMD Windows driver 32.0.21045.16010, Windows 11 26200; Mesa 25.2.8 lavapipe, WSL2 Ubuntu 24.04.3, kernel 5.15.167.4 (compared branch only); NVIDIA GeForce RTX 3080, driver 610.88 (validation tests on the earlier head `c005abb24f`, by @Oscar45397) - [x] AI-assisted: yes (Claude Code) 🤖 Generated with [Claude Code](https://claude.com/claude-code)
MarcZX10 commented 2026-10-27 06:32:34 +00:00 (Migrated from github.com)

Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-27T06:32:34Z.

Review: CHANGES_REQUESTED


The implementation, proof-checking test, validation runs, and matched Persona 5 Royal captures are carefully documented. I found one performance-report requirement that still needs addressing: both summary lines include APS5_TRACE_EVENTS=1048576 and APS5_TRACE_SUMMARY_EVERY=10 in addition to APS5_TRACE_SECONDS. The repository's Performance report form says not to set any other APS5_TRACE_* or APS5_PROFILE_* switches because they cost time. Please rerun and attach the comparison using only the required window switch (and the normal trace defaults), then refresh the digest and summary lines. The current pair is useful supplemental evidence, but does not meet the prescribed capture protocol as written.

The PR reports the nine relevant validation tests on both base and change, plus a title capture pair; hosted policy checks pass, while product CI is skipped by path policy. I did not rerun the GPU tests locally.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5663105618 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11740#pullrequestreview-5663105618). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-27T06:32:34Z. **Review:** CHANGES_REQUESTED --- The implementation, proof-checking test, validation runs, and matched Persona 5 Royal captures are carefully documented. I found one performance-report requirement that still needs addressing: both summary lines include `APS5_TRACE_EVENTS=1048576` and `APS5_TRACE_SUMMARY_EVERY=10` in addition to `APS5_TRACE_SECONDS`. The repository's Performance report form says not to set any other `APS5_TRACE_*` or `APS5_PROFILE_*` switches because they cost time. Please rerun and attach the comparison using only the required window switch (and the normal trace defaults), then refresh the digest and summary lines. The current pair is useful supplemental evidence, but does not meet the prescribed capture protocol as written. The PR reports the nine relevant validation tests on both base and change, plus a title capture pair; hosted policy checks pass, while product CI is skipped by path policy. I did not rerun the GPU tests locally.
adriadam10 commented 2026-10-28 17:39:49 +00:00 (Migrated from github.com)

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

Review: CHANGES_REQUESTED


The full Build of this head (run 40724347830, linux job, lavapipe) fails the new test:

  • agc_driver_own_refresh_repack_alias fails in 0.30 s with AGC graphics: 10_11_11 float view: a set whose view refreshed its own image over a pending 8888 unorm alias took the full walk, not the own-object refresh (OwnRefreshRepackAlias.cpp:223). The test is new, so main does not have this failure, and the other tests of the run behave as on main.
  • The log shows open /dev/udmabuf: Permission denied; shared direct memory is copied instead of imported. The only skip is HostImportCovers (OwnRefreshRepackAlias.cpp:203), and it does not skip here, so the test either needs a skip that matches this environment, or the own-object refresh does not take this path on Linux and the change needs a fix there. Please check which one it is (the test was only run on Windows) and push a head where the linux job passes.

The rest of the review stands: pendingLookupSource keeps cachedTexture's conditions, and the timing pair meets @MarcZX10's request.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5687090510 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11740#pullrequestreview-5687090510). Originally posted by [adriadam10](https://github.com/adriadam10) on 2026-10-28T17:39:49Z. **Review:** CHANGES_REQUESTED --- The full Build of this head (run 40724347830, `linux` job, lavapipe) fails the new test: - `agc_driver_own_refresh_repack_alias` fails in 0.30 s with `AGC graphics: 10_11_11 float view: a set whose view refreshed its own image over a pending 8888 unorm alias took the full walk, not the own-object refresh` (`OwnRefreshRepackAlias.cpp:223`). The test is new, so main does not have this failure, and the other tests of the run behave as on main. - The log shows `open /dev/udmabuf: Permission denied; shared direct memory is copied instead of imported`. The only skip is `HostImportCovers` (`OwnRefreshRepackAlias.cpp:203`), and it does not skip here, so the test either needs a skip that matches this environment, or the own-object refresh does not take this path on Linux and the change needs a fix there. Please check which one it is (the test was only run on Windows) and push a head where the `linux` job passes. The rest of the review stands: `pendingLookupSource` keeps `cachedTexture`'s conditions, and the timing pair meets @MarcZX10's request.
MarcZX10 commented 2026-10-29 10:16:02 +00:00 (Migrated from github.com)

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

Review: CHANGES_REQUESTED


Re-reviewed exact head c005abb24f6a076d3db0ae0d6caef6d69a87f43d against current main f99d7fece316e31878f0195f8bbc2ad2fbe635e4.

The corrected performance report now follows the capture-form switch rule, includes paired summaries/traces/digests, and reports the frame-level result as within noise rather than claiming a frame-time gain. That resolves my earlier report-format finding.

Two merge-readiness issues remain:

  1. Reviewer @adriadam10 reports that agc_driver_own_refresh_repack_alias fails on Linux when /dev/udmabuf is denied: HostImportCovers does not skip that environment and the first Revalidate fails the new proof-path assertion. Please establish whether this is an implementation failure or unsupported test setup, then make the Linux run pass (with an explicit, justified skip only if the required import capability is unavailable) and retain a run that exercises the regression on a host that supports it.
  2. The tested base is 88795ed448, while current main has since changed ShaderResources.cpp, including the cachedTexture pending-source lookup that this PR refactors and fastRevalidate relies on. The merge preview is clean, but the old paired timing/validation evidence does not cover that current integration. Please refresh the branch and rerun the focused regression/validation tests and matched performance comparison on the resulting current-main base.

I checked the exact source and current-main delta; I did not run a local GPU build. Hosted policy checks pass, while product Linux/Windows jobs are skipped. The independent Linux failure report is not resolved by the added RTX 3080 Windows validation run.

<!-- greyfinch-sync:boykopovar/AnyPS5:review:5696082053 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/pull/11740#pullrequestreview-5696082053). Originally posted by [MarcZX10](https://github.com/MarcZX10) on 2026-10-29T10:16:02Z. **Review:** CHANGES_REQUESTED --- Re-reviewed exact head `c005abb24f6a076d3db0ae0d6caef6d69a87f43d` against current `main` `f99d7fece316e31878f0195f8bbc2ad2fbe635e4`. The corrected performance report now follows the capture-form switch rule, includes paired summaries/traces/digests, and reports the frame-level result as within noise rather than claiming a frame-time gain. That resolves my earlier report-format finding. Two merge-readiness issues remain: 1. Reviewer @adriadam10 reports that `agc_driver_own_refresh_repack_alias` fails on Linux when `/dev/udmabuf` is denied: `HostImportCovers` does not skip that environment and the first `Revalidate` fails the new proof-path assertion. Please establish whether this is an implementation failure or unsupported test setup, then make the Linux run pass (with an explicit, justified skip only if the required import capability is unavailable) and retain a run that exercises the regression on a host that supports it. 2. The tested base is `88795ed448`, while current `main` has since changed `ShaderResources.cpp`, including the `cachedTexture` pending-source lookup that this PR refactors and `fastRevalidate` relies on. The merge preview is clean, but the old paired timing/validation evidence does not cover that current integration. Please refresh the branch and rerun the focused regression/validation tests and matched performance comparison on the resulting current-main base. I checked the exact source and current-main delta; I did not run a local GPU build. Hosted policy checks pass, while product Linux/Windows jobs are skipped. The independent Linux failure report is not resolved by the added RTX 3080 Windows validation run.
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!11740
No description provided.