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

Open
UwUCammie wants to merge 1 commit from upstream-pr/1058 into main
UwUCammie commented 2026-11-25 17:50:57 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by UwUCammie on 2026-11-25T17:50:57Z.


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).
<!-- greyfinch-sync:fxceless/victory-fork:issue:6610399180 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1058). Originally posted by [UwUCammie](https://github.com/UwUCammie) on 2026-11-25T17:50:57Z. --- 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).
Proudnoob4 commented 2026-11-25 19:09:45 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by Proudnoob4 on 2026-11-25T18:28:30Z.


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).

<!-- greyfinch-sync:fxceless/victory-fork:comment:7170957005 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1058#issuecomment-7170957005). Originally posted by [Proudnoob4](https://github.com/Proudnoob4) on 2026-11-25T18:28:30Z. --- 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 cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/1058:upstream-pr/1058'
git switch 'upstream-pr/1058'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/1058'
git switch 'upstream-pr/1058'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/1058'
git switch 'upstream-pr/1058'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/1058'
git switch 'main'
git merge --squash 'upstream-pr/1058'
git switch 'main'
git merge --ff-only 'upstream-pr/1058'
git switch 'main'
git merge 'upstream-pr/1058'
git push origin 'main'
Sign in to join this conversation.
No reviewers
No labels
No milestone
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Reference
fxceless/victory-fork!1056
No description provided.