perf(agc): prove an untracked storage image unchanged from an equal compare #18076
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/18076"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by klosixgaming-arch on 2026-11-10T09:52:05Z.
What
A storage image whose memory is outside the write watch had no refresh proof, so every refresh took the full path even when nothing had changed: flush checks, import segments, keys and saved write-back waits. On Cyberpunk 2077's Body Type screen that is about 2,500 full refreshes per second.
Such an image, if it has no DCC metadata, now takes a proof like a tracked one. A later refresh accepts the proof when all of these hold:
APS5_NO_UNTRACKED_REFRESH_PROOFturns it off, andAPS5_ABcan toggle it.Tested
Summary lines of
mainand of this PR (2026-11-10, same machine and session)Cyberpunk 2077 (PPSA03974), the intro movie, 3200x1800, warm caches; Windows 11, RTX 5090 (driver 617.42), Ryzen 9 9950X3D. Each line is its own run with no switches but the capture ones (
APS5_TRACE_SECONDS=60:10,APS5_TRACE_SUMMARY_EVERY=10,APS5_TRACE_EVENTS=1048576) and, where the line shows it, an in-run A/B that starts after the trace window. Traces and all summary lines: https://github.com/klosixgaming-arch/AnyPS5/releases/tag/perf-captures-2026-11-10main3339e01f59:this PR merged with
main,b1e916a7de(now the PR head):Steady 10 s windows 3 to 7 of the movie:
main43.6 presents, this PR 44.4. The PR side is the PR merged withmaine95cc604e2, six commits after themaincapture (libSceNpWebApi, macOS and freetype build files, oneRunReport.cppline); none of them touches the AGC driver or guest memory. Separate runs differ here by more than these changes. For example, #18078's switch makes no difference in its own in-run A/B, yet its run and #17786's run differ by 8% in the same windows.mainitself ran 43.0 and 43.6 (3339e01f59) and 47.0 (e95cc604e2, themainmerged into this PR, a run at 22:20 that is also in the release) in the same windows. So the in-run A/B on the PR's commit is the measure. In the run of the second line,APS5_AB=10:APS5_NO_UNTRACKED_REFRESH_PROOFfrom 80 s, 9 B phases inside the movie: this PR gives 3.0% more frames onmainalone in this scene (2.7 SE).Recorder.Syncslices per present in the trace windows:main44.0, this PR 35.2.trace_digest.py, main
3339e01f59seconds 60:10 from present 357: 43 presents, frame p50 231.4 / p90 246.0 / p99 261.8 / max 261.8 ms, GPU busy 43.0 ms per present
NVIDIA GeForce RTX 5090, NVIDIA 617.42, Windows 10.0.26200, 3200x1800, commit
3339e01f59, dropped: noSlowest frames (largest slices inside each, inclusive)
Threads (ms per frame)
Largest slices (ms per frame, inclusive, all threads): Driver.Packet 446.7, Driver.Packet.dispatch 218.6, Driver.Packet.memory_wait 202.4, Driver.Dispatch 153.2, Vulkan.Dispatch 102.0
Longest waits
Largest GPU batches (GPU ranges inside, and the CPU slices that recorded each, inclusive)
trace_digest.py, this PR
b1e916a7deseconds 60:10 from present 357: 45 presents, frame p50 221.0 / p90 235.4 / p99 241.0 / max 241.0 ms, GPU busy 43.5 ms per present
NVIDIA GeForce RTX 5090, NVIDIA 617.42, Windows 10.0.26200, 3200x1800, commit
b1e916a7de, dropped: noSlowest frames (largest slices inside each, inclusive)
Threads (ms per frame)
Largest slices (ms per frame, inclusive, all threads): Driver.Packet 427.6, Driver.Packet.dispatch 207.4, Driver.Packet.memory_wait 197.6, Driver.Dispatch 143.3, Vulkan.Dispatch 96.7
Longest waits
Largest GPU batches (GPU ranges inside, and the CPU slices that recorded each, inclusive)
Windows 11, NVIDIA GeForce RTX 5090, Ryzen 9 9950X3D. Cyberpunk 2077 (PPSA03974), character creator, Body Type screen, warm caches,
APS5_PROFILE_DRAW=1.All numbers are in-run A/B: one run flips the PR's switch every 30 s (
APS5_AB=30:<switch>,APS5_AB_START=170sor200s), andtools/ab_split.pycompares each B phase (switch set, the old behaviour) with its neighbouring A phases (this PR). Both sides use the same build, settings and scene."The series" below is my Cyberpunk tree:
f5fe807353with #11485, #10443 (APS5_SETTLE_FLOOR_KIB=64), theAPS5_CAPTURE_UNPROVEN_PENDINGcapture experiment, #17786, per-block walk reuse (#17766's model), dispatch items for dispatch-cache misses (local, withAPS5_PIPELINE_DISPATCH=1), and the earlier PRs of the series.maincannot reach this screen without the capture experiment (the storage write-back abort), so themainruns below carry that one commit too.On the series (
APS5_AB=30:APS5_NO_UNTRACKED_REFRESH_PROOF, 9 B phases; this run was of the first version, without the kept-at-unwatch condition):On
main(dd4da52a88with this PR as it is here and the capture experiment, 10 B phases):So it is 2.7% on the series and within noise (+0.4% ± 0.8%) on
mainalone. A run of the first version onmainc51f4560c5gave +2.0% (4.5 SE). I have not separated whether the newermainor the added condition explains the difference.Tests (Windows, RTX 5090): built
agc_driver_recorder_tests,agc_runtime_switches_tests,agc_driver_bda_device_tests,agc_driver_host_import_windows_testsandagc_host_import_retire_testsonmaindd4da52a88with this PR and ranctest -R '^(agc_import_.*|agc_storage_.*|agc_.*_import_.*|agc_copied_write_back|agc_runtime_switches.*)$'. 52 tests pass, including allagc_storage_*andagc_import_*tests. 8 did not run here: 5 binaries were not built by these targets, and 3agc_driver_msaa_dcc_compared_import_*tests fail to start on this machine with 0xc0000139, a DLL entry point not found.Series
These PRs come from the same work on Cyberpunk 2077's character creator, Body Type screen, where the draw committer and queue worker 0 are the limit. They go together:
Each gain was measured with the earlier rows already in place, so the rows add up. The last row was measured on the intro movie, the others on Body Type; both scenes are limited by the same draw committer. Most of them are small or zero on
mainalone, becausemainis limited elsewhere on this screen; each PR says what it measured there. Not a PR:ANYPS5_PRESENT_MODE=mailboxgave +12 to 14% andimmediate+18 to 21% on the same screen, because FIFO holds the flip that the next frame's rendering wait waits for.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed under Silent stubs in their library's technical debt file.mdfiles or images added to the repository (attach them to this PR)Pull request closed