feat(agc): configure trace event buffers #5808
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/5808"
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 Ondra97 on 2026-10-14T11:50:55Z.
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)Imported from boykopovar/AnyPS5. Originally posted by MarcZX10 on 2026-10-14T13:12:57Z.
One overlap to coordinate before merge: open PR #5813 also adds
APS5_TRACE_EVENTSinPerformanceTrace.hpp, with a different accepted range and shader-prepare sizing, alongside the per-thread drop reporting. This PR is the capacity-only piece; #5813 includes that same setting while completing the diagnostics requested in #5786. Please compare with Eli and agree which PR carries the shared parser/capacity behavior; the second branch will need a rebase or an explicit dependency.Imported from boykopovar/AnyPS5. Originally posted by eliyarson on 2026-10-14T13:22:05Z.
@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
APS5_TRACE_EVENTS: I'm rebasing #5813 on top of this branch, dropping my parser, bounds and capacity tests, and marking itDepends on #5808. #5813 will then only add the per-thread drop details (trace_dropped_threads, thetrace buffer fullmarker) and, if it fits your parser without changes, the shader-prepare buffer following the setting at an eighth. Thanks @MarcZX100 for spotting it.Imported from boykopovar/AnyPS5. Originally posted by Ondra97 on 2026-10-14T13:23:01Z.
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
Imported from boykopovar/AnyPS5. Originally posted by Ondra97 on 2026-10-14T13:27:39Z.
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
Imported from boykopovar/AnyPS5. Originally posted by eliyarson on 2026-10-14T13:36:43Z.
@Ondra97 Thanks. I took the shader-prepare sizing out of #5813 for now: it is #5808 plus one commit with only the drop details, and your parser and sizes are untouched. I'll propose the eighth share, kept at no less than one event, in a separate PR once #5808 is in.
Imported from boykopovar/AnyPS5. Originally posted by adriadam10 on 2026-10-14T13:41:14Z.
Checked the build and the scoped ctest (
agc_performance_tracepasses; the newCapacitySettingscase fails to build without the change), the parser edge cases (empty, 0, signs, spaces, max+1, overflow) and the docs against the code;shader preparekeeps its 32,768-event buffers. Merging once the full Build is green.