feat(agc): sample the draw committer with APS5_SAMPLE_COMMITTER #8075
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/8075"
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 johandavidcm on 2026-10-19T19:53:32Z.
What
APS5_SAMPLE_COMMITTER=<file>samples queue 0's draw committer with the worker's sampler and writes the same two files asAPS5_SAMPLE_WORKER:<file>(module offset self inclusive) and<file stem>.collapsed.txt(whole stacks for speedscope.app or flamegraph.pl).The committer records the draws the packet worker hands over (
APS5_PIPELINED_DRAWS). When the worker's stacks wait inDrawPipeline::Enqueue, the committer is the thread that bounds the frame, and onlyAPS5_SAMPLE_THREADSreaches it: its 40 hottest addresses, 12 frames deep, with no whole stacks. Sampling the committer is what showed, in #8068, that 12 % of its samples in PPSA31327's gameplay rescan the DCC keys of sampled textures incachedTexture, a path the worker's stacks and the trace phases do not name.DrawPipeline::runstarts the sampler when the committer thread starts, after it binds to the trace. The committer starts with the first pipelined draw, so withAPS5_PIPELINED_DRAWS=0nothing is sampled.StartWorkerSampler, taking the output path and the thread slot).StopWorkerSamplerstops both. Without the variable nothing starts, as for the worker.Overlap: #7622 changes the same
workerSamplerThread = std::jthread(...)line toLibc::StartHostJThread, which isslot = std::jthread(...)here; #7246 addsPinWorkerThread("draw_committer")beside the line this adds toDrawPipeline::run. Both are one-line merges; I will rebase if either lands first.Tested
Windows 11 Pro 26200, WinLibs GCC 15.2.0 (ucrt, posix, seh, r7), Release, NVIDIA GeForce RTX 4070 (driver 617.42), Ryzen 7 7800X3D.
libSceAgcDriverbuilds onmainb7fc3d324, with no warning in the touched files.main40393b0f9with #6572 and #7381) with the sameWorkerSampler.cppand the same two lines inDrawPipeline.cpp: a 50 s run withAPS5_SAMPLE_COMMITTERandAPS5_SAMPLE_WORKERwrites both pairs of files every 20 s, 2,562 samples each, and every committer stack not marked[truncated](4 are) is rooted atDrawPipeline::run. An earlier version of this change, which passed the variable name instead of the path, sampled about 200 s of gameplay for #8068 (12,810 samples; the committer file is attached there).tools/check_conventions.py --base origin/mainpasses.tools/env_reference.py --checkfinds the new row; its only error isAPS5_CPU_FLIP_IN_ORDER, which has no row onmaineither.StartCommitterSamplerbeside the other two.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)Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-19T19:59:33Z.
Other open pull requests touch the same code. Merging one will break the other, or both implement the same thing. If this one builds on them, list them in Depends on.
main)core/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawPipeline.cppL144core/libs/prx/libSceAgcDriver/Execution/src/WorkerSampler.cppL305Some comparisons could not be completed because a pull request conflicts with the base branch. Review these shared files manually before concluding that there is no overlap.
docs/dev/BUILD.mddocs/dev/BUILD.mdcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawPipeline.cppdocs/dev/BUILD.mddocs/dev/ENVIRONMENT.mddocs/dev/ENVIRONMENT.mddocs/dev/ENVIRONMENT.mdcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawPipeline.cppcore/libs/prx/libSceAgcDriver/Execution/src/WorkerSampler.cppcore/libs/prx/libSceAgcDriver/Execution/src/WorkerSampler.cppdocs/dev/ENVIRONMENT.mddocs/dev/BUILD.mddocs/dev/ENVIRONMENT.mddocs/dev/ENVIRONMENT.mdcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawPipeline.cppdocs/dev/ENVIRONMENT.mdcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawPipeline.cppdocs/dev/ENVIRONMENT.mddocs/dev/ENVIRONMENT.mddocs/dev/ENVIRONMENT.mdcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Draw/DrawPipeline.cppdocs/dev/ENVIRONMENT.mddocs/dev/ENVIRONMENT.mddocs/dev/ENVIRONMENT.mddocs/dev/ENVIRONMENT.mdImported from boykopovar/AnyPS5. Originally posted by Rajkamalcode on 2026-10-20T04:40:12Z.
SWAG (PPSA22102) validation of
APS5_SAMPLE_COMMITTERMeasured
Windows 10.0.22635, RTX 3070, driver 610.88. Build: base
b6dd2f9e3+ this PR, driver prx77063CAD7CDA76F4. TitlePPSA22102at the tutorial spawn, low-settings diagnostic profile (the committer is the wall there), 360 s, same pad replay,APS5_PROFILE_DRAW=1, no trace.APS5_SAMPLE_COMMITTER=<file>produced both files.DrawPipeline::runwaits 12,616 + 7,659 = 88.4% of samples;commitDraw6,284;refreshResidentTarget2,412;ShaderResourcesctor/buildComplete/resolveImageBinding 1,151/999/958;fprintf1,323 (5.8% of samples).On the same title at stock defaults, a baseline trace (not this PR build; this PR adds instrumentation only) shows the committer 44.2/43.3% busy and 29%/24% of that busy time in
GpuMutex.wait.draw, while the worker is the wall at 97.1/97.6%. So the committer sampler is valuable whenDrawPipeline::Enqueuewaits make the committer the bound; the default-settings profile is worker-bound.AI-generated analysis (separate from the measured data)
fprintfshare is sampler-side overhead, not title work; it is not a blocker.Artifact
swag-run23-committer.collapsed.txt(22,947 samples); the 12,809-sample mid snapshot is also available. I will attach it in a follow-up drag-and-drop sinceghcannot attach files.