Repository navigation
fix(gpu): preserve newer game writes across partial copy-back overlaps - #438
Open
mikebuckets171 wants to merge 2 commits into
Open
mikebuckets171 wants to merge 2 commits into
mikebuckets171 wants to merge 2 commits into
Conversation
Port RVZO6’s Marvisak/VIctory#3031 (1de058ca) to macOS. Whole-page deduplication does not cover partial overlaps. Advance the saved bytes after merging even if no title write is needed. Eight M5 Pro D3DMetal cases failed on bf99e72 and pass here, preserving newer CPU bytes and still publishing the GPU writes outside the first range. Co-authored-by: RVZO6 <66844656+RVZO6@users.noreply.github.com>
This was referenced Nov 26, 2026
…copyback-baseline # Conflicts: # crates/victory-gpu/src/shadow.rs
Owner
|
Thanks for this. Many pull requests landed today, and this one now conflicts with main. Could you merge or rebase main into it, rerun the checks and ping here? I will review and merge it as soon as CI is green. |
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.
Port of @RVZO6's Marvisak/VIctory#3031, commit
1de058ca, onto macOSbf99e728.The remaining stale-write case
When two declared write ranges overlap within a submission, a partial-page copy-back can be followed by another copy-back of the same bytes. The whole-page comparison set does not cover that overlap. The first pass merges the game’s CPU writes into the host buffer, but leaves the saved comparison bytes unchanged. The next pass then mistakes those merged values for new GPU writes and restores them over newer game writes.
The saved bytes now advance after a successful read and merge, whether or not a write back was necessary. The existing widened-view refresh, whole-page shortcut and pending-range retirement stay in the same order.
Mac regression
The test exercises four layouts, each both with a write-back and with the GPU bytes already present in game memory (a merge that writes nothing):
It changes two game-side bytes between the passes and verifies that a GPU byte outside the first range still goes back with the second. On clean
bf99e728plus the test, all eight cases fail: the three checked bytes areAA 22 BBinstead of66 33 BB. This reproduces the error in the real mapped-buffer path under Wine/D3DMetal.This addresses overlapping declared ranges. #437 addresses marked pages followed by declared ranges. Neither establishes that a particular in-game visual fault or crash came from this error.
Validation
On M5 Pro / 48 GB, macOS 27.2.1, Wine 11.0 and D3DMetal 4.0b3:
checked 8 overlapping copy-back cases, confirming it reached the host path.git diff --check, passed.Integration with #436 and #437
The three changes were combined locally and the release diagnostics Wine suite passed 36 shadow tests, 0 failed, 4 ignored, including the eight cases here and #437's regression. The ignored mapped capture benchmark passed explicitly and retained a 1.370 ms growing-range median. All-features Windows Clippy also passed.
There is a small source conflict with #436's different snapshot storage. On that layout, keep its
snapshot.covers/changed_piecepath and usesnapshot.refresh(at, host)at the same point as this PR'sold.copy_from_slice(host). The local combined test used that resolution, including fragmented captures. #437's production change is independent; both tests need keeping at the shared insertion point.Prepared and tested with GPT-6.2 Astra. Synthetic test data only.