queue: flights that may write pages land before a page-mapping copy remaps them #631

Manually merged
github merged 4 commits from github-bot/gh-631 into main 2026-11-28 19:43:15 +00:00 AGit
Owner

@⁠KhryptorGraphics on GitHub · 2026-11-28 02:05 UTC · original
KhryptorGraphics:port/open-world-slot → main · +114 −5 · 2 files · 4 commits · merged 2026-11-28 19:39 UTC

Ported from Steenax6/VIctory-NVID (GPL-3.0), commit 20315a5, plus one switch of that fork's open-world work. One of a series of ports from sibling forks (#618 to #622).

What changes

  • Flights land before a page remap (on by default). Before each batch of the title's CopyPageMappingsBatchX, flights in the air whose shaders may write the batch's addresses land first (host::land_before_remap). Landed after the remap, their writes went to the pages mapped in their place. VICTORY_LAND_BEFORE_REMAP=0 turns it off; the source fork has no off switch.
  • VICTORY_REMAP_SYNC=1 (off by default). Runs the queues' line before a page-mapping copy. Under the launcher set it with victory play --set VICTORY_REMAP_SYNC=1.
  • The frame-rate line gains a count, "pages remapped under flights' writes".

The source fork's texture-slot change (a slot shows a new texture only after its upload ran) is not in this PR: this tree already has its own form of it.

Verification

  • cargo check -p victory-gpu --target x86_64-pc-windows-msvc --tests passes, with and without --features diagnostics, with no new warnings. This was a cross-check from Linux.
  • The function body was compared against the source commit and matches apart from the off switch.
  • Not run: clippy, the test suite, and the game. The source fork's claim (22 minutes in the open world without a device loss, RTX 4070 Ti) is theirs and is not reproduced here. The cost on the title's streaming threads is unmeasured.

No test is added; the source has none for this function.

**@⁠KhryptorGraphics** on GitHub · 2026-11-28 02:05 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/631) `KhryptorGraphics:port/open-world-slot` → `main` · +114 −5 · 2 files · 4 commits · merged 2026-11-28 19:39 UTC Ported from Steenax6/VIctory-NVID (GPL-3.0), commit 20315a5, plus one switch of that fork's open-world work. One of a series of ports from sibling forks (#618 to #622). ## What changes - **Flights land before a page remap (on by default).** Before each batch of the title's `CopyPageMappingsBatchX`, flights in the air whose shaders may write the batch's addresses land first (`host::land_before_remap`). Landed after the remap, their writes went to the pages mapped in their place. `VICTORY_LAND_BEFORE_REMAP=0` turns it off; the source fork has no off switch. - **`VICTORY_REMAP_SYNC=1` (off by default).** Runs the queues' line before a page-mapping copy. Under the launcher set it with `victory play --set VICTORY_REMAP_SYNC=1`. - The frame-rate line gains a count, "pages remapped under flights' writes". The source fork's texture-slot change (a slot shows a new texture only after its upload ran) is not in this PR: this tree already has its own form of it. ## Verification - `cargo check -p victory-gpu --target x86_64-pc-windows-msvc --tests` passes, with and without `--features diagnostics`, with no new warnings. This was a cross-check from Linux. - The function body was compared against the source commit and matches apart from the off switch. - **Not run:** clippy, the test suite, and the game. The source fork's claim (22 minutes in the open world without a device loss, RTX 4070 Ti) is theirs and is not reproduced here. The cost on the title's streaming threads is unmeasured. No test is added; the source has none for this function.
With the switch, what the queues' line holds and is free to run is run
from the caller's thread (before_sync) before each of the title's
CopyPageMappingsBatchX calls. Off, nothing changes.

Ported from Steenax6/VIctory-NVID 9e7edae, df2c40c and b63c115. There it
was a stop-gap for a day for the host device lost at the open world's
entry (removal reason: hung): 34 of 115 entries lost without it, 1 of
about 65 with it, why not known. It was turned off again because it held
the title's streaming threads for 41 ms a frame while the player moves
(single calls up to 345 ms). After texture slots showed a new texture only
once its upload had run on the card, 16 entries without it lost none. That
fork names it the first thing to turn on if the loss comes back.

The slot change itself (Steenax6/VIctory-NVID de6d8d7, 9952466, 0ef1c34)
is not ported: this tree has its own form of it in
descriptor/host.rs (show_after, show_new_later, the flips, the kept
views, VICTORY_TEXTURE_AWAY_MS), which the launchers turn on.

Not run in the game here; whether the switch matters in this tree is not
measured.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Before each batch of the title's CopyPageMappingsBatchX calls, after the
optional run of the queues' line (VICTORY_REMAP_SYNC=1), the flights in
the air whose shaders may write the batch's addresses land first
(host::land_before_remap). Landed after the remap, what they wrote went to
the pages mapped in their place, another resource's. With the relay the
caller waits only until no flight that may write there is in the air or
being landed; without it everything in the air is settled, as at a
present. With nothing in the air that touches the range nothing is waited
for.

Ported from Steenax6/VIctory-NVID 20315a5 (GPL-3.0), with its count in the
frame-rate line ("pages remapped under flights' writes"). The function is
as there. This tree's line of flights holds the same things: `written` is
the flights' declared shader writes, which here take in the copies done on
the card (VICTORY_CARD_STEPS: their list declares the destination) and the
texture read-backs; `settling` and the thread that lands flights work
`written` out anew the same way.

Not as there: that fork lands unconditionally. Here it is on by default
and VICTORY_LAND_BEFORE_REMAP=0 leaves it out, because it changes what
every page-mapping copy does and was not run in the game here. The remap_sync
note, which said this tree lacks the step, says what holds now. That fork
has no test for it; none added.

The call holds none of our locks (not CARD_WORK, not QUEUE_ORDER, not the
submission lock): it is made from the title's thread as the settle for a
fence is. It is not reachable from the thread that lands flights or the
helper thread, which it would wait for.

Checked only by cargo check for x86_64-pc-windows-msvc with --tests, with
and without the diagnostics feature (no new warnings). Tests cannot run on
this machine and the game was not run.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 02:09:26 +00:00
github-bot referenced this pull request from a commit 2026-11-28 19:41:56 +00:00
github manually merged commit 1d9b492fe8 into main 2026-11-28 19:43:15 +00:00
This discussion has been locked. Commenting is limited to contributors.
No reviewers
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.

Dependencies

No dependencies set

Reference
github/trustno1-coder--VIctory-NVIDIA!631
No description provided.