Repository navigation
feat(agc): time the queue worker's waits for the draw finisher - #21208
Conversation
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — looks good
Nothing blocks this change; the drain timers are scoped around both waits and appear in the trace phase totals. The new scope is not included in worker busy percentage or frame worker-accounted time.
What I ran
- Reviewed head
8aa6fac586fe391eaaa3bf5cd2485f6b76c66d5f; no tests or build commands were run. - Read
description.md,commits.md,manifest.json,diff.patch, the changedPacketExecution.cppranges, and relevantPerformanceTimer.hppandPerformanceTrace.hppranges. No changed files were excluded by the manifest.
Results
| Check | Result | Note |
|---|---|---|
| Diff and targeted source review | passed | Both drains are timed |
| Build and tests | not run | Author-reported checks were not rerun |
Findings
Blocking
None.
Non-blocking
- The description says the change makes worker waits distinguishable from idle time, but
Driver.FinisherDrainis not included inTraceFormat::WorkerBusyScopesor theFrameTiming::Captureworker-accounted scope list. As a result, the new metric appears in phase totals but the corresponding time still contributes to idle/unattributed worker time and is excluded fromworker_busy_pct. Consider adding the scope to those lists if the intent is to account for these waits as worker busy time.
Not verified
- Build, tests, GPU behavior, and author-reported results were not independently verified.
To get this to a good state
Nothing is required. Optional: include Driver.FinisherDrain in worker busy and accounted time if those metrics should include the drains.
|
Windows NVIDIA check of head Setup: Windows 11 Home 10.0.26300, i9-13900K, WinLibs GCC 15.2.0, Release, RTX 4080 (
The one test not run on both sides is Not checked: AMD, Linux, macOS, any commercial title. AI-assisted: yes |
|
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.
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.
|
|
Thanks, done in c035f8b: |
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — looks good
Nothing blocks this change; the new finisher drain scope is included in the trace summary and frame accounting as described.
What I ran
Reviewed head c035f8be5c517442997bf2a3da8a88cfdecc2b60. No commands or tests were run. Read all six changed files listed in the manifest: PerformanceTimer.hpp, PerformanceTrace.hpp, PacketExecution.cpp, PerformanceTrace.cpp, BUILD.md, and USAGE.md.
Results
| Check | Result | Note |
|---|---|---|
| Changed code review | passed | Scope placement and accounting are consistent |
| Tests | not run | Author reports test results; not independently verified |
| Hardware and replay claims | not run | Not independently verified |
Findings
Blocking
None.
Non-blocking
None.
Not verified
The author-reported GPU tests, Hades II replay, conventions check, and pull request overlap check were not run or independently verified. No files were excluded from the changed-file review.
To get this to a good state
Nothing is required.
|
Validation-layer run of this PR on an NVIDIA GPU under Linux, since CI covers only lavapipe. Setup: Arch Linux (kernel 7.3.4), GCC 16.2.1, Release,
The pattern covers the nine executables from the Tested section with all their No new AI-assisted: yes (Claude Code) |
|
Tested head Setup: Windows 11 Pro 10.0.26200, Ryzen 7 9800X3D, WinLibs GCC 15.2.0 r7, Release,
Whole batch: the full This is one combined tree, not a run of this PR alone. AI-assisted: yes (Claude Code) |
The queue worker drains the draw finisher at the packet gate, before a packet that cannot run beside it, and at the end of every queue-0 submission. Both waits sit outside Driver.Packet and Driver.EndSubmission, so worker_busy_pct and the phase totals did not show them. They are now timed as Driver.FinisherDrain, which the trace summary lists with the other phases. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GtFtGr39oKL1zCtAwH7vGx
Driver.FinisherDrain was listed with the phases, but worker_busy_pct and the frame timing's worker_accounted_ms left it out, so a worker blocked on the draw finisher still looked idle. It now counts with the other worker scopes, and BUILD.md and USAGE.md list it. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01GtFtGr39oKL1zCtAwH7vGx
c035f8b to
937ac09
Compare
MarcZX10
left a comment
There was a problem hiding this comment.
Reviewed — looks good
Nothing blocks this change; the reviewed accounting and instrumentation changes are consistent with the stated goal.
What I ran
Reviewed head 937ac0945308b0c5fbfa1de3f815b3d0cb506a2c using repo_read.py to inspect the prepared diff and changed files. No build or tests were run; test results in the PR description are author-reported.
Results
| Check | Result | Note |
|---|---|---|
| Changed code review | passed | Six changed files read |
| Tests and build | not run | PR description reports runs |
| Repository prechecks | not run | Not executed in this review |
Findings
Blocking
None.
Non-blocking
None.
Not verified
No runtime, build, or test behavior was independently verified. The PR description's reported GPU, accounting, replay, and convention checks were not rerun. No files were excluded: all six changed files listed in the manifest were read.
To get this to a good state
Nothing is required.
What
With
APS5_DRAW_PIPELINEset, the queue worker waits for the draw finisher to drain in two places:Both waits sit outside the
Driver.PacketandDriver.EndSubmissionscopes. So neitherworker_busy_pctnor the phase totals showed them, and a trace could not tell a worker that waits for the finisher from one that is idle.Both waits are now timed as
Driver.FinisherDrain. The trace summary lists it with the other phases, andworker_busy_pct(also the overlay'sBUSY %) and the frame timing'sworker_accounted_mscount it with the other worker scopes;BUILD.mdandUSAGE.mdlist it. Nothing else changes: the drains run as before.Tested
Windows 10 22H2 (19045), RTX 4060 (NVIDIA 621.14), Ryzen 5 5600, MSYS2 UCRT64 GCC 16.2.0, Release.
Tested as
918d91426a, this change onmaindf18ede1f2. The branch is the same commit rebased onto a newermain.GPU tests, on
mainand on this change, withANYPS5_REQUIRE_VULKAN=1 ANYPS5_NO_SHADER_CACHE=1 VK_INSTANCE_LAYERS=VK_LAYER_KHRONOS_validation VK_LOADER_DEBUG=layer(layer 1.4.363). They cover the 15 tests of nine executables:agc_driver_gated_dispatch_capture_testsagc_driver_pipelined_dispatch_testsagc_driver_pipelined_sample_dump_testsagc_driver_draw_recapture_on_change_testsagc_driver_copied_writer_label_order_testsagc_driver_batch_cap_testsagc_driver_dword_pattern_fill_testsagc_driver_linear_target_completion_points_testsagc_driver_write_data_written_ahead_testsBoth builds: 15 of 15 pass, the loader inserts the layer, and there are 0
VUID-lines.Busy accounting,
c035f8be5c:agc_performance_tracenow checks that 4 ms ofDriver.FinisherDrainraises a worker's busy share from 35 to 45 % of a 40 ms window.agc_performance_trace,agc_performance_overlay_statistics,agc_performance_overlay(3 tests) andagc_driver_pm4_rewind_tracepass, 6 of 6, with the validation layer inserted and 0VUID-lines.Hades II (PPSA36082): one replay of a recorded controller session with
APS5_DRAW_PIPELINE=1 APS5_PIPELINE_DISPATCH=1, so the draw finisher is on.Driver.FinisherDrainat 0.14 to 0.16 ms, next toDriver.DrawFinishat 6.3 s.mainthe worker rarely waits for the finisher, and the new scope makes that measurable.tools/check_conventions.py --base origin/mainpasses.tools/pr_overlap.py --branchfails closed: 7 open pull requests that conflict withmainalso changePacketExecution.cpp. I checked their diffs, and none of them changes these finisher drains orDriver.EndSubmission.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)