GPU: reuse the relay merge scratch and skip fully superseded reads #1350

Open
Marukooh wants to merge 1 commit from upstream-pr/1350 into main
Marukooh commented 2026-11-26 17:33:30 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by Marukooh on 2026-11-26T17:33:30Z.


The GPU-resident buffer relay cleared and initialized its temporary title buffer for each divergent piece. This reuses the initialized prefix within a landing. A successful title read fills the prefix, and on a failed read the scratch is used only to update the CPU shadow. When later or pending uploads cover the entire divergent span, the merge skips the title read.

The change is in card_merge_relay, adjacent to the work in #786. #240 applies a similar idea to scratch in copy_back_with.

Built on e4245f3 for Windows GNU with diagnostics. Ran the extended a_title_byte_sent_after_a_flight_survives_its_slot regression under Proton on RTX 5070 Ti. It exercises reuse of a prefilled larger scratch buffer, preserves a title byte uploaded after an earlier flight, and checks that a fully covered span leaves title memory and scratch untouched.

The earlier Series X prototype showed mixed frame-time improvements. Copy-back byte volume also varied, so a matched in-game comparison on this base is pending. AI-assisted. This patch and its test use synthetic data.

<!-- greyfinch-sync:fxceless/victory-fork:issue:5514595510 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1350). Originally posted by [Marukooh](https://github.com/Marukooh) on 2026-11-26T17:33:30Z. --- The GPU-resident buffer relay cleared and initialized its temporary title buffer for each divergent piece. This reuses the initialized prefix within a landing. A successful title read fills the prefix, and on a failed read the scratch is used only to update the CPU shadow. When later or pending uploads cover the entire divergent span, the merge skips the title read. The change is in `card_merge_relay`, adjacent to the work in #786. #240 applies a similar idea to scratch in `copy_back_with`. Built on e4245f3 for Windows GNU with diagnostics. Ran the extended `a_title_byte_sent_after_a_flight_survives_its_slot` regression under Proton on RTX 5070 Ti. It exercises reuse of a prefilled larger scratch buffer, preserves a title byte uploaded after an earlier flight, and checks that a fully covered span leaves title memory and scratch untouched. The earlier Series X prototype showed mixed frame-time improvements. Copy-back byte volume also varied, so a matched in-game comparison on this base is pending. AI-assisted. This patch and its test use synthetic data.
BitWuehler commented 2026-11-26 23:07:51 +00:00 (Migrated from github.com)

Imported from fxceless/victory-fork. Originally posted by BitWuehler on 2026-11-26T23:07:51Z.


In-world verification on Linux/Proton (CachyOS, GE-Proton11-14 + vkd3d-proton, RTX 5080 16 GB, Series X profile), with b44bf59 merged onto 52ac4ec across 6 Prologue world sessions (VICTORY_RELAY=2, VICTORY_LATE_WAIT=3, VICTORY_MERGE_RUNS=4096):

  • Sustained in-world relay merge load: 131–550 pages looked at, 48,179–1,275,194 changed runs, 2.34–5.27 MB/frame merged under flights' shader writes.
  • 0 merge give-ups across all runs (0 unwatched copy memory, 0 missing write-tracking answers, 0 exceeding VICTORY_MERGE_RUNS, 0 missing PC snapshots).
  • Clean runs and exits (rc=0) with no relay corruption or stability regressions.

(AI-assisted testing, log extraction, and summary.)

<!-- greyfinch-sync:fxceless/victory-fork:comment:7205280148 --> Imported from [fxceless/victory-fork](https://github.com/fxceless/victory-fork/pull/1350#issuecomment-7205280148). Originally posted by [BitWuehler](https://github.com/BitWuehler) on 2026-11-26T23:07:51Z. --- In-world verification on Linux/Proton (CachyOS, GE-Proton11-14 + `vkd3d-proton`, RTX 5080 16 GB, Series X profile), with `b44bf59` merged onto `52ac4ec` across 6 Prologue world sessions (`VICTORY_RELAY=2`, `VICTORY_LATE_WAIT=3`, `VICTORY_MERGE_RUNS=4096`): - Sustained in-world relay merge load: **131–550 pages looked at**, **48,179–1,275,194 changed runs**, **2.34–5.27 MB/frame** merged under flights' shader writes. - **0 merge give-ups** across all runs (`0` unwatched copy memory, `0` missing write-tracking answers, `0` exceeding `VICTORY_MERGE_RUNS`, `0` missing PC snapshots). - Clean runs and exits (`rc=0`) with no relay corruption or stability regressions. *(AI-assisted testing, log extraction, and summary.)*
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/1350:upstream-pr/1350'
git switch 'upstream-pr/1350'

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/1350'
git switch 'upstream-pr/1350'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/1350'
git switch 'upstream-pr/1350'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/1350'
git switch 'main'
git merge --squash 'upstream-pr/1350'
git switch 'main'
git merge --ff-only 'upstream-pr/1350'
git switch 'main'
git merge 'upstream-pr/1350'
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!1350
No description provided.