feat(agc): report which trace threads dropped events and where their buffers filled #5813
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/5813"
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 eliyarson on 2026-10-14T11:57:10Z.
What
Refs #5786. Depends on #5808, which adds
APS5_TRACE_EVENTS; this branch is #5808's commit plus one commit, and only the second is new here.trace_droppedsays that a trace lost data, but not which thread, from when, or whether the summary numbers are affected. When it is true, the summary line now also carriestrace_dropped_threads, one entry per affected thread name:events_full_after_s: seconds from the window's first present to the start of the first lost slice. Absent forgpu, and absent whenever that slice starts outside the line's span of presents.events_lost: slices not recorded (absent when 0). InAPS5_TRACE_SUMMARY_EVERYlines it counts the buffer's losses since it started.totals_full: the thread's totals table overflowed, so the summary numbers are incomplete. A thread with onlyevents_losthas complete totals.Threads that share a name, such as the shader prepare threads, share one entry: losses are summed, the earliest fill is kept, and
totals_fullis true if any of them is.The Chrome trace gets a
trace buffer fullinstant event on the thread where its buffer filled.trace_droppedis set on the same conditions as before, and when nothing drops the output is byte-identical. #5808's parser, bounds and buffer sizes are unchanged; sizing the shader prepare buffers fromAPS5_TRACE_EVENTSis left for a follow-up after #5808 lands.Overlap: #5046 edits the same lines of
PerformanceTrace.hpp; whichever lands second needs a rebase. #4969 and #5453 also touchdocs/dev/BUILD.md, different sections.Tested
Linux x86-64 (CachyOS, kernel 7.2.2), RTX 3080 Ti, NVIDIA 610.57.04.
agc_performance_trace(new cases: per-thread entries, same-named threads merged, the interval-line bounds ofevents_full_after_s, lost-event counts, totals overflow, the buffer-full event),ctest -R '^agc_|trace'on #5808's head1effd67b7plus this commit (518 tests, all pass exceptagc_driver_stencil_ref_export, skipped as onmain),tools/check_conventions.py.Hades II, title screen,
APS5_TRACE_SECONDS=150:30, on the earlier revision of this PR (its own capacity setting instead of #5808's; the drop reporting is the same apart from the merge by name):"trace_dropped":true,"trace_dropped_threads":{"queue worker 0x0":{"events_full_after_s":27.47,"events_lost":24059,"totals_full":false}}, and thetrace buffer fullmarker sits at that point of the queue-0 track.APS5_TRACE_EVENTS=4194304:"trace_dropped":false, notrace_dropped_threads, queue-0 track recorded to the end of the window (293,343 slices).The title screen fills the buffer late; in the hub (#5786) the default buffer fills after about 3.3 s.
Not tested: Windows, other GPUs; no game run on the rebased branch.
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 MarcZX10 on 2026-10-14T13:12:59Z.
I found an overlapping open PR: #5808 also adds
APS5_TRACE_EVENTStoPerformanceTrace.hpp, but sets a different max and does not size the shader-prepare buffer. Your PR includes both the capacity setting and the drop diagnostics. Please coordinate with Ondra97 on which branch should carry the common capacity/parser behavior, and declare a dependency or rebase the second branch as appropriate.Imported from boykopovar/AnyPS5. Originally posted by eliyarson on 2026-10-14T13:22:07Z.
Thanks @MarcZX100. I've agreed with #5808 that it carries
APS5_TRACE_EVENTS; I'm rebasing this PR on top of it so it only adds the per-thread drop details and marker, and will mark itDepends on #5808once pushed.Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-14T14:15:59Z.
Checked on current
main: the only conflict was adjacency intests/PerformanceTrace.cpp(BatchIdsfrom #5046 next toFullBufferEvents); I kept both and rebased ontomain(this branch still carries #5808's commit, so it lands after #5808).agc_performance_tracepasses on the rebased tree, the new cases fail to build without the change, andlost/firstLostare published safely (first loss time stored before the release store of the count). TheBUILD.mdtext matches the code. Merging once #5808 is in and the full Build is green.Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-14T16:58:55Z.
#5808 is merged, and this branch conflicted with
mainagain; I rebased it, which dropped #5808's commit and left only this one.agc_performance_tracepasses on the rebased tree, the new cases fail to build without the change, andlost/firstLostare published safely (first loss time stored before the release store of the count). TheBUILD.mdtext matches the code. Merging once the full Build is green.