GPU: report the first differing captured render target #2673
No reviewers
Labels
No labels
accessibility
area: build
area: formats
area: gpu
area: loader
area: runtime
area: shader
bug
documentation
duplicate
enhancement
good first issue
gpu: amd
gpu: intel
gpu: nvidia
help wanted
host: wine
invalid
out of scope
question
request
run report
triage: confirmed
triage: has patch
triage: merge candidate
triage: needs info
triage: needs rebase
triage: needs work
triage: proposed close
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Marvisak--VIctory!2673
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-2673"
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?
@necrobytes on GitHub · 2026-11-25 17:55 UTC · original
necrobytes:feat/compare-target-captures→main· +901 −115 · 10 files · 2 commits · openThe render-target PNGs drop alpha, downsample the image and normalize some formats. Two submissions can therefore produce identical diagnostic images even when their raw target contents differ. This implements the first-difference report proposed in #2370 using the per-submission capture that already exists. Command recording and replay remain open in that issue.
Capture the same numbered frames from each build with
VICTORY_DUMP_TARGETS=1,VICTORY_CAPTURE_FRAMESand a separate freshVICTORY_CAPTUREdirectory. Compare them with this command.The diagnostics build records a BLAKE3 digest over the logical rows of subresource zero, across all its depth slices, excluding D3D12 row padding. The command pairs target-bearing submissions in order within each frame and reports the first missing or changed target, the submission IDs from each run, and the recorded writer if available. Multisampled targets retain their slots, descriptions and writers with an unavailable digest. A comparison that reaches one, or another unreadable target, is inconclusive (exit 2). Captures generated before this review update should be regenerated to include MSAA targets. The report identifies the first difference visible at a captured submission boundary. A submission can contain multiple draws.
I tested on a Radeon RX 9060 XT with Wine 11.21 and vkd3d-proton 3.2.0. A synthetic GPU test clears a 3×2 RGBA8 target, changes only its bottom-right alpha byte and reads it back. The two GPU hashes each matched the expected 24 bytes, and the comparison found the change. All 12 capture-related tests passed in the Windows diagnostics build, including coverage for row padding, shifted submission IDs, missing targets and malformed input. I also exercised the built CLI and verified exit codes 0 for matching targets, 1 for a difference and 2 for an unavailable readback or PNG-only directory.
For the MSAA review, I reproduced two false matches on the previous implementation using actual 4× RGBA8 render targets. Both tests now report an inconclusive comparison. One includes an identical single-sample target alongside the MSAA target. The other checks that an MSAA-only submission keeps its position before a later single-sample submission.
Strict Windows MSVC-target Clippy passed locally across the workspace with all targets and features. The asset-policy check passed for all 187 tracked files. I used synthetic inputs throughout. The native Linux GPU crate still fails to compile on both the base and this branch on the same Windows-only symbols.
Tracked as
NEW-214. Claim in #1633Implemented and tested with Codex.
@necrobytes on GitHub · 2026-11-25 18:18 UTC · original
@DrDarkDK, thanks for catching this. I implemented your suggestion in aa709af. Each MSAA target now gets a manifest record with its slot, description, writer and
hash: None. If the comparison reaches that target, it reports an inconclusive result (exit2). A submission containing only MSAA targets also keeps its place when the two runs are paired. Original reviewI added two regressions using real 4× MSAA textures. One pairs an MSAA target with an identical single-sample target. The other puts an MSAA-only submission before a later matching submission. Both reproduced a false match with the old code. With the fix, all 12 capture tests passed on a Radeon RX 9060 XT. The update is ready for another look. Windows CI
@kotekompotek on GitHub · 2026-11-25 18:48 UTC · original
Read through the whole change - solid work, several details done right:
One thing to flag for the next iteration (not a blocker): an unreadable target on only one side still bails - correct and conservative. Also appreciate that this closes only the compare half of #2370 and states command record/replay stays open.
@fuzeofficlal on GitHub · 2026-11-25 19:03 UTC · original
Independent Windows 11 + NVIDIA GeForce RTX 5090 + WARP verification and review of
aa709afe(on13f91ca):Verification (
rustc 1.98.1MSVC)cargo clippy --locked -p victory-gpu -p victory --all-targets -- -D warningsand--features diagnostics: 0 warnings.cargo test --locked -p victory-gpu --features diagnostics --lib capture: 12 passed, 0 failed (including all 3 D3D12 readback tests and 7capture_diffunit tests).VICTORY_D3D12_WARP=1):cargo test --locked -p victory-gpu --features diagnostics --lib -- --test-threads=1: 208 passed, 0 failed, 1 ignored.cargo test --locked -p victory: 10 passed (unit), 2 passed (tests/census.rs).Review & Merge-Ordering Notes
.tmp -> renamemanifests, numeric(frame, submission_position, slot, plane)ordering,ReadbackLayoutpitch-stripped row hashing withGetDeviceRemovedReason()guard, and exit-code2handling for unavailable/MSAA readbacks all look solid.capture.rs:git merge-treewith #2680 (b44ce1ff) and #2701 (a86d36ef).crates/victory-gpu/src/capture.rswith #2702 (b48e6c74), since both refactordump_submission/dump_one; when merging both,submission_targetcan delegate MSAA color targets to #2702'sresolve_destination/dump_onepath and only recordhash: Nonewhen resolve is unavailable (depth/integer/typeless MSAA).@Marvisak on GitHub · 2026-11-25 22:16 UTC · original · edited 2026-11-26 03:25 UTC
Automated triage for the maintainers.
Verdict: merge candidate. Thanks for rebasing; it merges cleanly into current
main.This implements the compare half of #2370. In diagnostics builds,
capture.rsdump_submissionwrites a per-submission.targetsmanifest. Each entry holds a BLAKE3 digest of subresource zero's logical rows (capture_diff::hash_rows, which skips D3D12 row padding and checks the footprint arithmetic). The newvictory compare-targetspairs submissions by position within a frame and reports the first difference, with exit codes 0/1/2. I checked thatblake3is already avictory-gpudependency (noCargo.tomlchange). The manifest is written via a staging file andrename. MSAA targets keep their slot with no digest, which makes a comparison that reaches them inconclusive rather than a false match. Theread_backcallers indraw.rs,host.rsandplaced_uav_tests.rsmoved to the newReadbackLayout::with_rows, which no longer assumesRowPitch * Heightis mappable.The README addition is at the upper end of what the docs should carry; a maintainer may want it shorter. Expect a conflict with #2702 in
capture.rs(both reworkdump_submission).CI: passing (
check).Generated by Claude Code
@DrDarkDK on GitHub · 2026-11-25 18:00 UTC · original · requested changes
submission_targetreturnsNonefor multisampled textures, so those targets are omitted from the manifest. If the other targets match,compare-targetscan report success without comparing the MSAA target. A submission with only omitted targets can also disappear and shift the pairing with later submissions.Could the capture emit a record for each MSAA target with its description and
hash: None? The comparer already treats an unavailable hash as inconclusive. A fixture with one matching single-sample target and one unavailable MSAA target would cover the false-match case.Static review only.
AI-assisted with Codex.
@DrDarkDK on GitHub · 2026-11-25 18:24 UTC · original · approved these changes
The MSAA finding is resolved. The capture now keeps each MSAA target’s slot and metadata with an unavailable digest, so the comparison reports an inconclusive result when it reaches that target. The new regressions cover both the mixed single-sample/MSAA case and an MSAA-only submission before a later capture.
I reviewed the update and confirmed Windows CI passed for
aa709af. I didn’t rerun the GPU tests locally.AI-assisted with Codex.
@fuzeofficlal on GitHub · 2026-11-26 14:53 UTC · original · approved these changes
Reviewed all 10 files at
ba745e68and verified across RTX 5090, WARP (VICTORY_D3D12_WARP=1),VICTORY_D3D12_DEBUG=1, default/release builds, and live CLI runs.Highlights checked
#[cfg]hygiene: all capture and readback hooks incapture.rs,host.rs,draw.rs, andplaced_uav_tests.rsremain gated behinddiagnostics;crates/victory-gpu/src/capture_diff.rsandcapture_diff/compare.rsare platform-independent withhash_rows(capture_diff.rs:22) andwrite_submission(capture_diff.rs:43) cleanly gated with#[cfg(any(all(windows, feature = "diagnostics"), test))].ReadbackLayout(capture.rs:127) checks theu64::MAXfootprint sentinel,row_bytes <= pitch, and checked total bounds before mapping, guards mapped reads withGetDeviceRemovedReason().is_err()(capture.rs:663), and hashes every logical row and 3D depth slice without padding (capture.rs:704).capture_diff::compare(capture_diff/compare.rs:167) properly rejects empty/PNG-only directories, malformed lines, duplicate manifests (s1vss01), and duplicate(slot, plane)entries (exit2), preserves MSAA / unavailable readback slots so they cannot silently compare equal (exit2), and detects dimension/format or raw byte mismatches in numeric frame + submission order (exit1).Verification
cargo run -p xtask -- policy: 194 files ok.cargo clippy --workspace --all-targets -- -D warnings(both default and--all-features) andcargo check --release -p victory -p victory-gpu(withoutdiagnostics): all clean.cargo test -p victory: 18/18 passed.cargo test -p victory-gpu --lib --features diagnostics(capture+capture_diff+placed_uav_tests): 22/22 passed on RTX 5090 +VICTORY_D3D12_DEBUG=1, and 22/22 passed on WARP +VICTORY_D3D12_DEBUG=1.victory.exe compare-targets: verified exit0on matching manifests (All captured render targets match.), exit1on a differing target with frame/submission/slot/plane/BLAKE3/writer details, and exit2on an empty directory.#2655(22/22pass together on WARP + Debug Layer); will need a straightforward conflict resolution incrates/victory-gpu/src/capture.rsif landed after#2702since both touchdump_submission/dump_one.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.