feat(agc): opt-in per-draw GPU timing and dump-by-address diagnostics #11365
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/11365"
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 oneandonlydean on 2026-10-26T08:49:41Z.
What
An opt-in extension of
APS5_PROFILE_GPUfor finding which draws cost GPU time. Today the[gputime]line lists the hottest programs by GPU time, but every recorded draw is counted in oneDrawclass total, so a slow scene shows that draws are expensive without naming the shader. Nothing changes unless the new switch is set.APS5_PROFILE_GPU_DRAWS=1(withAPS5_PROFILE_GPU=1) records a[gputime]range around each recorded draw command that does not use a recipe, keyed by the fragment program's variant id, so draws appear in the hot list next to compute programs asdraw 0x<variant>. A[drawvariant]line names the code address behind each variant id once, for queued and inline draws alike. The ranges share the batch's query cap with every other timed range.APS5_DUMP_DRAW_SHADERSalso matches a program's code address, besides the color-target and slot-0 addresses it takes today, so a program named by[drawvariant]or[gputime]can be dumped directly.docs/dev/ENVIRONMENT.mddocuments both. Known residue: a draw whose variant id already uses bit 63 (the pixel-stub draws) is labelled with that bit cleared.Tested
main263eee0a77: build ofagc_driver_recorder_testsandagc_driver_graphics_tests;ctest -R 'agc_gpu_timing|agc_driver_graphics_maps_fallback|public_headers': 69 of 69 passed, 0 failed, 0 not run, includingagc_gpu_timing_key(the[gputime]label isdrawplus the id[drawvariant]prints) and the existingagc_gpu_timing_completeandagc_gpu_timing_incomplete.tools/check_conventions.pyagainst thatmain: all checks passed.8e38bcf06dmerged ontomain518d36eaec(comment 6421390537): RTX 4070 SUPER, GTX 1650 SUPER and the AMD Radeon RDNA2 iGPU, 90 of 91 passed on each,agc_gpu_timing_keypassing on all three. The one failure,agc_host_import_cut_lifetime, fails the same way onmain.draw 0xid in[gputime]joined to a[drawvariant]line, the per-draw split stayed off withoutAPS5_PROFILE_GPU_DRAWS, and the tester saw no frame-rate cost.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 (none added).mdfiles or images added to the repositoryImported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-26T08:52:54Z.
Review: CHANGES_REQUESTED
Reviewed exact head
3cd49f9b9b1e8cbf85758af8bf607800100bf3c5.I am requesting changes for these issues:
conventionscheck fails because the PR body does not use the required template sections. It reportsWhat,TestedandChecklistmissing/empty. Please fill the repository template and rerun the check.variantId | (1ull << 63)inGraphics/src/Draw.cpp, but the[gputime]reporter prints the key unchanged while[drawvariant]prints the untaggedvariantIdfromExecution/src/Driver/Draw/Draw.cpp. The timing row therefore cannot be joined to its code-address mapping as documented. Please normalize the key in reporting or make both lines use the same displayed identifier, and add a regression for that mapping.perf(...); the automated check requests the twoaps5-summary.jsonllines, same-scene/same-machine traces andtools/trace_digest.pyoutput. None are in the description, and the author says the timing diagnostic was not tested on a real draw stream. Please provide applicable evidence under the repository performance-report protocol, or clarify the title/classification with maintainers if this diagnostic is not a speed change. Please also exercise the new switch on a real draw stream and confirm the timing and variant lines are emitted and usable.Eligibility, intake, labels and report checks pass; hosted relinker/product tests are skipped by path policy. I did not independently build or run the GPU diagnostic.
AI-assisted review.
Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-26T09:45:19Z.
Review: CHANGES_REQUESTED
Follow-up on exact current head
8c45681cc301b7a43055d6aaacfb7b7cbcbd7cfeagainst currentmain4e43321bd6ceccdc1ae28568bbbc35d9a6446464. The latest commit fixes the tagged timing-key mismatch and adds a focusedTimingKeyLabeltest; I withdraw those earlier code findings. The branch is four commits ahead of currentmain, has a clean merge preview, and currentgit diff --checkpasses.Two merge blockers remain:
What,TestedandChecklistsections. The current body usesSummaryandTestsand has no checklist. Please fill the repository template and rerun conventions.perf(...), so the current policy requires valid same-scenemain/change APS5 summary lines and attached traces plustrace_digest.pyoutput. None are present. This change adds an opt-in diagnostic and does not claim to make the game faster; please obtain maintainer direction on an applicable report for this diagnostic or reclassify it so the title does not trigger the speed-change evidence rule. The author also says a real draw stream was not tested; please report the focusedagc_gpu_timing_keytest and a real draw-stream check for the emitted[gputime]/[drawvariant]mapping, or state clearly what could not be exercised.The current CI lists eligibility, labels and report passing, conventions failing, and Linux/Windows/product jobs skipped by path policy. I did not run the GPU diagnostic locally.