Repository navigation
Conversation
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.
Motivation
The shadow copy-back merge runs byte by byte after reading a changed GPU piece. Replace only this arithmetic loop with a 32-byte AVX2 path and scalar fallback. This is complementary to Marvisak#1656 (allocation and write-span reduction), not a replacement for its work.
Semantics
For every byte, keep the current CPU byte when host equals the old snapshot; otherwise take the host GPU byte. Synchronize both output slices and return true iff title bytes changed. Runtime feature detection, unaligned bounded vector loads/stores, scalar tail. No changes to synchronization, copy ranges, GPU commands or page tracking.
Validation
A native C AVX2 equivalent was compiled with GCC -O3 and executed on an AVX2-capable CPU: all 16,777,216 possible byte triples, and 4,416 length/alignment cases (4,880,384 processed bytes with guard checks) agreed with the scalar or mathematical oracle. Three Rust tests added, including the same length/alignment corpus. Native Rust compilation/Clippy and D3D12 integration tests remain pending. No game data, no new dependency, no measured FPS claim; the compiler may already vectorize scalar code. AI-assisted (ChatGPT).