GPU diagnostics: VICTORY_PROBE, live pipeline coverage and on-demand target snapshot (off by default) #3638
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/3638"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
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 or0): a release build contains none of it.VICTORY_PROBE=1probe-coverage.txt/.jsonevery 15 s and at the title's end.VICTORY_PROBE=auto:<s>VICTORY_PROBE_DIR,_XY,_MAX_RT<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 addsvictory-coreas a dependency ofvictory-gpu(already in the workspace; one line inCargo.lock) and onewindowsfeature 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.
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, forx86_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 enablediagnostics, 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, ascapture.rsdoes, 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_TARGETSsaves 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 samecapture.rs. #1625 compares runtime shader failures with offline coverage.AI-assisted (Claude).
🤖 Generated with Claude Code
Imported from Marvisak/VIctory. Originally posted by andrewpozdnakov7-jpg on 2026-11-28T01:32:19Z.
R8_SNORMandR16_SNORMboth decode to[-1, 1]at1b9f042, 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 grayscale0, 0, 255. The R16 control produced0, 128, 255.Follow-up
b696c04is one commit on the exact PR head. It applies the same preview scaling toR8_SNORMand 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]>Imported from Marvisak/VIctory. Originally posted by TG0000 on 2026-11-28T01:47:44Z.
Thanks @andrewpozdnakov7-jpg, good catch:
R8_SNORMwas missing from the single-channel set, so its preview clamped negatives to black whileR16_SNORMused the observed range.Your commit is applied as is, with your authorship (
d9f222c7, a cherry-pick ofb696c04).Checked on that head:
cargo clippy --workspace --all-targets -- -D warnings, with and without--all-features, forx86_64-pc-windows-msvc(cross-built on macOS): clean.probe::pixelstests, your regression among them, built alone withrustc --teston 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.)
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 base63bcca4).Tested
dxil.dllfrom Windows SDK 10.0.26100 (the loader's default), debug.cargo build --workspace --locked, thencargo 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_colouronly build with thediagnosticsfeature, so the run above doesn't include them; they pass incargo 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).--skipleaves out tests that fail on main63bcca4on this card too, not because of this PR:heap_direct_texture_reads_mark_their_heap_indexends thevictory-shadertest process with0xc0000005(#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_viewsand the twostride_testshit the 1,000,000-view heap cap of NVIDIA drivers (#1835, #2317);gathers_at_a_level_match_the_hardwarefails on lane 0 (#1744).Not tested
AI use
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.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.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.