GPU diagnostics: pick capture frames by draw count #500
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!500
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-500"
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?
@itsRevela on GitHub · 2026-11-24 04:12 UTC · original
diag/capture-on-draws→main· +101 −2 · 4 files · 1 commits · closed without mergingWhat
A new diagnostics variable,
VICTORY_CAPTURE_DRAWS=<draws>[,<frames>]. The first frame that records at leastdrawsdraws picks theframesframes after it (3 by default), exactly as if they were listed inVICTORY_CAPTURE_FRAMES. So withVICTORY_CAPTURE, their images are saved; withVICTORY_DUMP_TARGETS, their render targets too; and their draws are traced at debug level. The trigger fires once.list.rs: a per-frame draw counter next to the existing one, which is only read at power-of-two frames.queue.rs: at each present, the frame's count goes tocapture::frame_recorded.capture.rs:Trigger(parse and pick), plus the check inlisted.README.md: a row in the debugging table.All of it is behind
diagnostics.Why
The frame number where a scene starts is not stable between runs. With the opening cutscene (#255, #325), the first heavy frame moved from about 2,850 to about 3,330 to about 3,960 across runs of the same build. Loading time and a cold or warm shader cache shift it by hundreds of frames.
So a
VICTORY_CAPTURE_FRAMESlist taken from one run misses the scene in the next. That's worse with the cutscene's GPU hang, which leaves only a few heavy frames to catch. A draw-count threshold finds the scene wherever it starts.Tested
Windows 11 Pro 10.0.26200, NVIDIA GeForce RTX 3070 Ti (driver 32.0.16.1088) through Windows Sandbox's vGPU, Rust 1.98.1, on
d2a4bae.capture::tests::the_draw_trigger_reads_a_count_and_an_optional_lengthcovers parsing, including the rejected forms (0,1000,0, extra fields, text).capture::tests::the_draw_trigger_picks_the_frames_after_the_one_that_firedchecks that nothing is picked before the trigger fires, and that exactly the nextframesframes are picked after it.cargo test -p victory-gpu --features diagnostics --lib capturepasses (3 tests), andcargo test -p victory-gpu --libpasses (43 passed, 1 ignored).cargo clippy -p victory-gpu --tests, with and withoutdiagnostics: nothing in the changed files. The twounsafe block missing a safety commentwarnings (host.rs) are already onmain.cargo fmt -p victory-gpu --checkreports the same 79 diffs asmain(#17), and none in the new code.cargo xtask policyis ok.VICTORY_CAPTURE_DRAWS=1000,3:capture trigger: saving the frames after this one frame=3960 draws=16446 frames=3.AI-assisted (Claude Code). The title runs used my own copy; no game data is in this PR.
🤖 Generated with Claude Code
@ghost on GitHub · 2026-11-24 04:43 UTC · original
Tested
be6df3awith the title on an RX 9060 XT (RDNA4), Windows 11: works. Merged ontod2a4bae+ #135 + #365 (+ #318 #385 #346 #305); diag build.VICTORY_CAPTURE_DRAWS=1000,4withVICTORY_CAPTUREandVICTORY_DUMP_TARGETS=1:capture trigger: saving the frames after this one frame=2495 draws=16150 frames=4, then frames 2496–2499 were saved with 41, 252, 277 and 250 dumped targets.VICTORY_CAPTURE_FRAMESlists missed the world in two runs of the baseline (d2a4bae+ #135 + #365): its first world frame was about 1215 in one and after 1400 in the other; here it was 2495.AI-assisted (Claude Code, Claude Opus 5.5); no game data.
@Marvisak on GitHub · 2026-11-25 00:22 UTC · original
Automated triage for the maintainers.
Needs rebase. This PR does not merge cleanly into current
main(ac2525d). Conflicting files:crates/victory-gpu/src/capture.rs.The content has not been reviewed yet; it will be once the branch is rebased onto
main.Generated by Claude Code
Pull request closed