trace: Driver.EndSubmission nests through the rewind tail, so worker_busy_pct counts time many times #8092

Closed
opened 2026-10-19 21:15:24 +00:00 by CPritch · 1 comment
CPritch commented 2026-10-19 21:15:24 +00:00 (Migrated from github.com)
Contributor

Imported from boykopovar/AnyPS5. Originally posted by CPritch on 2026-10-19T21:15:24Z.


On the pipelined path, Driver::execute keeps its Driver.EndSubmission timer open while it runs the rewind tail (PacketExecution.cpp:468, 480). executeRewindTail ends in execute(tail) (Submission.cpp:322), which runs the tail's packets and opens the next Driver.EndSubmission inside the first. TraceThread's account adds each slice's whole length to its scope's total (PerformanceTrace.hpp:247), and the summary adds the totals of Driver.Packet, Driver.Suspend, Driver.EndSubmission, Driver.Rewind and Driver.Completion into worker_busy_pct (PerformanceTrace.hpp:466). A chain of n tails is counted n times under Driver.EndSubmission, and its packets once more under Driver.Packet. The non-pipelined path finishes the timer before it runs the tail (PacketExecution.cpp:499-500). Line numbers are at main bf2c63f85.

Seen on GTA V (PPSA04263 01.010.002), Linux, RTX 5060 Laptop GPU, NVIDIA 615.71.09, main 544f29106, APS5_TRACE_FRAMES=3700:1400 (118 s): worker_busy_pct "queue worker 0x0" 3740.454, and top_phases_ms_per_frame Driver.EndSubmission 3079.377 at a frame p50 of 82.1 ms. A second capture (APS5_TRACE_FRAMES=3500:700, APS5_TRACE_EVENTS=4194304, nothing dropped) gives 3726.552 and 3045.4 at a p50 of 81.2 ms.

In the trace of queue worker 0x0 (the first 5.68 s of the first capture, before its buffer filled), 4,830 Driver.EndSubmission slices add up to 207.6 s. 4,761 of them lie inside another one, none crosses another's end, and they nest up to 70 deep; their union is 5.66 s. 207.6 / 5.68 = 36.5, the ratio of 3,079 ms to the 84 ms frame.

Not checked: other titles, and whether other scopes nest the same way.

AI-assisted: yes

<!-- greyfinch-sync:boykopovar/AnyPS5:issue:5931691721 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/8092). Originally posted by [CPritch](https://github.com/CPritch) on 2026-10-19T21:15:24Z. --- On the pipelined path, Driver::execute keeps its Driver.EndSubmission timer open while it runs the rewind tail (PacketExecution.cpp:468, 480). executeRewindTail ends in execute(tail) (Submission.cpp:322), which runs the tail's packets and opens the next Driver.EndSubmission inside the first. TraceThread's account adds each slice's whole length to its scope's total (PerformanceTrace.hpp:247), and the summary adds the totals of Driver.Packet, Driver.Suspend, Driver.EndSubmission, Driver.Rewind and Driver.Completion into worker_busy_pct (PerformanceTrace.hpp:466). A chain of n tails is counted n times under Driver.EndSubmission, and its packets once more under Driver.Packet. The non-pipelined path finishes the timer before it runs the tail (PacketExecution.cpp:499-500). Line numbers are at main bf2c63f85. Seen on GTA V (PPSA04263 01.010.002), Linux, RTX 5060 Laptop GPU, NVIDIA 615.71.09, main 544f29106, APS5_TRACE_FRAMES=3700:1400 (118 s): worker_busy_pct "queue worker 0x0" 3740.454, and top_phases_ms_per_frame Driver.EndSubmission 3079.377 at a frame p50 of 82.1 ms. A second capture (APS5_TRACE_FRAMES=3500:700, APS5_TRACE_EVENTS=4194304, nothing dropped) gives 3726.552 and 3045.4 at a p50 of 81.2 ms. In the trace of queue worker 0x0 (the first 5.68 s of the first capture, before its buffer filled), 4,830 Driver.EndSubmission slices add up to 207.6 s. 4,761 of them lie inside another one, none crosses another's end, and they nest up to 70 deep; their union is 5.66 s. 207.6 / 5.68 = 36.5, the ratio of 3,079 ms to the 84 ms frame. Not checked: other titles, and whether other scopes nest the same way. AI-assisted: yes
milescoviello commented 2026-10-19 22:00:56 +00:00 (Migrated from github.com)
Author
Contributor

Imported from boykopovar/AnyPS5. Originally posted by milescoviello on 2026-10-19T22:00:56Z.


@CPritch thanks, your trace analysis pointed straight at it. #8108 finishes the Driver.EndSubmission timer before the pipelined branch runs the released tail, as the non-pipelined path already does. Its test runs one trace window over 12 released REWIND tails. Queue worker 0x0's worker_busy_pct comes out at 677-704% without the change and 91-94% with it.

AI-assisted: yes (Claude Code)

<!-- greyfinch-sync:boykopovar/AnyPS5:comment:6278341457 --> Imported from [boykopovar/AnyPS5](https://github.com/boykopovar/AnyPS5/issues/8092#issuecomment-6278341457). Originally posted by [milescoviello](https://github.com/milescoviello) on 2026-10-19T22:00:56Z. --- @CPritch thanks, your trace analysis pointed straight at it. #8108 finishes the `Driver.EndSubmission` timer before the pipelined branch runs the released tail, as the non-pipelined path already does. Its test runs one trace window over 12 released REWIND tails. Queue worker 0x0's `worker_busy_pct` comes out at 677-704% without the change and 91-94% with it. AI-assisted: yes (Claude Code)
Sign in to join this conversation.
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
boykopovar/AnyPS5#8092
No description provided.