GPU diagnostics: end draw traces at every present #2666

Open
github-bot wants to merge 2 commits from github-bot/gh-2666 into main AGit
Owner

@⁠andrewpozdnakov7-jpg on GitHub · 2026-11-25 17:46 UTC · original
andrewpozdnakov7-jpg:codex1/present-trace-boundary → main · +55 −3 · 1 files · 2 commits · open

Refs #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. On 251acde, 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]

**@⁠andrewpozdnakov7-jpg** on GitHub · 2026-11-25 17:46 UTC · [original](https://github.com/Marvisak/VIctory/pull/2666) `andrewpozdnakov7-jpg:codex1/present-trace-boundary` → `main` · +55 −3 · 1 files · 2 commits · open Refs #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. On 251acde, 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](https://git.gtahub.st/github/Marvisak--VIctory/issues/1633) 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]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:11:34 +00:00
Author
Owner

@⁠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.

**@⁠kotekompotek** on GitHub · 2026-11-25 17:55 UTC · [original](https://github.com/Marvisak/VIctory/pull/2666#issuecomment-7170200271) 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.
Author
Owner

@⁠oni-swr on GitHub · 2026-11-25 18:13 UTC · original

Independent verification of head 251acde3dff97ab07a99b1875c0bbb450c088e73 on origin/main 13f91caee25f2fdf2c062be5f7a27f058e51cbca (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=1 and VICTORY_D3D12_WARP=1 set for every run; victory-gpu tests 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.

  • Focused: ... -p victory-gpu --features diagnostics present_without_a_plane -> queue::tests::present_without_a_plane_drains_the_draw_trace 1 passed.
  • Full crate: 199 passed, 0 failed, 1 ignored. origin/main baseline (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 touch memory.rs.
  • clippy (same four invocations): clean.
  • Negative control: reversed only the three production hunks of queue.rs (kept the test) -> the test fails: previous frame's draw leaked: ["draw 3 from 7001 ... DROPPED"].
  • Code read: take_frame() now runs once per present before the early returns, and the result is passed to blinks. No bugs found. The test is cfg'd windows + 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.

**@⁠oni-swr** on GitHub · 2026-11-25 18:13 UTC · [original](https://github.com/Marvisak/VIctory/pull/2666#issuecomment-7170613165) **Independent verification of head `251acde3dff97ab07a99b1875c0bbb450c088e73`** on `origin/main` `13f91caee25f2fdf2c062be5f7a27f058e51cbca` (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=1` and `VICTORY_D3D12_WARP=1` set for every run; `victory-gpu` tests 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. - Focused: `... -p victory-gpu --features diagnostics present_without_a_plane` -> `queue::tests::present_without_a_plane_drains_the_draw_trace` 1 passed. - Full crate: 199 passed, 0 failed, 1 ignored. `origin/main` baseline (`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 touch `memory.rs`. - clippy (same four invocations): clean. - **Negative control:** reversed only the three production hunks of `queue.rs` (kept the test) -> the test fails: `previous frame's draw leaked: ["draw 3 from 7001 ... DROPPED"]`. - Code read: `take_frame()` now runs once per present before the early returns, and the result is passed to `blinks`. No bugs found. The test is cfg'd `windows` + `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.
Author
Owner

@⁠fuzeofficlal on GitHub · 2026-11-25 19:05 UTC · original

Independent Windows 11 + NVIDIA GeForce RTX 5090 + WARP verification and review of 251acde3 (on 13f91ca):

Verification (rustc 1.98.1 MSVC)

  • cargo clippy --locked -p victory-gpu --all-targets -- -D warnings and --features diagnostics: 0 warnings.
  • RTX 5090: cargo test --locked -p victory-gpu --features diagnostics --lib queue: 10 passed, 0 failed (including present_without_a_plane_drains_the_draw_trace).
  • WARP (VICTORY_D3D12_WARP=1): cargo test --locked -p victory-gpu --features diagnostics --lib -- --test-threads=1: 199 passed, 0 failed, 1 ignored.

Review Notes

  • Draining crate::draw::take_frame() unconditionally in present before 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 when diagnostics is disabled. Clean and ready to merge.
**@⁠fuzeofficlal** on GitHub · 2026-11-25 19:05 UTC · [original](https://github.com/Marvisak/VIctory/pull/2666#issuecomment-7171815167) Independent Windows 11 + NVIDIA GeForce RTX 5090 + WARP verification and review of `251acde3` (on `13f91ca`): ### Verification (`rustc 1.98.1` MSVC) - `cargo clippy --locked -p victory-gpu --all-targets -- -D warnings` and `--features diagnostics`: **0 warnings**. - **RTX 5090:** `cargo test --locked -p victory-gpu --features diagnostics --lib queue`: **10 passed, 0 failed** (including `present_without_a_plane_drains_the_draw_trace`). - **WARP (`VICTORY_D3D12_WARP=1`):** `cargo test --locked -p victory-gpu --features diagnostics --lib -- --test-threads=1`: **199 passed, 0 failed, 1 ignored**. ### Review Notes - Draining `crate::draw::take_frame()` unconditionally in `present` before 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 when `diagnostics` is disabled. Clean and ready to merge.
Author
Owner

@⁠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 to blinks. Before, it was drained only inside blinks, 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 test present_without_a_plane_drains_the_draw_trace is diagnostics-only. It merges cleanly and CI check is passing.

On your reply: confirmed. The resolution only moves the take_frame call ahead of the plane loop and adds the parameter to blinks.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 22:16 UTC · [original](https://github.com/Marvisak/VIctory/pull/2666#issuecomment-7176150557) · edited 2026-11-26 00:24 UTC <!-- victory-triage v1 head=13a2b928fcbbab3ab74644e15b334f88f4cd0723 verdict=merge-candidate at=2026-11-26T00:24:54Z --> 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 to `blinks`. Before, it was drained only inside `blinks`, 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 test `present_without_a_plane_drains_the_draw_trace` is diagnostics-only. It merges cleanly and CI `check` is passing. On your reply: confirmed. The resolution only moves the `take_frame` call ahead of the plane loop and adds the parameter to `blinks`. --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠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 f3578e3 leaves the previous frame's draw in the trace after a zero-plane present. The relevant sources are identical on 219878a. 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]

**@⁠andrewpozdnakov7-jpg** on GitHub · 2026-11-25 22:46 UTC · [original](https://github.com/Marvisak/VIctory/pull/2666#issuecomment-7176772319) I resolved the conflict with the multi-plane PresentX code in [13a2b92](https://github.com/andrewpozdnakov7-jpg/VIctory/commit/13a2b928fcbbab3ab74644e15b334f88f4cd0723). The draw trace is consumed before handling the planes, and the compositor's selected resources and state restoration are preserved. The same fixture on `f3578e3` leaves the previous frame's draw in the trace after a zero-plane present. The relevant sources are identical on `219878a`. 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]>
Author
Owner

@⁠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 new present_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).

**@⁠Dukestar69** on GitHub · 2026-11-26 04:51 UTC · [original](https://github.com/Marvisak/VIctory/pull/2666#pullrequestreview-6068719480) · **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 new `present_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).
Author
Owner

@⁠fuzeofficlal on GitHub · 2026-11-26 14:53 UTC · original · approved these changes

Reviewed crates/victory-gpu/src/queue.rs at 13a2b928 merged onto origin/main (63bcca43) and verified on RTX 5090 and WARP (VICTORY_D3D12_WARP=1) with VICTORY_D3D12_DEBUG=1.

  • Strict diagnostics gating & clean drain: let draw_trace = crate::draw::take_frame(); (queue.rs:495) is strictly under #[cfg(all(windows, feature = "diagnostics"))] right after pump_held(Why::Present) and before frame-counter updates or early no-plane returns, passing draw_trace into blinks(...) (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.
  • Rebase & locking: merges cleanly with multi-plane PresentX on origin/main with no lock-order changes (draw::take_frame() only takes its own FRAME_DRAWS lock).
  • Verification:
    • 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 new present_without_a_plane_drains_the_draw_trace at queue.rs:763).
**@⁠fuzeofficlal** on GitHub · 2026-11-26 14:53 UTC · [original](https://github.com/Marvisak/VIctory/pull/2666#pullrequestreview-6076225822) · **approved these changes** Reviewed `crates/victory-gpu/src/queue.rs` at `13a2b928` merged onto `origin/main` (`63bcca43`) and verified on RTX 5090 and WARP (`VICTORY_D3D12_WARP=1`) with `VICTORY_D3D12_DEBUG=1`. - **Strict diagnostics gating & clean drain**: `let draw_trace = crate::draw::take_frame();` (`queue.rs:495`) is strictly under `#[cfg(all(windows, feature = "diagnostics"))]` right after `pump_held(Why::Present)` and before frame-counter updates or early no-plane returns, passing `draw_trace` into `blinks(...)` (`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. - **Rebase & locking**: merges cleanly with multi-plane `PresentX` on `origin/main` with no lock-order changes (`draw::take_frame()` only takes its own `FRAME_DRAWS` lock). - **Verification**: - `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 new `present_without_a_plane_drains_the_draw_trace` at `queue.rs:763`).
This pull request can be merged automatically.
This branch is out-of-date with the base branch
You are not authorized to merge this pull request.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/2666/head:github-bot/gh-2666'
git switch 'github-bot/gh-2666'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2666'
git switch 'github-bot/gh-2666'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2666'
git switch 'github-bot/gh-2666'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2666'
git switch 'main'
git merge --squash 'github-bot/gh-2666'
git switch 'main'
git merge --ff-only 'github-bot/gh-2666'
git switch 'main'
git merge 'github-bot/gh-2666'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No reviewers
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
github/Marvisak--VIctory!2666
No description provided.