Keep the latest presentation intervals in a rolling capture window
Make capture default to a rolling last-120-presentation-interval window instead of stopping after the first 120. --frames controls window length; retain explicit first-N mode. Continue GPU instrumentation beyond the window, evict old intervals with late readback safety, preserve session/device metadata and warnings. Bound retained bytes/events and explain any reduced window. Publish periodic atomic snapshots so timed termination/crashes retain the latest checkpoint; normal shutdown saves final readbacks with clean End. Reuse current trace format/reader and viewer grouping, expose capture mode/window metadata, preserve existing uncommitted capacity/truncation fixes. Validate rolling eviction, delayed readbacks, multi-device frames, metadata, bounded behavior, checkpoint/shutdown, first-N mode and real Vulkan capture past 120 presentations or equivalent deterministic workload. Document checkpoint lag, memory and overhead. No commits. Implemented shared CaptureMode/CaptureOptions (rolling default, explicit --mode first); --frames controls per-device rolling window. Layer continues instrumentation in rolling mode with no lifetime frame/submission cutoff. Background worker stores serialized interval records, evicts expired intervals, accepts retained late readbacks, hides not-yet-presented next-interval work, retains lifetime metadata, and applies byte/event safety eviction with explicit warning. Atomic private 0600 snapshots about once/second plus final readbacks on shutdown preserve the latest checkpoint for timed termination. Optional session capture metadata is backward compatible; summary, Capture info and inspect expose mode/window. README documents memory/I/O, checkpoint lag and lifetime warning semantics. Verified: 70 workspace tests including 300-interval last-120 eviction, delayed/expired/pending readbacks, independent devices/headless, byte/event pressure, atomic replacement/private permissions, worker checkpoints/flush, first-mode boundary and CLI parsing. fmt/check/build and Clippy pass with only the pre-existing collapsible_match exception. Native Wayland/Vulkan self-viewer capture under synchronization validation: rolling 300-frame run retains 180–299 with all 120 GPU samples; first mode retains 0–119 (121 samples including startup); --frames 7 retains 293–299 with seven GPU samples. Four-second SIGTERM run using a compact source keeps a readable 120-interval checkpoint, 362–481 with 120 GPU samples, without End as expected. No trace warnings, dropped events on clean exits, reported validation errors or synchronization hazards. Evidence: /tmp/wayrender-rolling-viewer-3_yjbhov/*.wrtrace and *.log. Earlier vkcube tests verified presentation eviction but no GPU samples due to its unsupported SIMULTANEOUS_USE; vkgears crashed before producing a trace, so neither is counted as a successful GPU timing test. An initial timed test of the 439 MiB source ended before Vulkan initialization; compact-source timed validation passed. Final headless AMD GPU regression passed six submit2 executions with 6,002-operation upload regions plus ten repeated passes and full large draw inventory, no omissions/warnings/drops or reported validation hazards; /tmp/wayrender-rolling-headless-19pnppsl/workload.wrtrace and workload.log. Final formatting/check/whitespace validation passed. No live PRK game launch, authentication, or user installation edits; no full 8 GiB stress or power-loss durability test. Changes remain uncommitted alongside the earlier capacity fixes.
Checklist
2 of 2 complete- Implement rolling-window capture, first-N compatibility, bounded atomic checkpoints and discoverable mode/window metadata; document behavior.
- Verify window eviction, delayed GPU results, multiple devices, limits, checkpoint/shutdown, first-N behavior and real Vulkan rolling capture; run Rust validation.
- Area
- Personal tooling
- Project
- Wayrender
- Kind
- Feature
- Task ID
tsk_ypm74c6ea6- Updated