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

Open
TG0000 wants to merge 2 commits from upstream-pr/3638 into main
TG0000 commented 2026-11-28 01:12:53 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by TG0000 on 2026-11-28T01:12:53Z.


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

<!-- greyfinch-sync:Marvisak/VIctory:issue:5535256623 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3638). Originally posted by [TG0000](https://github.com/TG0000) on 2026-11-28T01:12:53Z. --- ## 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](https://claude.com/claude-code)
andrewpozdnakov7-jpg commented 2026-11-28 01:32:19 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-28T01:32:19Z.


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 <[email protected]>

<!-- greyfinch-sync:Marvisak/VIctory:comment:7231736780 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3638#issuecomment-7231736780). Originally posted by [andrewpozdnakov7-jpg](https://github.com/andrewpozdnakov7-jpg) on 2026-11-28T01:32:19Z. --- `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`](https://github.com/andrewpozdnakov7-jpg/VIctory/commit/b696c04fc56291f64990931877eb01e408d100b7) 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 <[email protected]>`
TG0000 commented 2026-11-28 01:47:44 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by TG0000 on 2026-11-28T01:47:44Z.


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.)

<!-- greyfinch-sync:Marvisak/VIctory:comment:7231921553 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3638#issuecomment-7231921553). Originally posted by [TG0000](https://github.com/TG0000) on 2026-11-28T01:47:44Z. --- 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.)*
futurepro62 commented 2026-11-29 21:06:29 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by futurepro62 on 2026-11-29T21:06:29Z.


Full-suite run on NVIDIA, since this PR has no test report yet. Tested exact head d9f222c (on its base 63bcca4).

Tested

  • NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.98.1 MSVC (pinned), dxil.dll from Windows SDK 10.0.26100 (the loader's default), debug.
  • cargo build --workspace --locked, then cargo test --workspace --locked --no-fail-fast -- --test-threads=4 --skip emit::memory_tests::heap_direct_texture_reads_mark_their_heap_index --skip descriptor::host::tests::dynamic_slots_are_held_until_released --skip memory::tests::lists_share_a_table_and_copies_keep_their_views --skip emit::stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride --skip emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros --skip emit::synthetic_tests::gathers_at_a_level_match_the_hardware: 866 passed, 0 failed, 10 ignored.
  • the_switch_is_off_unless_asked, the_pixel_and_the_limit_read, reports_are_written_whole_and_text_is_escaped, calls_are_counted_by_what_they_met, a_pipeline_made_again_at_the_same_address_keeps_both_rows, texels_decode_by_format, health_counts_black_nan_inf_and_magenta, single_channel_snorm_previews_distinguish_negative_zero_and_positive, previews_shrink_and_paint_not_finite_texels_cyan, screen_like_targets_are_picked_and_spread, notes_keep_first_use_order_and_the_last_writer, a_cleared_target_reads_back_as_its_colour only build with the diagnostics feature, so the run above doesn't include them; they pass in cargo test -p victory-core -p victory-gpu -p victory-hle -p victory-loader -p victory-shader -p victory --lib --locked --features victory-core/diagnostics,victory-gpu/diagnostics,victory-hle/diagnostics,victory-loader/diagnostics,victory-shader/diagnostics,victory/diagnostics (same skips).
  • --skip leaves out tests that fail on main 63bcca4 on this card too, not because of this PR: heap_direct_texture_reads_mark_their_heap_index ends the victory-shader test process with 0xc0000005 (#2571), so without the skip the rest of that crate never reports; dynamic_slots_are_held_until_released, lists_share_a_table_and_copies_keep_their_views and the two stride_tests hit the 1,000,000-view heap cap of NVIDIA drivers (#1835, #2317); gathers_at_a_level_match_the_hardware fails on lane 0 (#1744).

Not tested

  • AMD (the tests take the default adapter), a release build, the title (test run only).

AI use

  • Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
<!-- greyfinch-sync:Marvisak/VIctory:comment:7262609520 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3638#issuecomment-7262609520). Originally posted by [futurepro62](https://github.com/futurepro62) on 2026-11-29T21:06:29Z. --- Full-suite run on NVIDIA, since this PR has no test report yet. Tested exact head `d9f222c` (on its base `63bcca4`). **Tested** - NVIDIA GeForce RTX 5070 Ti 16 GB (Blackwell, 32-lane waves only, mesh shaders), driver 621.40, Ryzen 7 9800X3D, Windows 11 Home 26300, Rust 1.98.1 MSVC (pinned), `dxil.dll` from Windows SDK 10.0.26100 (the loader's default), debug. - `cargo build --workspace --locked`, then `cargo test --workspace --locked --no-fail-fast -- --test-threads=4 --skip emit::memory_tests::heap_direct_texture_reads_mark_their_heap_index --skip descriptor::host::tests::dynamic_slots_are_held_until_released --skip memory::tests::lists_share_a_table_and_copies_keep_their_views --skip emit::stride_tests::a_heap_buffer_read_by_element_takes_the_views_stride --skip emit::stride_tests::a_heap_buffer_read_where_no_buffer_view_is_reads_zeros --skip emit::synthetic_tests::gathers_at_a_level_match_the_hardware`: **866 passed, 0 failed, 10 ignored**. - `the_switch_is_off_unless_asked`, `the_pixel_and_the_limit_read`, `reports_are_written_whole_and_text_is_escaped`, `calls_are_counted_by_what_they_met`, `a_pipeline_made_again_at_the_same_address_keeps_both_rows`, `texels_decode_by_format`, `health_counts_black_nan_inf_and_magenta`, `single_channel_snorm_previews_distinguish_negative_zero_and_positive`, `previews_shrink_and_paint_not_finite_texels_cyan`, `screen_like_targets_are_picked_and_spread`, `notes_keep_first_use_order_and_the_last_writer`, `a_cleared_target_reads_back_as_its_colour` only build with the `diagnostics` feature, so the run above doesn't include them; they pass in `cargo test -p victory-core -p victory-gpu -p victory-hle -p victory-loader -p victory-shader -p victory --lib --locked --features victory-core/diagnostics,victory-gpu/diagnostics,victory-hle/diagnostics,victory-loader/diagnostics,victory-shader/diagnostics,victory/diagnostics` (same skips). - `--skip` leaves out tests that fail on main `63bcca4` on this card too, not because of this PR: `heap_direct_texture_reads_mark_their_heap_index` ends the `victory-shader` test process with `0xc0000005` (#2571), so without the skip the rest of that crate never reports; `dynamic_slots_are_held_until_released`, `lists_share_a_table_and_copies_keep_their_views` and the two `stride_tests` hit the 1,000,000-view heap cap of NVIDIA drivers (#1835, #2317); `gathers_at_a_level_match_the_hardware` fails on lane 0 (#1744). **Not tested** - AMD (the tests take the default adapter), a release build, the title (test run only). **AI use** - Claude Code (Claude Opus 5.5) ran the tests and wrote this report. I checked it before posting.
TG0000 commented 2026-11-29 22:28:51 +00:00 (Migrated from github.com)

Imported from Marvisak/VIctory. Originally posted by TG0000 on 2026-11-29T22:28:51Z.


Thanks for the full-suite run on NVIDIA and for listing the skipped tests with their reasons, @futurepro62. That fills the gap this PR had: it was only tested on an RX 6800 here. Noted that AMD, a release build and the title itself are not covered by your run.

<!-- greyfinch-sync:Marvisak/VIctory:comment:7263705512 --> Imported from [Marvisak/VIctory](https://github.com/Marvisak/VIctory/pull/3638#issuecomment-7263705512). Originally posted by [TG0000](https://github.com/TG0000) on 2026-11-29T22:28:51Z. --- Thanks for the full-suite run on NVIDIA and for listing the skipped tests with their reasons, @futurepro62. That fills the gap this PR had: it was only tested on an RX 6800 here. Noted that AMD, a release build and the title itself are not covered by your run.
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/3638:upstream-pr/3638'
git switch 'upstream-pr/3638'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/3638'
git switch 'upstream-pr/3638'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/3638'
git switch 'upstream-pr/3638'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/3638'
git switch 'main'
git merge --squash 'upstream-pr/3638'
git switch 'main'
git merge --ff-only 'upstream-pr/3638'
git switch 'main'
git merge 'upstream-pr/3638'
git push origin 'main'
Sign in to join this conversation.
No reviewers
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!3638
No description provided.