GPU: copy small real buffers in place via plaincopy::copy_buffer #1058

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

@⁠UwUCammie on GitHub · 2026-11-25 17:50 UTC · original
UwUCammie:pr/plaincopy-copy-buffer → main · +55 −5 · 3 files · 1 commits · open

With VICTORY_COPY_PLAIN=1, plaincopy::copy skips everything under 256 bytes (LEAST = 256) so page-existence probes don't keep faulting. That floor also catches real small buffer reads in shadow::copy_back_with, relay_merge, card_merge, and card_merge_relay — in the cell scene that was sending ~4,100 reads/frame back through the kernel copy path.

Adds plaincopy::copy_buffer (same fault guard and 2s faulted-block cache, without the 256-byte floor) and host::read_buffer_into, and routes those four known-buffer read sites through it while leaving general host::read_into / page probes untouched.

Tested on Linux + Wine 11.22 + RX 7900 XT (RADV, VICTORY_COPY_PLAIN=1, VICTORY_RELAY=2, 480 s run into the cell scene):

  • plaincopy small kernel fallbacks dropped from ~4,140/frame to ~62–96/frame (0.0–0.2 faulted reads/frame)
  • Submit thread dropped from ~115 ms to ~96–101 ms (8.5 -> 9.1–9.4 fps, 0 GPUVM faults, picture unchanged)
  • All 5 plaincopy::tests pass under Wine (including a new small-buffer test).
**@⁠UwUCammie** on GitHub · 2026-11-25 17:50 UTC · [original](https://github.com/fxceless/victory-fork/pull/1058) `UwUCammie:pr/plaincopy-copy-buffer` → `main` · +55 −5 · 3 files · 1 commits · open With `VICTORY_COPY_PLAIN=1`, `plaincopy::copy` skips everything under 256 bytes (`LEAST = 256`) so page-existence probes don't keep faulting. That floor also catches real small buffer reads in `shadow::copy_back_with`, `relay_merge`, `card_merge`, and `card_merge_relay` — in the cell scene that was sending ~4,100 reads/frame back through the kernel copy path. Adds `plaincopy::copy_buffer` (same fault guard and 2s faulted-block cache, without the 256-byte floor) and `host::read_buffer_into`, and routes those four known-buffer read sites through it while leaving general `host::read_into` / page probes untouched. Tested on Linux + Wine 11.22 + RX 7900 XT (RADV, `VICTORY_COPY_PLAIN=1`, `VICTORY_RELAY=2`, 480 s run into the cell scene): - `plaincopy` small kernel fallbacks dropped from ~4,140/frame to ~62–96/frame (`0.0–0.2` faulted reads/frame) - Submit thread dropped from ~115 ms to ~96–101 ms (8.5 -> 9.1–9.4 fps, 0 GPUVM faults, picture unchanged) - All 5 `plaincopy::tests` pass under Wine (including a new small-buffer test).
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 03:56:51 +00:00
Author
Owner

@⁠Proudnoob4 on GitHub · 2026-11-25 18:28 UTC · original

Tested on Windows 10 (i5-13600K + RTX 4080 16 GB, Series X, VICTORY_COPY_PLAIN=1) in a stacked live-RT bundle on Xeltax/VIcky 3fbc9cb8 (#1014 + #1015 + #1029 + #1043 + #1044 + #1058 + #1059, 420s vs 300s/600s 3fbc9cb8 baselines):

  • Sub-256 B kernel copy fallbacks: 5,334–6,994/frame (3fbc9cb8) -> 972–2,690/frame in the stacked run (753–779 writes back in place, 33.8–33.9 MB, 0.0 fell back)
  • Combined stack result: world median 3.3 -> 5.05 fps (max 5.7, usual frame 278 -> 176–180 ms), exit 0, clean capture.

Note this run measured #1058 as part of that 7-PR stack rather than standalone; all 5 plaincopy::tests passed locally on Windows 10 before the run.

AI-assisted benchmark and analysis (Gemini 4 Hydrogen).

**@⁠Proudnoob4** on GitHub · 2026-11-25 18:28 UTC · [original](https://github.com/fxceless/victory-fork/pull/1058#issuecomment-7170957005) Tested on Windows 10 (i5-13600K + RTX 4080 16 GB, Series X, `VICTORY_COPY_PLAIN=1`) in a stacked live-RT bundle on `Xeltax/VIcky` `3fbc9cb8` (#1014 + #1015 + #1029 + #1043 + #1044 + #1058 + #1059, 420s vs 300s/600s `3fbc9cb8` baselines): - **Sub-256 B kernel copy fallbacks:** `5,334–6,994`/frame (`3fbc9cb8`) `-> 972–2,690`/frame in the stacked run (`753–779` writes back in place, `33.8–33.9 MB`, `0.0` fell back) - **Combined stack result:** world median `3.3 -> 5.05 fps` (max `5.7`, usual frame `278 -> 176–180 ms`), exit 0, clean capture. Note this run measured #1058 as part of that 7-PR stack rather than standalone; all 5 `plaincopy::tests` passed locally on Windows 10 before the run. *AI-assisted benchmark and analysis (Gemini 4 Hydrogen).*
This pull request has changes conflicting with the target branch.
  • crates/victory-gpu/src/plaincopy.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/1058/head:github-bot/gh-1058'
git switch 'github-bot/gh-1058'

Merge

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