Repository navigation
GPU: copy-back reads into scratch sized to the changed stretch, not a zeroed 64 KiB per range - #240
Open
fffluffy-dev wants to merge 1 commit into
Open
fffluffy-dev wants to merge 1 commit into
fffluffy-dev wants to merge 1 commit into
Conversation
… zeroed 64 KiB per range Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
JustDownTV
pushed a commit
to JustDownTV/victory-gta6
that referenced
this pull request
Nov 24, 2026
… zeroed 64 KiB per range (fxceless#240)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Shadow::copy_back_withallocated and zeroed a 64 KiB scratch (vec![0u8; PIECE]) on every call, once per joined span, though it only reads the stretch from the first to the last changed byte of each differing piece. The merge moves intoback_pieceunchanged; the scratch now starts empty and is sized to each stretch, ascard_mergealready does.Same bytes compared, read and written back as before; only the scratch changes. Every scratch byte used is first filled by
read_intofor exactly that stretch, and a failed read returns before the merge, as before.Model of one submission (8 MiB copy, overlapping and repeated ranges): scratch bytes zeroed 40,763,392 (622 allocations) → 10,912 (171); bytes compared, pieces and bytes written back unchanged. Marvisak/VIctory#1656 found the same allocation before upstream redesigned
Shadow.Validation (cargo-xwin, tests under Wine):
cargo test -p victory-gpu111 passed, 1 ignored, new testa_piece_put_back_reads_only_its_stretch; clippy clean both ways; policy ok. On a real frame: "copying back" ms should fall at the same MB.AI use: written with Claude Code (Claude Opus 5.5); reviewed and posted with my approval. No game files were used.