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

Open
opened 2026-11-24 14:27:11 +00:00 by EduAzevedo · 7 comments
EduAzevedo commented 2026-11-24 14:27:11 +00:00 (Migrated from github.com)
Contributor

Imported from Marvisak/VIctory. Originally posted by EduAzevedo on 2026-11-24T14:27:11Z.


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.

<!-- greyfinch-sync:Marvisak/VIctory:issue:6584033358 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/issues/954). Originally posted by [EduAzevedo](https://github.com/EduAzevedo) on 2026-11-24T14:27:11Z. --- 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.
DrDarkDK commented 2026-11-24 15:04:10 +00:00 (Migrated from github.com)
Author
Contributor

Imported from Marvisak/VIctory. Originally posted by DrDarkDK on 2026-11-24T14:41:47Z.


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.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7134797789 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/issues/954#issuecomment-7134797789). Originally posted by [DrDarkDK](https://github.com/DrDarkDK) on 2026-11-24T14:41:47Z. --- 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.
andrewpozdnakov7-jpg commented 2026-11-24 16:05:22 +00:00 (Migrated from github.com)
Author
Contributor

Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-24T15:47:44Z.


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.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7136624241 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/issues/954#issuecomment-7136624241). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-24T15:47:44Z. --- 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.
EduAzevedo commented 2026-11-24 17:04:24 +00:00 (Migrated from github.com)
Author
Contributor

Imported from Marvisak/VIctory. Originally posted by EduAzevedo on 2026-11-24T16:23:40Z.


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.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7137596042 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/issues/954#issuecomment-7137596042). Originally posted by [EduAzevedo](https://github.com/EduAzevedo) on 2026-11-24T16:23:40Z. --- 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.
Marvisak commented 2026-11-25 07:03:24 +00:00 (Migrated from github.com)
Author
Contributor

Imported from Marvisak/VIctory. Originally posted by Marvisak on 2026-11-25T06:51:46Z.


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

<!-- greyfinch-sync:Marvisak/VIctory:comment:7155236189 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/issues/954#issuecomment-7155236189). Originally posted by [Marvisak](https://github.com/Marvisak) on 2026-11-25T06:51:46Z. --- <!-- 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)_
StExpeditus commented 2026-11-25 10:07:46 +00:00 (Migrated from github.com)
Author
Contributor

Imported from Marvisak/VIctory. Originally posted by StExpeditus on 2026-11-25T09:37:23Z.


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.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7158579438 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/issues/954#issuecomment-7158579438). Originally posted by [StExpeditus](https://github.com/StExpeditus) on 2026-11-25T09:37:23Z. --- 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 commented 2026-11-25 10:07:47 +00:00 (Migrated from github.com)
Author
Contributor

Imported from Marvisak/VIctory. Originally posted by StExpeditus on 2026-11-25T09:38:03Z.


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.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7158594764 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/issues/954#issuecomment-7158594764). Originally posted by [StExpeditus](https://github.com/StExpeditus) on 2026-11-25T09:38:03Z. --- 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.
andrewpozdnakov7-jpg commented 2026-11-25 18:02:50 +00:00 (Migrated from github.com)
Author
Contributor

Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-25T17:46:57Z.


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]

<!-- greyfinch-sync:Marvisak/VIctory:comment:7169991860 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/issues/954#issuecomment-7169991860). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-25T17:46:57Z. --- 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]>
Sign in to join this conversation.
No labels
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.

Reference
Marvisak/VIctory#954
No description provided.