fix(agc): end a pipelined submission's EndSubmission time before its REWIND tail runs #8108
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/8108"
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 milescoviello on 2026-10-19T22:00:41Z.
What
On the pipelined path,
Driver::executekeeps itsDriver.EndSubmissiontimer open while it runs a released REWIND tail (PacketExecution.cpp, theexecuteRewindTailcall insidepipelined && orderedCompletion). The tail's submission ends by opening the nextDriver.EndSubmissioninside the first, so a chain of n tails is counted up to n times in that scope's total.worker_busy_pctandtop_phases_ms_per_frameadd those totals, so they overstate the queue worker's time; #8092's GTA V capture shows queue worker 0x0 at 3,740% busy. The non-pipelined path already finishes the timer before it runs the tail. The pipelined branch now does the same.Tested
Ubuntu 24.04, GCC 13.3, Release, NVIDIA RTX 4070 Ti (595.99.02).
agc_driver_pm4_rewind_trace(agc_driver_pm4_tests rewind-tracewithAPS5_TRACE_FRAMES=0:1andAPS5_PIPELINED_DRAWS=8). One trace window covers a submission of 12 REWIND tails that are released before it runs; each tail waits about 3 ms on a word the test sets. The test then reads queue worker 0x0's share in the window'sworker_busy_pctand requires at most 150%.b87501d550drops the new line): 703.9%, 676.5% and 702.8%, so it fails 3 of 3.ctest -R '^agc_driver_pm4': 16 of 16 pass.Driver.EndSubmissiontotalling 236.8–239.5 ms in a 38 ms window: 12 slices nested 12 deep, whose union is 36.9 ms. With the PR it passes 9 of 9 at 94.9–96.0%, andDriver.EndSubmissiontotals 0.009–0.018 ms.^agc_driver_pm4passes 16 of 16.VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation ANYPS5_NO_SHADER_CACHE=1 ANYPS5_REQUIRE_VULKAN=1 ctest -R '^agc_driver_pm4' -Vonmaina700809679(15 tests) and on this PR (16 tests). All pass, neither log reports the layer missing, and neither has aVUID-error.tools/check_conventions.py --base upstream/mainpasses.tools/pr_overlap.pyfinds no overlap among the pull requests it could compare. It lists PRs that conflict withmainand touchPacketExecution.cpp(#7978, #7642 and others),Pm4.cppor the driver'sCMakeLists.txt.Not run: Windows and macOS. The test is registered on every platform, with the
PATHsetting the other Windows PM4 tests use.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)🤖 Generated with Claude Code
Imported from boykopovar/AnyPS5. Originally posted by github-actions[bot] on 2026-10-19T22:18:02Z.
Some 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.
core/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/tests/Pm4.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/tests/Pm4.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/Execution/src/Driver/Packets/PacketExecution.cppcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtcore/libs/prx/libSceAgcDriver/CMakeLists.txtImported from boykopovar/AnyPS5. Originally posted by simonbbby on 2026-10-19T22:25:08Z.
Independent CPU trace audit of exact head
871b2076d571387474c251192356ca0df2a89027, using the newrewind-tracefixture. Ubuntu 24.04, Ryzen 9 9950X, GCC 13.3, Release.I reverted only the added
endTiming.Finish()to reproduce the main-parent production behavior (a700809679b1fef3d49cae4c00383ee85b9930be), kept the new test, rebuilt, then restored the exact source and rebuilt again. Nine fresh processes per condition:Driver.EndSubmissionsummary total per windowThe saved raw
Xevents explain the difference directly. Every reverted run has 12Driver.EndSubmissionslices on the same queue-worker trace thread, nested 12 deep. For one run they sum to 239.507 ms but their union is only 36.928 ms. Adding the other serialized top-level worker-busy scopes gives 276.365 ms of slices over that same 36.928 ms union.After restoration, the serialized worker-busy slices sum to their union in all nine runs (about 36.6–36.8 ms), with no overlap among them in this fixture. No long
Driver.EndSubmissionslice remains. The summary still accounts for its short 9–18 µs total: the trace intentionally folds individual slices below 20 µs, so absence from the raw events does not mean the timer disappeared. All 18 summaries reporttrace_dropped: false.This supports the full chain: the unfinished inclusive parent timer survives
executeRewindTail's recursiveexecute(tail), andTraceThread::accountadds every inclusive duration to the summary. The windows remain about 38 ms and the events use one worker thread, so neither a shrinking denominator nor multiple workers explains the overcount. The fixture reaches itsdoneassertion before the failing busy-share check in the reverted runs and still checks it after restoration, so the correction is not explained by tails ceasing to run.The restored
^agc_driver_pm4CTest scope passes 16/16. The checkout is clean at the stated head, and no experimental edits remain.Scope: this fixture does not initialize a Vulkan device (the summary GPU/driver fields are empty). The runs used three ICD environments, but they are repetitions of the same CPU test, not three-GPU validation. No title, FPS, GPU timing, validation-layer or Windows/macOS result is claimed, and the no-overlap observation is limited to this fixture's serialized busy scopes. Raw traces, summaries and the interval-audit script are retained.
Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-19T22:27:20Z.
Thanks @simonbbby. Nine runs each way with only the line reverted, plus the raw slices, is stronger evidence than my three, and the nesting depth of 12 for 12 tails shows the mechanism directly. Added to the description.
AI-assisted: yes (Claude Code)