GPU diagnostics: end draw traces at every present #2666
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!2666
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2666"
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?
@andrewpozdnakov7-jpg on GitHub · 2026-11-25 17:46 UTC · original
andrewpozdnakov7-jpg:codex1/present-trace-boundary→main· +55 −3 · 1 files · 2 commits · openRefs #954
PresentX advances the frame even when there is no displayable plane. The black-frame draw trace was drained only when the host could present an image, so draws from a skipped present could appear in the next black-frame report. Drain at the PresentX frame boundary and pass that frame's trace to the diagnostic reporter when there is an image.
The same Windows/WARP test records a distinct draw trace and calls PresentX with zero planes. On
13f91ca, that draw is still in the pending trace. On251acde, the new frame starts with no trace from that draw. Six alternating runs confirmed the difference in both D3D12 debug flag settings.The serial GPU suite passed with 199 passed and one ignored in both settings. Strict GPU Clippy in both modes and repository policy passed. The change merges cleanly with the offered #1254 rebase, which controls which draws a frame keeps. AI-assisted. Synthetic tests only.
Coordination claim
Please preserve the Git author when reapplying the change. If you fold the code or test into another commit, please add this trailer.
Co-authored-by: andrewpozdnakov7-jpg [email protected]
@kotekompotek on GitHub · 2026-11-25 17:55 UTC · original
Reviewed: taking the draw trace before the texture branch means presents without a shown plane still drain it — otherwise ops accumulate across frames and the trace misattributes draws. Test uses a real Subscriber. Diagnostics-only. CI green.
@oni-swr on GitHub · 2026-11-25 18:13 UTC · original
Independent verification of head
251acde3dff97ab07a99b1875c0bbb450c088e73onorigin/main13f91caee25f2fdf2c062be5f7a27f058e51cbca(merges cleanly, fast-forward).Environment: Windows 11 Pro 10.0.26100, WARP (d3d10warp 10.0.26100.9818) only, rustc/cargo 1.98.1 (per rust-toolchain.toml), DXC 1.8.2502.11 / dxil.dll 1.8.2502.11 (Windows SDK 10.0.26100.0 x64).
VICTORY_WARP=1andVICTORY_D3D12_WARP=1set for every run;victory-gputests were only run with--features diagnostics(without it the crate opens the default adapter). Limits: no physical GPU, no game files, no title-driven runs; this says nothing about behaviour on real hardware.... -p victory-gpu --features diagnostics present_without_a_plane->queue::tests::present_without_a_plane_drains_the_draw_trace1 passed.origin/mainbaseline (cargo test -j 4 --locked -p victory-gpu --features diagnostics): 197 passed, 1 failed (memory::tests::a_submission_that_missed_leaves_the_copies_at_once,memory.rs:886), 1 ignored. That test passed in all four PR runs, so it looks flaky; I did not investigate it, and none of these PRs touchmemory.rs.queue.rs(kept the test) -> the test fails:previous frame's draw leaked: ["draw 3 from 7001 ... DROPPED"].take_frame()now runs once per present before the early returns, and the result is passed toblinks. No bugs found. The test is cfg'dwindows+diagnostics, so default-feature runs skip it.AI disclosure: independent verification by Claude Code / Claude Sonnet 5.5, run for a user; no game files, dumps or hashes involved.
@fuzeofficlal on GitHub · 2026-11-25 19:05 UTC · original
Independent Windows 11 + NVIDIA GeForce RTX 5090 + WARP verification and review of
251acde3(on13f91ca):Verification (
rustc 1.98.1MSVC)cargo clippy --locked -p victory-gpu --all-targets -- -D warningsand--features diagnostics: 0 warnings.cargo test --locked -p victory-gpu --features diagnostics --lib queue: 10 passed, 0 failed (includingpresent_without_a_plane_drains_the_draw_trace).VICTORY_D3D12_WARP=1):cargo test --locked -p victory-gpu --features diagnostics --lib -- --test-threads=1: 199 passed, 0 failed, 1 ignored.Review Notes
crate::draw::take_frame()unconditionally inpresentbefore advancing the frame ensures empty/no-plane frames do not carry draw traces over into a later black frame; zero heap allocation on empty frames and completely compiled out whendiagnosticsis disabled. Clean and ready to merge.@Marvisak on GitHub · 2026-11-25 22:16 UTC · original · edited 2026-11-26 00:24 UTC
Automated triage for the maintainers.
Recommended for a maintainer's look. In
present(crates/victory-gpu/src/queue.rs), the diagnostics draw trace (draw::take_frame) is now drained at every PresentX, before the planes are handled, and passed toblinks. Before, it was drained only insideblinks, which a present with no displayable plane never reaches, so its draws were reported against the next frame. The rebase keeps the multi-plane present code intact. The new testpresent_without_a_plane_drains_the_draw_traceis diagnostics-only. It merges cleanly and CIcheckis passing.On your reply: confirmed. The resolution only moves the
take_framecall ahead of the plane loop and adds the parameter toblinks.Generated by Claude Code
@andrewpozdnakov7-jpg on GitHub · 2026-11-25 22:46 UTC · original
I resolved the conflict with the multi-plane PresentX code in 13a2b92. The draw trace is consumed before handling the planes, and the compositor's selected resources and state restoration are preserved.
The same fixture on
f3578e3leaves the previous frame's draw in the trace after a zero-plane present. The relevant sources are identical on219878a. The update consumes that draw at the frame boundary. The compositor and full GPU suite pass on Windows/WARP, with 245 passed and one ignored in each D3D12 debug setting. Strict GPU Clippy and asset policy passed.Please retain the Git author when moving the patch or test. If folded into another commit, please add this trailer.
Co-authored-by: andrewpozdnakov7-jpg [email protected]
@Dukestar69 on GitHub · 2026-11-26 04:51 UTC · original · approved these changes
Tested merged onto
origin/main(63bcca4) on Windows 11 x64 (NVIDIA GeForce RTX 5090):cargo test -p victory-gpu --features diagnostics --lib queue::tests: 6 passed, 0 failed (including newpresent_without_a_plane_drains_the_draw_trace).cargo clippy -p victory-gpu --all-targets -- -D warnings: clean.cargo clippy -p victory-gpu --all-targets --features diagnostics -- -D warnings: clean.cargo xtask policy: 191 files ok.Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).
@fuzeofficlal on GitHub · 2026-11-26 14:53 UTC · original · approved these changes
Reviewed
crates/victory-gpu/src/queue.rsat13a2b928merged ontoorigin/main(63bcca43) and verified on RTX 5090 and WARP (VICTORY_D3D12_WARP=1) withVICTORY_D3D12_DEBUG=1.let draw_trace = crate::draw::take_frame();(queue.rs:495) is strictly under#[cfg(all(windows, feature = "diagnostics"))]right afterpump_held(Why::Present)and before frame-counter updates or early no-plane returns, passingdraw_traceintoblinks(...)(queue.rs:580,queue.rs:592) when a plane is presented and dropping it otherwise so no-plane presents cannot leak prior draws into a subsequent black-frame report.PresentXonorigin/mainwith no lock-order changes (draw::take_frame()only takes its ownFRAME_DRAWSlock).cargo run -p xtask -- policy: 191 files ok.cargo clippy -p victory-gpu --all-targets -- -D warnings(default and--all-features): clean.cargo test -p victory-gpu --lib --features diagnostics queue::: 6/6 passed on RTX 5090 + Debug Layer and 6/6 passed on WARP + Debug Layer (including the newpresent_without_a_plane_drains_the_draw_traceatqueue.rs:763).View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.