GPU diagnostics: name the first observed black frame accurately #2837

Open
github-bot wants to merge 3 commits from github-bot/gh-2837 into main AGit
Owner

@⁠109User109 on GitHub · 2026-11-25 21:48 UTC · original
109User109:codex/first-black-frame-log → main · +101 −10 · 2 files · 3 commits · open

Problem

The black-frame diagnostic starts with LAST = false. When the first sampled frame is black, it says "a black frame after a frame that was not", although no previous frame was sampled. This showed up while investigating a Windows run on an AMD integrated GPU.

Change

Track whether a prior frame was sampled. Label the first observed black frame separately, and keep the existing transition message when a sampled nonblack frame precedes it. An unsampled present does not replace the last known result. The new unit test covers first black, a real transition, repeated black, and unsampled/nonblack frames.

Verification

  • cargo xtask policy: 186 files ok.
  • git diff --check: clean.
  • Tried cargo test -p victory-gpu --features diagnostics black_frame_tests --locked on Linux. The existing Linux build fails first in resource.rs because IDLE_FRAMES and IDLE_MS are unavailable under that target, so the new test could not run here. The repository's Windows CI runs the unit test.

No game files or captures are included. Assisted by OpenAI Codex.

**@⁠109User109** on GitHub · 2026-11-25 21:48 UTC · [original](https://github.com/Marvisak/VIctory/pull/2837) `109User109:codex/first-black-frame-log` → `main` · +101 −10 · 2 files · 3 commits · open ## Problem The black-frame diagnostic starts with `LAST = false`. When the first sampled frame is black, it says "a black frame after a frame that was not", although no previous frame was sampled. This showed up while investigating a Windows run on an AMD integrated GPU. ## Change Track whether a prior frame was sampled. Label the first observed black frame separately, and keep the existing transition message when a sampled nonblack frame precedes it. An unsampled present does not replace the last known result. The new unit test covers first black, a real transition, repeated black, and unsampled/nonblack frames. ## Verification - `cargo xtask policy`: 186 files ok. - `git diff --check`: clean. - Tried `cargo test -p victory-gpu --features diagnostics black_frame_tests --locked` on Linux. The existing Linux build fails first in `resource.rs` because `IDLE_FRAMES` and `IDLE_MS` are unavailable under that target, so the new test could not run here. The repository's Windows CI runs the unit test. No game files or captures are included. Assisted by OpenAI Codex.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 05:15:28 +00:00
Author
Owner

@⁠oni-swr on GitHub · 2026-11-25 22:28 UTC · original

Independent Windows verification of exact head d151391c71a9dd7ef8f94b526a11ab8b9f81e908 against main at f3578e3.

cargo test -j 4 --locked -p victory-gpu --features diagnostics --lib passed 203 tests, including the first-black-frame regression, with one benchmark ignored. Main passed 243 tests with one benchmark ignored. DXGI reported the Microsoft software adapter (VendorId=0x1414, Flags=0x2). This head merges cleanly into current main and alongside #2838–#2840.

The regression confirms the first observed black frame is distinct from a transition. The code retains the prior sample when a present has no sample. Claude’s earlier negative control on the integration branch failed when the first black frame was reported as a transition again.

Fresh verification and review by Codex (gpt-6.2-sol). Synthetic inputs only, with both WARP switches set and Windows SDK dxil.dll.

**@⁠oni-swr** on GitHub · 2026-11-25 22:28 UTC · [original](https://github.com/Marvisak/VIctory/pull/2837#issuecomment-7176408550) Independent Windows verification of exact head `d151391c71a9dd7ef8f94b526a11ab8b9f81e908` against `main` at `f3578e3`. `cargo test -j 4 --locked -p victory-gpu --features diagnostics --lib` passed 203 tests, including the first-black-frame regression, with one benchmark ignored. Main passed 243 tests with one benchmark ignored. DXGI reported the Microsoft software adapter (`VendorId=0x1414`, `Flags=0x2`). This head merges cleanly into current main and alongside #2838–#2840. The regression confirms the first observed black frame is distinct from a transition. The code retains the prior sample when a present has no sample. Claude’s earlier negative control on the integration branch failed when the first black frame was reported as a transition again. Fresh verification and review by Codex (`gpt-6.2-sol`). Synthetic inputs only, with both WARP switches set and Windows SDK `dxil.dll`.
Author
Owner

@⁠andrewpozdnakov7-jpg on GitHub · 2026-11-26 01:51 UTC · original

I found one production path that still loses the unknown state. Host::present used Some(probe.is_some_and(...)), so a presentation without a sample told your new warning logic that the frame was nonblack.

714b6ea is one commit directly on d151391c71a9dd7ef8f94b526a11ab8b9f81e908. The same Windows/WARP test presents RGBA8 black, FP16, RGBA8 black, and RGBA8 color. It verifies the FP16 swap-chain format and observes [true, false, true, false] before, then [true, None, true, false]. Six paired runs, full GPU diagnostics (204 passed, 1 ignored), strict Clippy, and asset policy passed on the exact branch. I also checked the change with the current multiplane presenter and #2962 on main 63bcca4, adapting the fixture call to the new signature. All 249 GPU diagnostics tests passed there, with one ignored.

If you take the patch or test, please preserve its Git author. If you fold it into another commit, please add:

Co-authored-by: andrewpozdnakov7-jpg [email protected]

**@⁠andrewpozdnakov7-jpg** on GitHub · 2026-11-26 01:51 UTC · [original](https://github.com/Marvisak/VIctory/pull/2837#issuecomment-7180217452) I found one production path that still loses the unknown state. `Host::present` used `Some(probe.is_some_and(...))`, so a presentation without a sample told your new warning logic that the frame was nonblack. [714b6ea](https://github.com/andrewpozdnakov7-jpg/VIctory/commit/714b6ea509fcee4cce50d87f03421ac63e700567) is one commit directly on `d151391c71a9dd7ef8f94b526a11ab8b9f81e908`. The same Windows/WARP test presents RGBA8 black, FP16, RGBA8 black, and RGBA8 color. It verifies the FP16 swap-chain format and observes `[true, false, true, false]` before, then `[true, None, true, false]`. Six paired runs, full GPU diagnostics (204 passed, 1 ignored), strict Clippy, and asset policy passed on the exact branch. I also checked the change with the current multiplane presenter and #2962 on main `63bcca4`, adapting the fixture call to the new signature. All 249 GPU diagnostics tests passed there, with one ignored. If you take the patch or test, please preserve its Git author. If you fold it into another commit, please add: Co-authored-by: andrewpozdnakov7-jpg <[email protected]>
Author
Owner

@⁠steven-seagull27 on GitHub · 2026-11-26 02:16 UTC · original

I checked the warning emitted after real Host::present results reach this PR's blinks logic on RTX 5080 and WARP. With #2962 and #2827 present, a sequence of RGB10 red 30 → FP16 → RGB10 red 30 triggered a spurious black transition on each adapter. Both RGB10 frames had the same decoded PNG red value (7) and the same sampled level (7).

With the return expression from Andrew's 714b6ea, FP16 returned None, the level history stayed intact and the duplicate warning disappeared. The opposite control — RGB10 green 31 → FP16 → RGB10 blue 30 — still emitted the real nonblack-to-black transition. Across 30 presents per adapter the patch removed precisely three spurious warnings, one per RGB10 resource format. All 30 swap-chain calls returned S_OK, including FP16.

I forwarded the actual host return into blinks in a local test fixture and recorded its message choice. Windows build 26300.10075, NVIDIA driver 621.40. Tested with Codex assistance.

**@⁠steven-seagull27** on GitHub · 2026-11-26 02:16 UTC · [original](https://github.com/Marvisak/VIctory/pull/2837#issuecomment-7180627906) I checked the warning emitted **after** real `Host::present` results reach this PR's `blinks` logic on RTX 5080 and WARP. With #2962 and #2827 present, a sequence of RGB10 red 30 → FP16 → RGB10 red 30 triggered a spurious black transition on each adapter. Both RGB10 frames had the same decoded PNG red value (7) and the same sampled level (7). With the return expression from Andrew's [`714b6ea`](https://github.com/andrewpozdnakov7-jpg/VIctory/commit/714b6ea509fcee4cce50d87f03421ac63e700567), FP16 returned `None`, the level history stayed intact and the duplicate warning disappeared. The opposite control — RGB10 green 31 → FP16 → RGB10 blue 30 — still emitted the real nonblack-to-black transition. Across 30 presents per adapter the patch removed precisely three spurious warnings, one per RGB10 resource format. All 30 swap-chain calls returned `S_OK`, including FP16. I forwarded the actual host return into `blinks` in a local test fixture and recorded its message choice. Windows build 26300.10075, NVIDIA driver 621.40. Tested with Codex assistance.
Author
Owner

@⁠Marvisak on GitHub · 2026-11-26 03:22 UTC · original

Automated triage for the maintainers.

Verdict: needs work. The relabelling in blinks (crates/victory-gpu/src/queue.rs) is fine, and black_frame_message is tested.

But the PR says "an unsampled present does not replace the last known result", and in production that does not hold: Host::present (crates/victory-gpu/src/host.rs, ~3483) returns Some(probe.is_some_and(...)), so a present that took no sample arrives as Some(false) and is still taken as a nonblack frame. Two comments above show this producing spurious transition warnings. Please have Host::present return None when no probe was taken (as in the commit linked by andrewpozdnakov7-jpg, with credit) so the new Option state actually reaches blinks.

CI: check passing.


Generated by Claude Code

**@⁠Marvisak** on GitHub · 2026-11-26 03:22 UTC · [original](https://github.com/Marvisak/VIctory/pull/2837#issuecomment-7181662697) <!-- victory-triage v1 head=d151391c71a9dd7ef8f94b526a11ab8b9f81e908 verdict=needs-work at=2026-11-26T03:22:30Z --> Automated triage for the maintainers. **Verdict: needs work.** The relabelling in `blinks` (`crates/victory-gpu/src/queue.rs`) is fine, and `black_frame_message` is tested. But the PR says "an unsampled present does not replace the last known result", and in production that does not hold: `Host::present` (`crates/victory-gpu/src/host.rs`, ~3483) returns `Some(probe.is_some_and(...))`, so a present that took no sample arrives as `Some(false)` and is still taken as a nonblack frame. Two comments above show this producing spurious transition warnings. Please have `Host::present` return `None` when no probe was taken (as in the commit linked by andrewpozdnakov7-jpg, with credit) so the new `Option` state actually reaches `blinks`. CI: `check` passing. --- _Generated by [Claude Code](https://claude.ai/code)_
Author
Owner

@⁠kotekompotek on GitHub · 2026-11-25 21:51 UTC · original · reviewed

Correct: Option tracking distinguishes 'first observed black' from 'black after non-black', and shown.or(last.0) keeps the last known state across frames with no copy info — so a black frame following unknown state doesn't re-trigger 'after a frame that was not'. The extracted black_frame_message is testable. LGTM.

**@⁠kotekompotek** on GitHub · 2026-11-25 21:51 UTC · [original](https://github.com/Marvisak/VIctory/pull/2837#pullrequestreview-6065471711) · **reviewed** Correct: Option<bool> tracking distinguishes 'first observed black' from 'black after non-black', and shown.or(last.0) keeps the last known state across frames with no copy info — so a black frame following unknown state doesn't re-trigger 'after a frame that was not'. The extracted black_frame_message is testable. LGTM.
Author
Owner

@⁠fuzeofficlal on GitHub · 2026-11-26 00:24 UTC · original · reviewed

Verified head d151391c cleanly merged onto origin/main (63bcca43) on Windows 11 x64 (NVIDIA GeForce RTX 5090 + D3D12 WARP + VICTORY_D3D12_DEBUG=1).

Code Review

  • Switching LAST from bool to Option<bool> with shown.or(last.0) cleanly preserves the previous sampled state across unsampled frames and accurately separates None -> Some(true) ("first observed black frame") from Some(false) -> Some(true) ("a black frame after a frame that was not").

Local Verification (--features diagnostics)

  • RTX 5090 & WARP (VICTORY_D3D12_DEBUG=1): black_frame_tests + queue::tests: 6/6 passed on both adapters.
  • WARP (full victory-gpu --features diagnostics --lib): 247/247 passed (1 ignored).
  • cargo clippy --locked -p victory-gpu --all-targets -- -D warnings (default and --features diagnostics) & cargo xtask policy (191 files ok): clean.

Looks clean and ready to merge.

**@⁠fuzeofficlal** on GitHub · 2026-11-26 00:24 UTC · [original](https://github.com/Marvisak/VIctory/pull/2837#pullrequestreview-6066883107) · **reviewed** Verified head `d151391c` cleanly merged onto `origin/main` (`63bcca43`) on Windows 11 x64 (NVIDIA GeForce RTX 5090 + D3D12 WARP + `VICTORY_D3D12_DEBUG=1`). ### Code Review - Switching `LAST` from `bool` to `Option<bool>` with `shown.or(last.0)` cleanly preserves the previous sampled state across unsampled frames and accurately separates `None -> Some(true)` (`"first observed black frame"`) from `Some(false) -> Some(true)` (`"a black frame after a frame that was not"`). ### Local Verification (`--features diagnostics`) - **RTX 5090 & WARP (`VICTORY_D3D12_DEBUG=1`)**: `black_frame_tests` + `queue::tests`: **6/6 passed** on both adapters. - **WARP (full `victory-gpu --features diagnostics --lib`)**: **247/247 passed** (1 ignored). - `cargo clippy --locked -p victory-gpu --all-targets -- -D warnings` (default and `--features diagnostics`) & `cargo xtask policy` (`191 files ok`): clean. Looks clean and ready to merge.
Author
Owner

@⁠109User109 on GitHub · 2026-11-26 13:00 UTC · original

Applied @⁠andrewpozdnakov7-jpg's patch as a2fdd67a on top of this PR, preserving the original Git author.

Co-authored-by: andrewpozdnakov7-jpg [email protected]

**@⁠109User109** on GitHub · 2026-11-26 13:00 UTC · [original](https://github.com/Marvisak/VIctory/pull/2837#issuecomment-7192753567) Applied @⁠andrewpozdnakov7-jpg's patch as [`a2fdd67a`](https://github.com/109User109/VIctory/commit/a2fdd67a5501893f976402d694ea4be72876897a) on top of this PR, preserving the original Git author. Co-authored-by: andrewpozdnakov7-jpg <[email protected]>
Author
Owner

@⁠andrewpozdnakov7-jpg on GitHub · 2026-11-26 13:16 UTC · original

@⁠109User109 thanks for preserving the author on a2fdd67. I resolved its conflict with upstream 63bcca43 in 1f68349. The merge keeps a2fdd67 as its first parent and adapts the black-probe test to the current multi-plane Host::present signature.

The real WARP swap-chain test returned [Some(true), None, Some(true), Some(false)] for black RGBA8, unprobed FP16, black RGBA8 and nonblack RGBA8. The compositor failure/recovery test and the first-observed-black message test also passed. With app-local Agility/WARP, the full GPU diagnostics suite had 249 passes and 1 ignored, and strict GPU Clippy passed with all features.

You can fast-forward this branch to the merge commit if you want to take the resolution. If moving the probe test separately, please retain its Git author or add Co-authored-by: andrewpozdnakov7-jpg <[email protected]> when folding it into another commit. AI-assisted with Codex.

**@⁠andrewpozdnakov7-jpg** on GitHub · 2026-11-26 13:16 UTC · [original](https://github.com/Marvisak/VIctory/pull/2837#issuecomment-7193125992) @⁠109User109 thanks for preserving the author on `a2fdd67`. I resolved its conflict with upstream `63bcca43` in [`1f68349`](https://github.com/andrewpozdnakov7-jpg/VIctory/commit/1f6834929c87c436a7e6c3735c9ba20ca748d095). The merge keeps `a2fdd67` as its first parent and adapts the black-probe test to the current multi-plane `Host::present` signature. The real WARP swap-chain test returned `[Some(true), None, Some(true), Some(false)]` for black RGBA8, unprobed FP16, black RGBA8 and nonblack RGBA8. The compositor failure/recovery test and the first-observed-black message test also passed. With app-local Agility/WARP, the full GPU diagnostics suite had 249 passes and 1 ignored, and strict GPU Clippy passed with all features. You can fast-forward this branch to the merge commit if you want to take the resolution. If moving the probe test separately, please retain its Git author or add `Co-authored-by: andrewpozdnakov7-jpg <[email protected]>` when folding it into another commit. AI-assisted with Codex.
Author
Owner

@⁠109User109 on GitHub · 2026-11-26 14:18 UTC · original

Fast-forwarded the PR branch to @⁠andrewpozdnakov7-jpg's merge resolution 1f683492, which keeps a2fdd67 as first parent and resolves the conflict with current main.

**@⁠109User109** on GitHub · 2026-11-26 14:18 UTC · [original](https://github.com/Marvisak/VIctory/pull/2837#issuecomment-7194617480) Fast-forwarded the PR branch to @⁠andrewpozdnakov7-jpg's merge resolution [`1f683492`](https://github.com/andrewpozdnakov7-jpg/VIctory/commit/1f6834929c87c436a7e6c3735c9ba20ca748d095), which keeps `a2fdd67` as first parent and resolves the conflict with current `main`.
This pull request can be merged automatically.
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/2837/head:github-bot/gh-2837'
git switch 'github-bot/gh-2837'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-2837'
git switch 'github-bot/gh-2837'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-2837'
git switch 'github-bot/gh-2837'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-2837'
git switch 'main'
git merge --squash 'github-bot/gh-2837'
git switch 'main'
git merge --ff-only 'github-bot/gh-2837'
git switch 'main'
git merge 'github-bot/gh-2837'
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!2837
No description provided.