feat(agc): group GPU draw timings by complete shader stage sets #15572
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/15572"
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 JJenkx on 2026-11-03T19:20:33Z.
What
The existing per-draw GPU report groups a draw by its fragment variant. Different vertex/geometry programs using the same fragment variant therefore collapse into one timing group, including draws using the built-in null pixel program.
Add opt-in
APS5_PROFILE_GPU_DRAW_STAGESalongsideAPS5_PROFILE_GPU=1 APS5_PROFILE_GPU_DRAWS=1. Recorded draws use a canonical complete shader-stage/64-bit-variant set as their timing key.[drawstages] drawset 0xN stage:0xvariant ...maps each process-local key once;[gputime]reportsdrawset 0xN. Stage order does not affect identity, and distinct programs/stages do not collapse. The previous labels/grouping remain the default. This measures whole draws, not individual shader-stage execution time. Existing timestamp-range caps and top-twelve reporting limits still apply.This is developer instrumentation, with no title fix or FPS improvement claimed.
Tested
Latest Linux regression qualification (2026-11-23), public test-only head
0702ba182761: pinned main03a717f38e6bpasses 5/5 shared physical-Vulkan cases; main plus the unchanged runtime topic and new test (71715851841f) passes 8/8 (six physical-Vulkan cases, two CPU key cases). Newagc_driver_recorded_draw_stage_groupsexercises actual recorded draws and requires distinct vertex variants sharing a fragment variant to retain separate keys. A private fragment-only collection mutation (a9d1953fd02a) passes the seven older checks and fails only this new assertion. Every device case confirms physical RX 6650 XT execution and Khronos 1.4.363 insertion; zero skips/VUIDs. Frozen banks and source/configuration restoration verified. The new assertion is Linux-qualified; no native title or FPS claim. Full source and verified evidence (SHA-256fd9469866918351b67c97d4415ac90aae97aba568684a2122bec4734d9616368).Peer Windows follow-up on public head
0702ba182761: Helldiverr reports mainb16988fb8bversus private merge90c1e7551f(that main plus this head), AMD Radeon AI PRO R9700, driver 32.0.31044.16, Windows 11 Pro 26300, GCC 15.2 Release, Khronos 1.4.363. All seven focused cases pass in each of three head runs; the recorded-draw regression separates three vertex variants sharing one fragment. A fragment-onlyrecordDrawmutation fails only the new regression while the other six cases pass. Each head/mutation log has four validation insertions across three GPU cases; the other four cases are CPU-only. Zero VUIDs or synchronization-hazard lines were reported. This independently closes the earlier recorded-draw coverage gap on that driver; these are contributor-reported checks, not new runs on our Windows host.Peer Windows GPU qualification of prior runtime head
415d9c2d025b: Helldiverr reports AMD Radeon AI PRO R9700, driver 32.0.31044.16, Windows 11 Pro 26300, Vulkan validation 1.4.363; focused cases pass three runs and the real recorded-draw probe separates shared-fragment vertex variants with zero VUIDs. Detailed peer report.Prior Linux qualification (2026-11-22): main
03a717f38e6bversus the same main plus this PR's public head415d9c2d025b(private compositionbc4ab005d364, unchanged topic patch ID). Focused cases pass 5/5 main, 7/7 change; four Vulkan fixtures per arm confirm the physical RX 6650 XT and validation insertion, with zero failures/skips/VUIDs. The additional two candidate cases are CPU stage-key tests.Insomnis PPSA06829 01.000.001 verifies actual complete-stage grouping at the lit mansion main menu: native exit0,135 stage sets,230 program/address mappings,5s trace with no event loss, zero query-range drops in40 reports, zero VUIDs and all cleanup/hash checks passing. Drawset0x49 identifies a14.776ms/present whole-draw group in the final67-present interval. Profiling/validation/request capture affect throughput; this is instrumentation proof, with no FPS, isolated-stage, gameplay or title-fix claim. Full report; download-verified evidence, SHA-256
128069b11d5b61c2448268d5ff3506299a1f1f954d40b6d8a0f906afbf946f46(66 payload hashes verified).Earlier reports below retain their own source pins and conditions.
Latest refresh (2026-11-13): head
920aa184547a2e8296175ec47ec2a79b87eb63b0rebased onto maina6606d5bab753def2a088d412795039a8f71e076, two topic commits and no merge commits. Onlydocs/dev/ENVIRONMENT.mdconflicted; both the stage-profiling row and main's read-only depth-bounds row are retained in order. All nine topic files have identical added/removed lines to the previous head.Paired Linux Release checks, Ryzen 9 7950X / RX 6650 XT / RADV Mesa 26.2.6: the same five timing/prepared-draw/relocation cases repeated three times give 15/15 on main and 15/15 on the change. The two stage-key cases add 6/6 on the change, for 21/21 total. Zero skips and VUIDs. Each of the four GPU cases per repetition confirms the physical RX 6650 XT and Khronos 1.4.363 layer insertion; the remaining cases are CPU-only key checks. Binary hashes stay unchanged through each arm and the temporary kernel setting is restored. Conventions and whitespace checks pass. No new title, FPS, Windows or GPU-vendor claim.
Exact pins, preserved topic patch, build logs, per-case layer/device evidence and hashes, SHA-256
a737c24a726b7d0144f6233e4497e13c200680c5666ee4ac79f75060fd1693eb. Download and all 25 manifest members verified. Earlier title/other-vendor evidence below retains its original pins.Linux x86-64, GCC 16.2.1 Release. Current production head
be736b2f0a22750a38807bf9aa91943169de8f3bis one commit on main086c0686c8adff3ee648fdbe34e0b0b647e1d511. The rebase retains the identical stable patch ID. The following host and focused GPU checks were rebuilt and repeated on that main/change pair:shared fragment collapsed distinct vertex programs.ANYPS5_REQUIRE_VULKAN=1,ANYPS5_NO_SHADER_CACHE=1, the Khronos validation layer, and all three profiling flags enabled: 15/15 each, zero skips and zero VUIDs. Layer insertion and RX 6650 XT selection confirmed; sources and loaded unpatched library hashes unchanged during each arm. These cases exercise real GPU work but do not activate the recorded-draw stage mapping path; the separate native diagnostic below covers that path.Outer Wilds PPSA08102 recorded-draw diagnostic: immutable integration
616721c3ac514955c26ebe537836c957142b25decombines this change with the same #15436/#15487 stack/mapped-copy prerequisites used by the prior control. Reused extracted assets; independent 406-module SDK, source snapshot, and caches; fresh save; Wake Up at 140 s, outdoor scene at 170 s and after the trace. The 320 s scheduled close exited normally (native 0), no remaining process, SDK/generated files unchanged, save locations and shared kernel setting restored. 594 stage-set mappings and 30 GPU timing reports were captured. The built-inNullPixelCodefragment variant was resolved through its loaded ELF mapping and symbol, and split into 22 distinct complete stage sets. Compositor/X11 captures agree after the trace. This verifies actual instrumentation, not FPS improvement, console-equivalent graphics, audio or a full playthrough.Patch, raw qualification logs, native metadata/captures and stage mappings, SHA-256
3d0f5189dd1a76791b2d034f4d70c6f6c6ddd63ab5f42422ebb52364728d0b5c(internal manifest and GitHub upload digest verified).Current-main stage-profiling follow-up (2026-11-04): private integration
b7c979652829c8cb10de87eb7328ac96b4ef380bis mainb611e634f7fc024f0c13e342d96de744448ef1d9plus the unchanged #15572 patch (stable patch IDs match). Same focused real-Vulkan/VVL/cache-off gate: main 5/5, change 7/7, no failures/skips/VUID messages, frozen SDK/source integrity retained.The first separately staged native run crashed during startup (exit 139, 14.5 s). A fresh independent runtime with a first-fault-only debugger then reached Wake at 137.75 s, the outdoor scene, and its scheduled ordinary close (native/debugger exit 0, 279.1 s); the debugger saw no fault, changed no guest state and bypassed no failing execution. The earlier startup crash remains unexplained; no crash fix is claimed. Both runs and cleanup receipts are retained.
The successful diagnostic emitted 594 complete stage mappings and 26 GPU timing reports. Eleven safely post-Wake report intervals cover 1,292 presents with zero dropped ranges and no missing stage keys. Four complete draw sets sharing the built-in
NullPixelCodefragment account for at least 39.89 ms/present in the logged top-twelve program costs; draw-class timing totals 69.33 ms/present. Their vertex variants are distinct (0x82,0x96,0x91,0x83in this process). Fragment identity is proven from[drawvariant], the captured loaded-driver mapping and the frozen ELF symbol, rather than assumed from an old process ID.This identifies costly whole draws, not isolated vertex/fragment execution. Top-twelve reporting makes aggregates lower bounds. Profiling/debugger overhead, animated sky/lighting and fixed upward camera prevent a matched FPS comparison. Reviewed captures show the opening trees/tower/tutorial; audio, reference rendering and full gameplay remain unverified.
Raw paired gates, normal/failure accounting, native logs, mappings, timing analysis, trace and captures, SHA-256
174c5997ea489550dc173298e092c082ad9c19dcec88385bd8f60d9d04364cbc(public download verified). No provider module bytes, game assets/saves or shader request/SPIR-V payloads included.Overlap: official scan checked 1,777 open PRs. Its 85 failed-closed shared-file branches were compared separately from their own merge bases; no duplicate timing-key/grouping implementation was identified. #11566 covers mocked fixture profiling, #13417 fixes parsing of unlisted timing keys, and #15548 changes mesh-compute render-pass sharing; none supplies this stage-set grouping or is required by it.
Current-main086 refreshed build/test logs, hashes and rebase proof, SHA-256
aa95fffcdef446bd723804063e52b95442b87fff6459ee42b06418340394b7a3(internal manifest and GitHub digest verified): host 3/3; same 15/15 Vulkan cases on main and change, actual validation layer, zero VUIDs/skips, sources/libraries unchanged. That earlier archive retains its main1e/integration616721 pins; the following diagnostic is separate current-main evidence.Additional current-main native proof: integration
129d0b19805f160b605451c8ac00171042c0ae78combines main086c068, this headbe736b2f, and the #15487 mapped-copy prerequisite. The first fixed-input attempt remained at the title screen and is retained as menu-only evidence. The retry recognized Start/Expedition/Wake Up prompts, reached the outdoor trees/tower/tutorial scene in both reviewed capture channels, and closed normally at 227 s with SDK/generated files unchanged and saves/kernel restored. It emitted 594 stage-set mappings, including 22 combinations sharing the null fragment variant. Profiling, shader dumps and OCR navigation were enabled; this is instrumentation/scene proof, not a performance comparison. Raw logs, provenance, input records and captures, SHA-256a08959bc587af92f60faaf5099c75d4ac423330212c1d03a1f930a9785052d78(manifest and GitHub digest verified). Private game request/SPIR-V payloads, saves, binaries and assets are excluded.Historical author-run conventions and whitespace checks pass. That earlier qualification did not cover Windows/macOS; current contributor Windows evidence is linked above.
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)Reporting clarification from review:
[drawstages]stage numbers followShaderStage: 0 Compute, 1 Vertex, 2 TessellationControl, 3 TessellationEvaluation, 4 Geometry, 5 Fragment, 6 Local, 7 Mesh. Each draw-set ID is local to the process and is not a shader-program key. This opt-in instrumentation performs vector construction/sorting and a synchronized map lookup per recorded draw, so its CPU overhead must be considered when interpreting profiles; it is not a measure of individual-stage cost.The independent Python consumer follow-up https://github.com/boykopovar/AnyPS5/pull/19142 prevents
ab_split.py --programfrom counting draw-set IDs as programs. It preserves default-report behavior and top-12 missing-program handling; this branch's production code is unchanged.Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-11-21T06:58:27Z.
Review: APPROVED
Reviewed — looks good
The change adds opt-in whole-draw timing groups keyed by sorted shader-stage and variant pairs; I found no verified blocking defect in the reviewed source.
What I ran
Reviewed head
415d9c2d025b5b96a8667629d61d46ab7c10fcbbusingrepo_read.pyto inspect the prepared diff and targeted source ranges. No build or tests were run in this review.Results
Findings
Blocking
None.
Non-blocking
None.
Not verified
Build and test results were not independently verified. The changed
core/libs/prx/libSceAgcDriver/tests/Recorder.cppis excluded from the review bundle because it is too large; its changed lines were inspected indiff.patch, but its full head file was not read. The other changed files were included in the bundle. Author-reported checks in the PR description were not run here.To get this to a good state
Nothing is required.