GPU: copy-back reads into scratch sized to the changed stretch, not a zeroed 64 KiB per range #240
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/240"
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 fxceless/victory-fork. Originally posted by fffluffy-dev on 2026-11-24T22:58:32Z.
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.
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.