[Ready to merge] GPU diagnostics: a black frame's trace keeps the draws that end the frame #954

Open
opened 2026-11-26 04:14:50 +00:00 by github-bot · 7 comments
Owner

@⁠EduAzevedo on GitHub · 2026-11-24 14:27 UTC · original

PR creation is limited to collaborators, so this is a branch ready to merge: EduAzevedo/VIctory@diag/black-frame-tail (one commit, 2e2f167, on top of ffe310e).

Why

The black-frame trace (VICTORY_LOG=info,victory_gpu::draw=debug) kept a frame's first 256 draws. A world frame runs thousands, so the trace stopped in the geometry passes and never reached the lighting, composite and full-screen draws that end the frame, which is what a black picture (#850, #293) is about. In a run on integration/testers every black frame in the world was cut at 256 lines, all of them G-buffer mesh draws.

What

  • The trace keeps the first and the last half of the limit, with one line in between: ... N draws not kept here (VICTORY_BLACK_FRAME_DRAWS raises the limit).
  • VICTORY_BLACK_FRAME_DRAWS=<n> sets the limit (default 256, as before; at least 2). Documented in the README's diagnostics table.
  • The DROPPED mark still goes on the draw traced last, when it was kept.
  • Diagnostics builds only; release builds are unchanged.

Tested

  • cargo test -p victory-gpu --lib: 53 passed, 0 failed, 1 ignored, including three new tests (frame_trace_tests: a short frame is kept whole; a long frame keeps both ends and counts what was left out; the drop mark lands on the last kept draw and not on one left out). No GPU needed.
  • cargo clippy -p victory-gpu --all-targets -- -D warnings, with and without --features diagnostics: clean. cargo xtask policy: 154 files ok.
  • In the title: RTX 2070 SUPER (driver 610.88), Windows 11 26200, diag build of ffe310e + #493 + #189 + #206 with this commit, VICTORY_SHADER_LOOP_LIMIT=32. Two black frames in the first world minutes now read ... 106 draws not kept here and ... 1,108 draws not kept here, followed by the frame's last 128 draws (shadow and 2560x1440 passes and their drops), which the old trace never showed.

No game data in this PR.

**@⁠EduAzevedo** on GitHub · 2026-11-24 14:27 UTC · [original](https://github.com/Marvisak/VIctory/issues/954) PR creation is limited to collaborators, so this is a branch ready to merge: [EduAzevedo/VIctory@diag/black-frame-tail](https://github.com/EduAzevedo/VIctory/tree/diag/black-frame-tail) (one commit, `2e2f167`, on top of `ffe310e`). ### Why The black-frame trace (`VICTORY_LOG=info,victory_gpu::draw=debug`) kept a frame's **first 256 draws**. A world frame runs thousands, so the trace stopped in the geometry passes and never reached the lighting, composite and full-screen draws that end the frame, which is what a black picture (#850, #293) is about. In a run on `integration/testers` every black frame in the world was cut at 256 lines, all of them G-buffer mesh draws. ### What - The trace keeps the **first and the last half** of the limit, with one line in between: `... N draws not kept here (VICTORY_BLACK_FRAME_DRAWS raises the limit)`. - `VICTORY_BLACK_FRAME_DRAWS=<n>` sets the limit (default 256, as before; at least 2). Documented in the README's diagnostics table. - The `DROPPED` mark still goes on the draw traced last, when it was kept. - Diagnostics builds only; release builds are unchanged. ### Tested - `cargo test -p victory-gpu --lib`: 53 passed, 0 failed, 1 ignored, including three new tests (`frame_trace_tests`: a short frame is kept whole; a long frame keeps both ends and counts what was left out; the drop mark lands on the last kept draw and not on one left out). No GPU needed. - `cargo clippy -p victory-gpu --all-targets -- -D warnings`, with and without `--features diagnostics`: clean. `cargo xtask policy`: 154 files ok. - In the title: RTX 2070 SUPER (driver 610.88), Windows 11 26200, diag build of `ffe310e` + #493 + #189 + #206 with this commit, `VICTORY_SHADER_LOOP_LIMIT=32`. Two black frames in the first world minutes now read `... 106 draws not kept here` and `... 1,108 draws not kept here`, followed by the frame's last 128 draws (shadow and 2560x1440 passes and their drops), which the old trace never showed. No game data in this PR.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 04:14:50 +00:00
Author
Owner

@⁠DrDarkDK on GitHub · 2026-11-24 14:41 UTC · original

I checked drop attribution on 2e2f167 with a deterministic trace test. When draw A enters the trace, draw B is recorded next, and A then reports a failure, the trace marks B as DROPPED. The drop handler marks the latest entry, so an interleaved recording can point a black-frame investigation at the wrong draw.

This behavior also exists on the base revision. AI-assisted. Synthetic Windows test only.

**@⁠DrDarkDK** on GitHub · 2026-11-24 14:41 UTC · [original](https://github.com/Marvisak/VIctory/issues/954#issuecomment-7134797789) I checked drop attribution on `2e2f167` with a deterministic trace test. When draw A enters the trace, draw B is recorded next, and A then reports a failure, the trace marks B as `DROPPED`. The drop handler marks the latest entry, so an interleaved recording can point a black-frame investigation at the wrong draw. This behavior also exists on the base revision. AI-assisted. Synthetic Windows test only.
Author
Owner

@⁠andrewpozdnakov7-jpg on GitHub · 2026-11-24 15:47 UTC · original

I reproduced the interleaved DROPPED attribution on 2e2f1678b3ad765b70d38e252b49c3b3137c726e. Draw A entered the trace, then draw B. Reporting A’s failure marked B.

The follow-up carries the recording ID through draws, indexed draws and mesh dispatches. The same test now marks A. The retention tests also pass for evicted entries and failures reported after a frame has been drained. Fix and regression

One commit directly on the author head. Windows GPU diagnostics: 58 passed, 1 ignored. The default build check, strict Clippy and asset policy passed. AI-assisted.

**@⁠andrewpozdnakov7-jpg** on GitHub · 2026-11-24 15:47 UTC · [original](https://github.com/Marvisak/VIctory/issues/954#issuecomment-7136624241) I reproduced the interleaved `DROPPED` attribution on `2e2f1678b3ad765b70d38e252b49c3b3137c726e`. Draw A entered the trace, then draw B. Reporting A’s failure marked B. The follow-up carries the recording ID through draws, indexed draws and mesh dispatches. The same test now marks A. The retention tests also pass for evicted entries and failures reported after a frame has been drained. [Fix and regression](https://github.com/andrewpozdnakov7-jpg/VIctory/commit/83a8ec3d081c54f86153387c9e3b5e6cc7b3220f) One commit directly on the author head. Windows GPU diagnostics: 58 passed, 1 ignored. The default build check, strict Clippy and asset policy passed. AI-assisted.
Author
Owner

@⁠EduAzevedo on GitHub · 2026-11-24 16:23 UTC · original

Thanks @⁠DrDarkDK for finding it and @⁠andrewpozdnakov7-jpg for the fix. I brought 83a8ec3 into the branch as is (a fast-forward on 2e2f167, your authorship kept), so this issue now carries both commits. Here on Windows: cargo test -p victory-gpu --lib 55 passed, 1 ignored (including interleaved_failure_marks_the_draw_that_failed), Clippy clean with and without diagnostics, asset policy ok.

**@⁠EduAzevedo** on GitHub · 2026-11-24 16:23 UTC · [original](https://github.com/Marvisak/VIctory/issues/954#issuecomment-7137596042) Thanks @⁠DrDarkDK for finding it and @⁠andrewpozdnakov7-jpg for the fix. I brought `83a8ec3` into the branch as is (a fast-forward on `2e2f167`, your authorship kept), so this issue now carries both commits. Here on Windows: `cargo test -p victory-gpu --lib` 55 passed, 1 ignored (including `interleaved_failure_marks_the_draw_that_failed`), Clippy clean with and without diagnostics, asset policy ok.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-25 06:51 UTC · original · edited 2026-11-25 18:46 UTC

Automated triage for the maintainers.

This is a diagnostics-only change and is in scope. It is open as PR #1254 from the same branch, which carries both commits from this thread: 2e2f167, and 83a8ec3, which fixes the interleaved DROPPED attribution that also exists on main. #1254 is based on ffe310e and needs a rebase onto current main before it can be reviewed against it.

New: a related frame-boundary fix is open as PR #2666. It drains the draw trace at every PresentX, including one with zero planes, so draws from a skipped present no longer appear in the next black-frame report. The author says it merges cleanly with a rebased #1254.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-25 06:51 UTC · [original](https://github.com/Marvisak/VIctory/issues/954#issuecomment-7155236189) · edited 2026-11-25 18:46 UTC <!-- victory-issue-triage v1 verdict=tracked seen=2026-11-25T17:46:57Z at=2026-11-25T19:08:00Z --> Automated triage for the maintainers. This is a diagnostics-only change and is in scope. It is open as PR #1254 from the same branch, which carries both commits from this thread: `2e2f167`, and `83a8ec3`, which fixes the interleaved `DROPPED` attribution that also exists on `main`. #1254 is based on `ffe310e` and needs a rebase onto current `main` before it can be reviewed against it. New: a related frame-boundary fix is open as PR #2666. It drains the draw trace at every PresentX, including one with zero planes, so draws from a skipped present no longer appear in the next black-frame report. The author says it merges cleanly with a rebased #1254. --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠StExpeditus on GitHub · 2026-11-25 09:37 UTC · original

Validated the fork branch on Windows 11 Pro 26200 (Intel Core i5-14600K, RTX 5060 Ti, driver 621.24, Rust 1.98.1 MSVC), commit 83a8ec3: cargo test -p victory-gpu --locked --no-fail-fast (with --features diagnostics) -> 58 passed, 0 failed, 1 ignored. Synthetic tests only, no game files.

**@⁠StExpeditus** on GitHub · 2026-11-25 09:37 UTC · [original](https://github.com/Marvisak/VIctory/issues/954#issuecomment-7158579438) Validated the fork branch on Windows 11 Pro 26200 (Intel Core i5-14600K, RTX 5060 Ti, driver 621.24, Rust 1.98.1 MSVC), commit `83a8ec3`: `cargo test -p victory-gpu --locked --no-fail-fast (with `--features diagnostics`)` -> **58 passed, 0 failed, 1 ignored**. Synthetic tests only, no game files.
Author
Owner

@⁠StExpeditus on GitHub · 2026-11-25 09:38 UTC · original

Addendum: this branch is far behind current main (the victory-gpu delta is 37 files, ~11.2k lines), so the run above is the branch as-is on its old base; it needs a rebase before a clean cherry-pick.

**@⁠StExpeditus** on GitHub · 2026-11-25 09:38 UTC · [original](https://github.com/Marvisak/VIctory/issues/954#issuecomment-7158594764) Addendum: this branch is far behind current main (the `victory-gpu` delta is 37 files, ~11.2k lines), so the run above is the branch as-is on its old base; it needs a rebase before a clean cherry-pick.
Author
Owner

@⁠andrewpozdnakov7-jpg on GitHub · 2026-11-25 17:46 UTC · original

A related frame-boundary case is covered in #2666. With a zero-plane PresentX, the same synthetic trace test retains the previous draw on 13f91ca and clears it at the frame boundary on the patch. Serial WARP GPU tests passed with 199 passed and one ignored in both debug flag settings. The patch merges cleanly with the offered #1254 rebase. Commit

If you fold the change or test into another commit, please preserve its Git author or 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/issues/954#issuecomment-7169991860) A related frame-boundary case is covered in #2666. With a zero-plane PresentX, the same synthetic trace test retains the previous draw on 13f91ca and clears it at the frame boundary on the patch. Serial WARP GPU tests passed with 199 passed and one ignored in both debug flag settings. The patch merges cleanly with the offered #1254 rebase. [Commit](https://github.com/andrewpozdnakov7-jpg/VIctory/commit/251acde3dff97ab07a99b1875c0bbb450c088e73) If you fold the change or test into another commit, please preserve its Git author or add this trailer. Co-authored-by: andrewpozdnakov7-jpg <[email protected]>
This discussion has been locked. Commenting is limited to contributors.
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#954
No description provided.