Read fills behind placed copies on the card in NVIDIA launches #363

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

@⁠maximecmb on GitHub · 2026-11-27 19:52 UTC · original
maximecmb:perf/nvidia-placed-fill-redirect → main · +39 −1 · 3 files · 1 commits · open

Summary

df01b38 (#344) added two things: a submission now waits for flights when a read left on the CPU depends on a copy at its place whose bytes a flight still writes, and a fill may read that copy's source on the card instead. The second is behind VICTORY_PLACED_FILL_REDIRECT=1, off by default, so the default configuration has the new waits without what avoids most of them.

This sets the switch in scripts\play.ps1 where VICTORY_PLACED_ORDER=1 is set: NVIDIA cards, outside -Safe. -More @{VICTORY_PLACED_FILL_REDIRECT='0'} turns it off again. No Rust changes.

How it was found

A played run on aa917f3 showed the submitting thread waiting 5 to 10 ms a frame for flights in the prison, with most frames having one submission refused by the steps done on the card. Earlier runs had none. Building the commits in between, same 4070tisuper preset and the same copy of a warmed cache, 75 s of the opening cutscene each:

Commit Fills done on the card a frame Submissions refused and waited a frame Waiting for flights
a33271f (before #344) 1,564 0.00 0.7 ms
54bbb7f 1,700 0.00 0.7 ms
df01b38 641 0.30 1.9 ms
10675b5 (#344 merged) 622 0.29 1.6 ms
aa917f3 672 0.26 1.8 ms
aa917f3 with the switch 1,045 0.06 0.9 ms

In play

RTX 5080 16 GB (driver 617.42), Ryzen 7 9800X3D, 64 GB, Series S, diagnostics build of 1d83085, -Machine auto. Three recorded runs of the same prison section, played by hand from the prologue's save, with VICTORY_AB changing the switch every 4 or 5 s. Phases of 3,000 draws a frame or more:

Run Other switch changing with it Frame time with the redirect Cycles faster Refused and waited a frame, off / on Fills on the card a frame, off / on
13 – −1.5 ms (± 0.8) 12 of 16 0.71 / 0.12 101 / 1,577
14 VICTORY_PORT_JOURNAL −2.5 ms (± 2.1) 10 of 13 0.68 / 0.13 89 / 1,909
15 VICTORY_HELPER_PRIORITY −2.8 ms (± 2.2) 9 of 13 0.67 / 0.14 88 / 1,706

Weighted by their errors: −1.7 ms (± 0.7) on frames of 37 to 49 ms, 31 of 42 cycles faster. The frame gains less than the wait it loses: part of that wait is for work of the card the frame needs anyway. No run had an error or lost the device.

What this does not cover

  • One PC, one section. An RTX 5080 with eight cores; the prison and the scenes after it, about 4 minutes of play a run. AMD cards and -Safe are untouched because VICTORY_PLACED_ORDER is not set there.
  • No whole run with the switch held on or off in play. The evidence in play is the in-run alternation. A picture fault that needs more than 4 s of the switch to show would not have been seen.
  • The other two switches. Runs 14 and 15 do not settle them: VICTORY_PORT_JOURNAL −3.0 ms (± 2.3), 8 of 13 cycles faster; VICTORY_HELPER_PRIORITY −1.4 ms (± 3.1), 7 of 13. Not changed here.

Visual review

The three recordings were reviewed from one frame every 7 to 10 s. The prison, the walk with the guard, the common room, the office and the scenes after it look the same in the three, with nothing that comes and goes with the switch's phases at that sampling. In all three the robbery scene that follows has very bright highlights; that was not compared with the switch held off for a whole run. Recordings stay local under the asset policy.

Verification

  • The settings scripts\play.ps1 applies, printed just before launch: VICTORY_PLACED_FILL_REDIRECT=1 under -Machine auto and -Machine 4090; absent under -Safe and -Machine 7900xtx; 0 with the -More override.
  • scripts\play.ps1 parses with no errors; cargo test -p xtask and cargo xtask policy pass.

🤖 Generated with Claude Code

**@⁠maximecmb** on GitHub · 2026-11-27 19:52 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/363) `maximecmb:perf/nvidia-placed-fill-redirect` → `main` · +39 −1 · 3 files · 1 commits · open ## Summary `df01b38` (#344) added two things: a submission now waits for flights when a read left on the CPU depends on a copy at its place whose bytes a flight still writes, and a fill may read that copy's source on the card instead. The second is behind `VICTORY_PLACED_FILL_REDIRECT=1`, off by default, so the default configuration has the new waits without what avoids most of them. This sets the switch in `scripts\play.ps1` where `VICTORY_PLACED_ORDER=1` is set: NVIDIA cards, outside `-Safe`. `-More @{VICTORY_PLACED_FILL_REDIRECT='0'}` turns it off again. No Rust changes. ## How it was found A played run on `aa917f3` showed the submitting thread waiting 5 to 10 ms a frame for flights in the prison, with most frames having one submission refused by the steps done on the card. Earlier runs had none. Building the commits in between, same `4070tisuper` preset and the same copy of a warmed cache, 75 s of the opening cutscene each: | Commit | Fills done on the card a frame | Submissions refused and waited a frame | Waiting for flights | |---|---|---|---| | `a33271f` (before #344) | 1,564 | 0.00 | 0.7 ms | | `54bbb7f` | 1,700 | 0.00 | 0.7 ms | | `df01b38` | 641 | 0.30 | 1.9 ms | | `10675b5` (#344 merged) | 622 | 0.29 | 1.6 ms | | `aa917f3` | 672 | 0.26 | 1.8 ms | | `aa917f3` with the switch | 1,045 | 0.06 | 0.9 ms | ## In play RTX 5080 16 GB (driver 617.42), Ryzen 7 9800X3D, 64 GB, Series S, diagnostics build of `1d83085`, `-Machine auto`. Three recorded runs of the same prison section, played by hand from the prologue's save, with `VICTORY_AB` changing the switch every 4 or 5 s. Phases of 3,000 draws a frame or more: | Run | Other switch changing with it | Frame time with the redirect | Cycles faster | Refused and waited a frame, off / on | Fills on the card a frame, off / on | |---|---|---|---|---|---| | 13 | – | −1.5 ms (± 0.8) | 12 of 16 | 0.71 / 0.12 | 101 / 1,577 | | 14 | `VICTORY_PORT_JOURNAL` | −2.5 ms (± 2.1) | 10 of 13 | 0.68 / 0.13 | 89 / 1,909 | | 15 | `VICTORY_HELPER_PRIORITY` | −2.8 ms (± 2.2) | 9 of 13 | 0.67 / 0.14 | 88 / 1,706 | Weighted by their errors: −1.7 ms (± 0.7) on frames of 37 to 49 ms, 31 of 42 cycles faster. The frame gains less than the wait it loses: part of that wait is for work of the card the frame needs anyway. No run had an error or lost the device. ## What this does not cover - **One PC, one section.** An RTX 5080 with eight cores; the prison and the scenes after it, about 4 minutes of play a run. AMD cards and `-Safe` are untouched because `VICTORY_PLACED_ORDER` is not set there. - **No whole run with the switch held on or off in play.** The evidence in play is the in-run alternation. A picture fault that needs more than 4 s of the switch to show would not have been seen. - **The other two switches.** Runs 14 and 15 do not settle them: `VICTORY_PORT_JOURNAL` −3.0 ms (± 2.3), 8 of 13 cycles faster; `VICTORY_HELPER_PRIORITY` −1.4 ms (± 3.1), 7 of 13. Not changed here. ## Visual review The three recordings were reviewed from one frame every 7 to 10 s. The prison, the walk with the guard, the common room, the office and the scenes after it look the same in the three, with nothing that comes and goes with the switch's phases at that sampling. In all three the robbery scene that follows has very bright highlights; that was not compared with the switch held off for a whole run. Recordings stay local under the asset policy. ## Verification - The settings `scripts\play.ps1` applies, printed just before launch: `VICTORY_PLACED_FILL_REDIRECT=1` under `-Machine auto` and `-Machine 4090`; absent under `-Safe` and `-Machine 7900xtx`; `0` with the `-More` override. - `scripts\play.ps1` parses with no errors; `cargo test -p xtask` and `cargo xtask policy` pass. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
Since df01b38 (#344) a submission waits for flights when a read left on
the CPU depends on a copy at its place whose bytes a flight still
writes. The same change lets such a fill read the copy's source on the
card instead, behind VICTORY_PLACED_FILL_REDIRECT=1, which is off by
default: the default has the waits without what avoids most of them.

On an RTX 5080, same preset and cache, 75 s of the opening cutscene:
before #344 no submission was refused by the card steps (1,564 fills a
frame done on the card); at df01b38 and after, 0.26 to 0.30 a frame
were (622 to 672 fills); with the switch, 0.06 (1,045 fills).

In play (the prison, 3,000 draws a frame and more), with the switch
changed every 4 or 5 s inside three runs: 0.67 to 0.71 submissions a
frame refused and waited with it off, 0.12 to 0.14 with it on, and the
frame 1.7 ms shorter (± 0.7; 31 of 42 cycles faster).

scripts\play.ps1 sets the switch where it sets VICTORY_PLACED_ORDER=1:
NVIDIA cards, outside -Safe. docs/rtx5080-16gb.md has the commits, the
runs and the review of their recordings.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 19:56:16 +00:00
Author
Owner

@⁠TaynanGT on GitHub · 2026-11-27 20:34 UTC · original

Maxime, I reproduced the gain on my RTX 4090 in Series S. Across 11 complete phases per setting, GPU read-through took the same boat scene from 44.25 to 37.91 ms per frame, and all ten consecutive off-to-on pairs improved. Your launcher change and RTX 5080 measurements are now in main through #374, with your commit authorship preserved.

**@⁠TaynanGT** on GitHub · 2026-11-27 20:34 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/363#issuecomment-7227638778) Maxime, I reproduced the gain on my RTX 4090 in Series S. Across 11 complete phases per setting, GPU read-through took the same boat scene from 44.25 to 37.91 ms per frame, and all ten consecutive off-to-on pairs improved. Your launcher change and RTX 5080 measurements are now in main through #374, with your commit authorship preserved.
This pull request can be merged automatically.
This branch is out-of-date with the base branch
The changes on this branch are already on the target branch. This will be an empty commit.
You are not authorized to merge this pull request.
View command line instructions

Checkout

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

Merge

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