Repository navigation
feat(agc): configure trace event buffers - #5808
Conversation
6c8e4d7 to
1effd67
Compare
|
One overlap to coordinate before merge: open PR #5813 also adds |
|
@Ondra97 I opened #5813 for the same issue a few minutes after this, without having seen it. Since this one came first and is the capacity-only piece, I'll let it carry |
|
Thanks, I compared both patches. I propose landing #5808 as the capacity-only change first, then rebasing #5813 on it for the drop diagnostics. The 4,194,304-event limit accommodates the roughly 2.5 million events reported in #5786 while bounding the event buffer to 128 MiB per thread. Buffers are allocated before the capture window opens, and formatting requires additional memory, so I chose a conservative upper bound. Allowing small capacities also makes buffer exhaustion easy to reproduce in runtime checks. I kept shader-prepare buffers at their existing explicit size so increasing queue-worker capture capacity does not also increase allocations across shader workers. Extending that behavior and raising the maximum to 512 MiB per thread can be reviewed separately. This keeps the capacity change small and independently reviewable, while #5813 adds the complementary per-thread loss reporting and cutoff markers. @eliyarson, would this merge order work for you? AI-assisted: yes. — Codex |
|
Thanks @eliyarson, that works for me — our comments crossed. For shader-prepare sizing in #5813, please keep the parser unchanged and ensure the one-eighth share remains at least one event for accepted capacities below eight. AI-assisted: yes. — Codex |
…buffers filled The trace summary line keeps `trace_dropped` as before: true when any thread lost a slice, any thread's totals table was full, or the gpu track was full. When it is true, the line now also carries `trace_dropped_threads`, one entry per affected thread name, so the reader can tell which thread lost data and how much. Threads that share a name, such as the shader prepare threads, share one entry: losses are summed, the earliest fill is kept and totals_full is true if any is. Each entry has `events_full_after_s`, the seconds from the first present of the window to the start of the first lost slice. It is absent for `gpu` and in every summary line (windowed frames/seconds and APS5_TRACE_SUMMARY_EVERY) whenever the first lost slice starts outside the line's span of presents, including a slice whose scope began before the window opened or one lost after the last present. `events_lost` is the number of slices not recorded and is absent when 0; in interval lines it counts the buffer's losses since it started. `totals_full` is true when the thread's totals table overflowed, which makes the summary numbers incomplete; a thread with only `events_lost` has complete totals. The Chrome trace gets a `trace buffer full` instant event on a thread at the point where its buffer filled. BUILD.md documents the new fields and the event. `trace_dropped` is unchanged, and when nothing drops the default output is byte-identical to before. Refs boykopovar#5786 Depends on boykopovar#5808
|
Checked the build and the scoped ctest ( |
…buffers filled The trace summary line keeps `trace_dropped` as before: true when any thread lost a slice, any thread's totals table was full, or the gpu track was full. When it is true, the line now also carries `trace_dropped_threads`, one entry per affected thread name, so the reader can tell which thread lost data and how much. Threads that share a name, such as the shader prepare threads, share one entry: losses are summed, the earliest fill is kept and totals_full is true if any is. Each entry has `events_full_after_s`, the seconds from the first present of the window to the start of the first lost slice. It is absent for `gpu` and in every summary line (windowed frames/seconds and APS5_TRACE_SUMMARY_EVERY) whenever the first lost slice starts outside the line's span of presents, including a slice whose scope began before the window opened or one lost after the last present. `events_lost` is the number of slices not recorded and is absent when 0; in interval lines it counts the buffer's losses since it started. `totals_full` is true when the thread's totals table overflowed, which makes the summary numbers incomplete; a thread with only `events_lost` has complete totals. The Chrome trace gets a `trace buffer full` instant event on a thread at the point where its buffer filled. BUILD.md documents the new fields and the event. `trace_dropped` is unchanged, and when nothing drops the default output is byte-identical to before. Refs boykopovar#5786 Depends on boykopovar#5808
…buffers filled The trace summary line keeps `trace_dropped` as before: true when any thread lost a slice, any thread's totals table was full, or the gpu track was full. When it is true, the line now also carries `trace_dropped_threads`, one entry per affected thread name, so the reader can tell which thread lost data and how much. Threads that share a name, such as the shader prepare threads, share one entry: losses are summed, the earliest fill is kept and totals_full is true if any is. Each entry has `events_full_after_s`, the seconds from the first present of the window to the start of the first lost slice. It is absent for `gpu` and in every summary line (windowed frames/seconds and APS5_TRACE_SUMMARY_EVERY) whenever the first lost slice starts outside the line's span of presents, including a slice whose scope began before the window opened or one lost after the last present. `events_lost` is the number of slices not recorded and is absent when 0; in interval lines it counts the buffer's losses since it started. `totals_full` is true when the thread's totals table overflowed, which makes the summary numbers incomplete; a thread with only `events_lost` has complete totals. The Chrome trace gets a `trace buffer full` instant event on a thread at the point where its buffer filled. BUILD.md documents the new fields and the event. `trace_dropped` is unchanged, and when nothing drops the default output is byte-identical to before. Refs boykopovar#5786 Depends on boykopovar#5808
What
#5786 reports that Hades II's queue-worker trace buffer fills about 3.3 seconds into a 30-second window, leaving most worker slices out of the trace. Add
APS5_TRACE_EVENTS=<count>to size the queue-worker and presenter buffers from 1 through 4,194,304 events. The default remains 262,144; invalid values throw before the thread binds. Document the memory cost and add capacity and validation regressions.Shader preparation retains its explicitly sized buffers, the GPU range limit stays unchanged, and summary-only sessions allocate no event buffers. This addresses the configurable-capacity part of #5786; per-thread drop reasons and cutoff markers remain open.
Tested
Windows 11 Pro 10.0.26300, WinLibs MinGW-w64 GCC 15.2.0, Release, bundled dependencies. Full build passed after rebase on
344afad05. Four focused CTest cases passed in 1.34 s:agc_performance_trace,agc_profile_output,agc_driver_draw_cache_reuse, andagc_driver_prepared_graphics. GPU tests required Vulkan. Conventions and whitespace checks passed.The capacity regression retains 262,145 slices, bounds the next append, and preserves totals past the limit. Parser tests cover the unchanged default, minimum, maximum, larger values, malformed values, and integer overflow.
Visible VLC v0.4 homebrew runs (PPSA85300, public release), with a
5:5seconds window. Counts were read from the resulting compressed trace files:trace_dropped23be5a02b0751effd67b7012Every run used
APS5_NO_DRAW_SRT_ENTRIES=1to isolate tracing from the VLC draw-cache issue addressed by #5791. The executable was relinked locally, runtime libraries were copied and SHA-256 verified, and runs were intentionally stopped after 20 s. The changed 16-event capture usedaa84bef8b43d; the trace implementation and capacity tests are identical in the final head. The larger-buffer capture carriescommit=1effd67b7012anddirty=false, from the final host build. Hades II, Linux, and other GPUs were not run; no speed improvement is claimed.Before starting, checked current open-PR heads and shared implementations. Refreshed 449 open PR file lists before publication; #5046 and #5047 add batch IDs to traces and #5238 documents shader-address tracing, with no implementation of configurable event capacity.
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)