Repository navigation
Count completed copyback bytes and refresh partly copied pages - #1
Open
MichaelSmithAI wants to merge 1 commit into
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.
On the branch for VIctory #322, the kernel copy can write the accessible parts of a buffer and skip a read-only subpage.
Shadow::copy_backstill adds the whole requested length to its count and marks the shadow current. A subsequent refresh can then skip the bytes where guest and host differ.This change returns the kernel-reported byte count, resumes retries after the prefix already copied and marks a page stale if the read or write was incomplete. A full successful copy retains the existing freshness behavior.
I checked the team's red/green runs on an RTX 4090 under Wine and vkd3d-proton. With a read-only 4 KiB subpage inside a 64 KiB buffer, the parent retained freshness epoch 2. With this change, the accessible 60 KiB were counted, the protected data remained intact, and the subsequent refresh read back the guest's value. Three focused tests passed. The tests also cover a destination with an unmapped hole, an initially refused read, unchanged data, and a simulated partially successful kernel copy. The nonzero-prefix case was simulated because this Wine version reported zero at the first refused range.
Run
cargo test --locked -p victory-gpu --lib copy_back -- --nocapture --test-threads=1. The shadow test printscopy-back shadow refresh control completedafter its assertions. Asset policy passed. Native Windows and retail runs remain pending. This targets Marvisak#322's current shadow implementation; Marvisak#261 and Marvisak#693 separately change that loop and would require reconciliation.AI-assisted.