GPU/diagnostics: count the pieces that differ on the relay and card merges #842
No reviewers
Labels
No labels
AMD
audio
bug
confirmed
crash
cutscene
dlss
documentation
duplicate
enhancement
fixed-on-main
frame-generation
good first issue
help wanted
input
INTEL
invalid
lighting
linux-proton
memory
needs-info
needs-logs
needs-rebase
NVIDIA
performance
pr-diagnostics
pr-docs
pr-feature
pr-fix
pr-performance
pr-refactor
pr-tests
question
RAYTRACING
rendering
report
series-s
shaders
spam
startup
upstream
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/trustno1-coder--VIctory-NVIDIA!842
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-842"
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?
@CwWwWwW on GitHub · 2026-11-28 07:34 UTC · original
CwWwWwW:fix/backdiffer-relay-count→main· +6 −0 · 1 files · 1 commits · merged 2026-11-29 08:16 UTCPorted to trustno1-coder/VIctory-NVIDIA from the same change submitted to fxceless/victory-fork as PR #1479 (head
481290749e, author CwWwWwW). The fork's own line was dropped when it rebased onto959dcaf(5dbf5ce), so this is submitted here directly. The description below is the original one; its 'Verification' numbers refer to the fork tree. Rebased onto main63b902f.Problem
C::BackDifferis what the frame account prints as "finding N pieces that differ" (copystat.rs:1228). It is added in one place only:Shadow::copy_back_with(shadow.rs:3569), the copy-back path for copies not in the card's memory without the relay.The other three copy-back merge paths find the differing pieces and put them back, but never count them:
Shadow::relay_merge(shadow.rs:3712), the PC relay's landing merge, called once per differing piece fromHost::relay_hand_back(host.rs:4997-5001);Shadow::card_merge(shadow.rs:4700), for copies in the card's memory (host.rs:7056, and on the wide-merge threads athost.rs:7039);Shadow::card_merge_relay(shadow.rs:4766), relay plus card memory (host.rs:6628-6634).Each compares the piece's bytes and finds a difference (via
first_difference) before merging, but adds nothing toBackDiffer. In relay/card configurations the account therefore says "0 pieces that differ" while the merges find hundreds per frame, which makes the frame line misreport where the time goes.Evidence
9a9091d:add(C::BackDiffer, ...)appears only atshadow.rs:3569; the three merges' compare blocks have no counter.differing.len()atshadow.rs:3569); the merges run once per such piece, so they count 1 each.avatarmanz/VIctory-7900XTXPR #237 item 3 as research evidence; the change is written against this tree's own functions and takes no code from it.Change
Three
#[cfg(feature = "diagnostics")]increments 鈥?one after each merge's compare found the piece differing, i.e. where the merge is about to do work 鈥?forrelay_merge,card_mergeandcard_merge_relay. No other code, no runtime path (the lines do not compile without the diagnostics feature).Verification
cargo test -p victory-gpu --lib --locked -- --test-threads=1鈥?242 passed, 0 failed, 7 ignored (unchanged)cargo check -p victory-gpu --all-targets --features diagnostics --locked鈥?clean (exit 0)cargo clippy -p victory-gpu --all-targets --features diagnostics --locked -- -D warnings鈥?clean (exit 0)git diff --checkclean;shadow.rskeeps its 160 pre-existing fmt entries (same count as the base)Diagnostics-only; no D3D12 call, barrier, ordering or allocation is touched.
Verification on this tree (base
63b902f, 2026-11-27)63b902ffailed on those before this change.@Dukestar69 on GitHub · 2026-11-28 07:46 UTC · original · approved these changes
Tested locally merged onto
main(63b902f).crates/victory-gpu/src/shadow.rs;cargo xtask policypassed (294 files ok).cargo test -p victory-gpu --lib shadow::passed (36 passed; 0 failed; 2 ignored) and--features diagnostics --lib shadow::passed (36 passed; 0 failed; 2 ignored).cargo test -p victory-gpu --lib host::and--features diagnostics --lib host::both passed (129 passed; 0 failed; 16 ignored).Clean
#[cfg(feature = "diagnostics")]counter accounting forBackDifferon relay and card merges. LGTM.Synthetic tests only (no game files used). AI-assisted (Gemini 4 Neon).