GPU: avoid re-uploading card data after a waited fetch #496

Open
github-bot wants to merge 1 commit from github-bot/gh-496 into main AGit
Owner

@⁠ryotdev on GitHub · 2026-11-25 01:37 UTC · original
ryotdev:codex/skip-card-echo → main · +109 −43 · 2 files · 1 commits · open

A waited fetch can contain writes made entirely by the GPU. The three-way merge already copies those bytes into title memory and the staging buffer. The next submission used to upload that same range back to the GPU before refreshing its comparison hash.

Track ranges that need an upload separately from ranges that only need a fresh hash. A surviving CPU-only edit still queues the merged span for upload. Earlier pending uploads also keep their place. Both sets of ranges participate in the next 64 KiB piece-hash refresh. Relay retains its existing upload behavior because a later submission can write to the card after the fetch. On current main this optimization applies with VICTORY_RELAY=0. The default relay path receives no bandwidth claim.

Measurement. Two 90-second runs from the same checkpoint on a desktop RTX 5070 (Windows 11, driver 610.88), using one instrumented executable with the change toggled, matched inputs, and independent copies of the same starting cache. The playback build was based on 9ba79ee and used waited fetches. In the last 30 seconds, median upload traffic fell from 169.5 to 99.4 MB/frame and recorded upload ranges from 1,203 to 285/frame. The changed path directly accounted for 58.1 MB/frame in the enabled run. Streaming varied between runs, so this comparison does not establish an FPS improvement.

Verification on main c96b4f2. Added synthetic tests for byte ownership and overlapping hash-only/upload ranges. A separate Windows WARP check failed on the parent for an unnecessary upload and passed here, including a surviving CPU-only edit and the relay-2 fallback. The full diagnostic GPU suite returned 121 passed, one ignored, and one depth-bounds failure also reproduced on the parent. All-feature GPU Clippy and the repository asset policy passed. Default Clippy reports an unused placed_filler_twins in unchanged code.

An additional cross-built Windows all-feature workspace run returned 503 passed, 12 failed and eight ignored. Seven tests depended on build-host paths unavailable to the Windows process, four failed in the unchanged shader suite on WARP, and one was the parent-reproduced depth-bounds case above. The portable core, pipeline and policy tests passed 19/19 when run on their build host.

AI-assisted.

**@⁠ryotdev** on GitHub · 2026-11-25 01:37 UTC · [original](https://github.com/fxceless/victory-fork/pull/496) `ryotdev:codex/skip-card-echo` → `main` · +109 −43 · 2 files · 1 commits · open A waited fetch can contain writes made entirely by the GPU. The three-way merge already copies those bytes into title memory and the staging buffer. The next submission used to upload that same range back to the GPU before refreshing its comparison hash. Track ranges that need an upload separately from ranges that only need a fresh hash. A surviving CPU-only edit still queues the merged span for upload. Earlier pending uploads also keep their place. Both sets of ranges participate in the next 64 KiB piece-hash refresh. Relay retains its existing upload behavior because a later submission can write to the card after the fetch. On current main this optimization applies with `VICTORY_RELAY=0`. The default relay path receives no bandwidth claim. **Measurement.** Two 90-second runs from the same checkpoint on a desktop RTX 5070 (Windows 11, driver 610.88), using one instrumented executable with the change toggled, matched inputs, and independent copies of the same starting cache. The playback build was based on `9ba79ee` and used waited fetches. In the last 30 seconds, median upload traffic fell from 169.5 to 99.4 MB/frame and recorded upload ranges from 1,203 to 285/frame. The changed path directly accounted for 58.1 MB/frame in the enabled run. Streaming varied between runs, so this comparison does not establish an FPS improvement. **Verification on main `c96b4f2`.** Added synthetic tests for byte ownership and overlapping hash-only/upload ranges. A separate Windows WARP check failed on the parent for an unnecessary upload and passed here, including a surviving CPU-only edit and the relay-2 fallback. The full diagnostic GPU suite returned 121 passed, one ignored, and one depth-bounds failure also reproduced on the parent. All-feature GPU Clippy and the repository asset policy passed. Default Clippy reports an unused `placed_filler_twins` in unchanged code. An additional cross-built Windows all-feature workspace run returned 503 passed, 12 failed and eight ignored. Seven tests depended on build-host paths unavailable to the Windows process, four failed in the unchanged shader suite on WARP, and one was the parent-reproduced depth-bounds case above. The portable core, pipeline and policy tests passed 19/19 when run on their build host. AI-assisted.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:44:42 +00:00
This pull request has changes conflicting with the target branch.
  • crates/victory-gpu/src/host.rs
  • crates/victory-gpu/src/shadow.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/496/head:github-bot/gh-496'
git switch 'github-bot/gh-496'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-496'
git switch 'github-bot/gh-496'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-496'
git switch 'github-bot/gh-496'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-496'
git switch 'main'
git merge --squash 'github-bot/gh-496'
git switch 'main'
git merge --ff-only 'github-bot/gh-496'
git switch 'main'
git merge 'github-bot/gh-496'
git push origin 'main'
This discussion has been locked. Commenting is limited to contributors.
No description provided.