Skip to content

GPU diagnostics: VICTORY_PROBE, live pipeline coverage and on-demand target snapshot (off by default) - #3638

Open
TG0000 wants to merge 2 commits into
Marvisak:mainfrom
TG0000:pr/live-probe
Open

TG0000 wants to merge 2 commits into
Marvisak:mainfrom
TG0000:pr/live-probe

Conversation

@TG0000

@TG0000 TG0000 commented Nov 28, 2026

Copy link
Copy Markdown
Contributor

What

VICTORY_PROBE, for answering "did that frame draw everything, and what did each pass put into its target?" while the title runs. Diagnostics builds only, and off by default (unset or 0): a release build contains none of it.

Setting Effect
VICTORY_PROBE=1 Every title pipeline is followed: draws and dispatches that ran, and for the others whether the pipeline was still compiling, did not translate, was refused by the host, was on the skip list, or could not be set up. probe-coverage.txt / .json every 15 s and at the title's end.
F9, or VICTORY_PROBE=auto:<s> Records the targets drawn into until the next present, reads back up to 12 screen-sized ones, measures black, NaN, infinite and magenta shares and luma, writes a small PNG of each and names the last pipeline that wrote it.
VICTORY_PROBE_DIR, _XY, _MAX_RT Output folder (default <cache>/probe), one pixel followed through the targets, target count.

Output holds pictures from the title, so the folder goes through victory_core::ensure_outside_repo (docs/asset-policy.md). That adds victory-core as a dependency of victory-gpu (already in the workspace; one line in Cargo.lock) and one windows feature for F9.

Switched off in a diagnostics build, each hook is one relaxed load. Switched on, a draw takes one of 16 short locks. A snapshot stalls the present while it reads back.

Tested on

AMD Radeon RX 6800 16 GB (ReBAR), Adrenalin 26.11.2, Ryzen 9 5900X, Windows 11.

  • Hardware, this branch: the 11 probe:: tests passed, including one that clears a render target on the GPU and reads it back through the snapshot's code.
  • cargo clippy --workspace --all-targets -- -D warnings, with and without --all-features, for x86_64-pc-windows-msvc (cross-built on macOS): clean.
  • cargo test -p victory-formats -p xtask (asset policy): passed. Full workspace tests are left to CI; note CI does not enable diagnostics, so it compiles these tests under clippy but does not run them.

Not tested

This branch has not been run in the title. It is a smaller rewrite, against main, of a probe that did run there on the same card (one snapshot written in about 0.6 s, no freeze). One difference matters: this version looks up each target's host texture while draws are recorded, as capture.rs does, rather than at the present. The probe's own lock is not held during that lookup, but a first run with F9 should be treated as untried.

Counting is per call: an indirect call counts once whatever its records hold, and indirect calls rejected before reaching the draw state are not counted.

Overlaps

VICTORY_DUMP_TARGETS saves targets of frames listed beforehand; this adds a run-wide coverage count, on-demand capture and pixel statistics, and reuses its read-back and PNG code. #3415 changes the same capture.rs. #1625 compares runtime shader failures with offline coverage.

AI-assisted (Claude).

🤖 Generated with Claude Code

…e target snapshot

Builds with diagnostics only; off when unset or 0.

VICTORY_PROBE=1 follows every title pipeline for the run: the draws and
dispatches that ran, and for the others whether the pipeline was still
compiling, did not translate, was refused by the host, was left out by
the skip list, or could not be set up. probe-coverage.txt and .json are
written every 15 s and at the title's end.

F9, or VICTORY_PROBE=auto:<seconds>, records the targets drawn into until
the next present, reads the screen-sized ones back, measures their black,
NaN, infinite and magenta shares and saves small previews. Reports go to
VICTORY_PROBE_DIR or <cache>/probe, never inside the source tree.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
@andrewpozdnakov7-jpg

Copy link
Copy Markdown
Contributor

R8_SNORM and R16_SNORM both decode to [-1, 1] at 1b9f042, but the R8 preview clamps negative values to zero while the R16 preview uses the observed range. With a generated row containing -1, 0, +1, the R8 preview produced grayscale 0, 0, 255. The R16 control produced 0, 128, 255.

Follow-up b696c04 is one commit on the exact PR head. It applies the same preview scaling to R8_SNORM and adds the regression. The five tests in the isolated pixel module passed. The full local crate test binary could not link because of debug-symbol output errors on the local build volume. Git merged this commit with #3639 cleanly in a dry run.

Please preserve the Git author if cherry-picking or rebasing, or include this trailer if folding the change into another commit.

Co-authored-by: andrewpozdnakov7-jpg <andrewpozdnakov7-jpg@users.noreply.github.com>

@TG0000

TG0000 commented Nov 28, 2026

Copy link
Copy Markdown
Contributor Author

Thanks @andrewpozdnakov7-jpg, good catch: R8_SNORM was missing from the single-channel set, so its preview clamped negatives to black while R16_SNORM used the observed range.

Your commit is applied as is, with your authorship (d9f222c7, a cherry-pick of b696c04).

Checked on that head:

  • cargo clippy --workspace --all-targets -- -D warnings, with and without --all-features, for x86_64-pc-windows-msvc (cross-built on macOS): clean.
  • The 5 probe::pixels tests, your regression among them, built alone with rustc --test on macOS: passed.
  • cargo test -p victory-formats -p xtask: passed.

Not re-run on the RX 6800 for this commit; it only changes the preview's scaling.

(AI-assisted reply, Claude.)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants