feat(agc): add a detailed second page to the performance overlay #10487
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/10487"
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 EagleBearerYS on 2026-10-24T03:12:46Z.
What
F10 now cycles the performance overlay through three states: off, page 1 (unchanged), page 2 (new), then off again.
ANYPS5_OVERLAY=2starts on page 2,1on page 1, and0or unset leaves it off. Any other value is refused withANYPS5_OVERLAY must be 0, 1 or 2. Each change of page resets the statistics.Page 2 (46 columns, read once a second while it shows; a line or part whose source isn't available in the run is left out):
FPS,FRAMEBUSY %per queue workerworker_busy_pctcounts themtop_phases_ms_per_frameaggregates themQ0 WAIT MS/FRAME: MEM … LOCK … GPU …RENDER PASSES/FRAMEPIPELINES: COMPILING n NEW/S nHIT %: DRAW CACHE … PIPELINES …FLIPS/S,PRESENTS/S,DROPPED/S,REPEATED/SCOMMIT: used/limit GB FAULTS/SK32GetPerformanceInfoandPageFaultCount; Linux/proc/meminfoandgetrusageHOST IMPORTS: n used/budget GBCPU COPIES: x MB/S CAP: y%UNIMPLEMENTED: n/S n TOTAL,REFUSED SHADERS: nNotImplemented_nid_no_patchbefore it throws, and the refused-shader set underAPS5_SKIP_REFUSED_DRAWSTITLE: id PRESENT: modeCost. Page 2 is meant to cost nothing unless it shows:
main, plus aRecording()check per render pass begun, the copy counter in address-based builds that copy, one relaxed add onNotImplemented_nid_no_patch's throw path, and one 8-byte store per presented display buffer. Threads the trace names keep their name in a thread-local once, at start.main, plus two compares per present. Trace totals stay off.APS5_TRACE_*run behaves as today: page 2 only reads the totals that trace already records.Headless, 5 alternating runs each (Xeon 2.10 GHz VM, lavapipe), medians:
mainPage 2's real cost is the last row: each timed scope on a driver thread reads the clock while it shows.
Left out: the upscaler mode (#10043 isn't merged), the shader disk-cache hit rate (its totals are fenced off from other sources in CMake, so I didn't wire them; reviewers can say whether page 2 may read them), and GPU-time lines (no GPU query is added;
Q0 WAIT … GPUis the CPU's wait for the GPU).Docs:
docs/user/USAGE.mddescribes the cycle, every page-2 line with its source on Windows and Linux, and what runs in each state;docs/dev/ENVIRONMENT.md'sANYPS5_OVERLAYrow lists page 2.The commits:
Tested
Screenshots, Planet of Lana (PPSA19450) on Windows with an RTX 3070, this PR's head 1eabf2385b, page 2 started with
ANYPS5_OVERLAY=2:Page 2 in play, and its panel at native size:
Page 2 at the title menu:
The in-play spot above with the overlay off:
Planet of Lana (PPSA19450), page 2 against the overlay off, on the same RTX 3070 Laptop GPU (clocks not held), this PR's head 1eabf2385b, 1920x1080 window: B A A B, 540 s per arm, from the title's boot. In play (+420 to +500 s), page 2 averaged 19.8 presents/s and 13.89 ms of GPU busy per present, against 20.15 and 13.56 ms with the overlay off. That's −1.7 % presents/s and +0.33 ms per present, inside the spread between arms (18.7-21.0 presents/s). The menu (+90 to +150 s) varied more between arms (33.7-41.8 presents/s), so it gives no reading of the cost. The second half of the run was faster in both conditions, and the B A A B order cancels that.
The tests, in the existing overlay test executables:
agc_performance_overlay_statistics: parsing, the cycle (including past 2^64 presses), the page-2 composer and layout at four sizes, the trace deltas, hit rates, present-mode names, the OS reads, the copy counter across threads, the unimplemented count, the trace switch on and off;agc_performance_overlay(Vulkan): page 2 drawn bit for bit at 1280x720, the F10 cycle with its resets, and the sampler end to end.mainand on this PR, apart from the live VRAM value.GitHub's runners (run 40055350747, ×5, at this PR's head;
main's tree doesn't build these tests, as they use the new API):agc_performance_overlay,_statistics,_device_selection,_device_selection_cpu,agc_performance_trace,agc_driver_present_mode,agc_driver_presentation_pass).agc_performance_overlay,_device_selection,agc_driver_presentation_pass) skip, since the runner has no Vulkan device.APS5_SKIP_TIMING_TESTS=1.Linux, CI's configure flags (lavapipe, on a cloud machine): the overlay, trace and present tests
--repeat until-fail:20, 8 tests, 20 of 20 each; CI's Linux job mirrored: 1,927 tests, of which 1,837 pass, 86 skip and 4 fail, the four being that machine's IPv6 tests. Each commit's own overlay tests pass at that commit.Validation layer (Khronos 1.3.275, lavapipe),
mainef0d8ae3band this PR overagc_performance_overlay,_device_selection,_device_selection_cpu,agc_driver_present_mode,agc_driver_presentation_passandagc_resident_present:agc_driver_depth_plane_fill) reports the knownVUID-VkDeviceCreateInfo-pNext-pNexton both, so the layer was reporting. No newVUID-.Validation layer on an RTX 3070 Laptop GPU (Khronos layer from the LunarG SDK 1.4.363, NVIDIA 617.42, Windows 11, GPU at P0), this PR's head 1eabf2385b,
VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validationandANYPS5_NO_SHADER_CACHE=1, overagc_performance_overlay,_device_selectionandagc_driver_presentation_pass, twice:VK_LOADER_DEBUG=layer);VUID-or other validation message in the output. No control test with a known message ran on this GPU, so this rests on the layer's default reporting; the lavapipe control above shows the layer reporting there.0937d4c6f6, a merge of
main2742004ed2. The one conflict was inGuestBufferMemory.cpp'sAcquireRegistered. #9514 reads the address-copy cap there through its own copy of theAPS5_ADDRESS_COPY_MAX_MIBlookup, which this PR moves intoaddressCopyLimit(). The merge takes the cap fromaddressCopyLimit(), which returns the same value, and keeps this PR's per-thread copy count and #9514's eviction. So #9514's separate copy of the lookup is gone, and the rest of the PR's own diff is unchanged.^agc_performance_overlay, the presentation-pass, present-mode, resident-present and performance-trace tests, and #9514'sagc_address_copy_capandagc_address_copy_cap_remembered. Linux: 10 run, 10 pass, 0 skip, 0 fail. Windows: 10 run, 6 pass, 4 skip (no Vulkan device), 0 fail.^agc_driver_guest_memory_lifetime,agc_driver_host_import_lifetime,agc_driver_host_import_mutation_raceandagc_driver_host_import_failure_handles. Linux: 14 run, 14 pass, 0 skip, 0 fail. Windows: 13 run, 2 pass, 11 skip (no Vulkan device), 0 fail.guest_raise_in_system_calltimed out at 30 s once, 221st of 223; this PR changes nothing in libkernel. The import-path run's suites pass on both. The suites ran withAPS5_SKIP_TIMING_TESTS=1, which relaxesprecise_wait's median bounds on GitHub's hosted runners.815dfe12e4, a merge of
main14c99b52ac(run).main's #10160 adds a wait for the DCC key writer inVulkanDevice.cpp'sPresentDisplayBuffer, on the lines where this PR records the presented address; the merge keeps both, recording the address first.main'se75a166184already includes<optional>inDriver/Diagnostics.cpp, so this PR's include there merges into it; this PR's other changed lines are the same as before the merge. The 10 focused tests (the present, overlay and trace tests,agc_resident_presentand theagc_address_copytests) pass 10 runs in a row. Linux: 10 run, 10 pass, 0 skip, 0 fail. Windows: 10 run, 6 pass, 4 skip, 0 fail; the four skipped (agc_driver_presentation_pass,agc_performance_overlay,agc_performance_overlay_device_selectionandagc_resident_present) need a Vulkan device, which the Windows runner lacks. Suites: libc and libkernel pass on Linux (145 and 210) and on Windows (172 and 230). The suites ran withAPS5_SKIP_TIMING_TESTS=1, which relaxesprecise_wait's median bounds on GitHub's hosted runners.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)VulkanDevice.cpp; this PR goes after them and adapts to each when it merges). #10160 merged, and this branch now merges it; #10420 was closedImported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-24T12:12:54Z.
Review: APPROVED
Reviewed head
1eabf2385bea808887181ab8f11a8a6adce0557e.I checked the page cycle and reset path, the page-2 once-per-second sampler and trace on/off behavior, the counter deltas, and the layout/composer changes. The overlay reads trace totals through a try-lock and retains its last sample if that session lock is busy; per-thread trace totals are atomically collected. I did not find a blocking correctness issue in the reviewed diff.
Hosted convention, eligibility/intake, register-context, relinker, write-watch, and ASan checks currently pass. The hosted Linux and Windows product jobs are skipped. The PR describes additional lavapipe and RTX 3070 tests, screenshots, and performance runs; I did not reproduce those hardware, timing, or device-specific results locally, so this approval does not independently validate those reported measurements.