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

Closed
maximecmb wants to merge 639 commits from upstream-pr/363 into main
maximecmb commented 2026-11-27 19:52:54 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by maximecmb on 2026-11-27T19:52:54Z.


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

<!-- greyfinch-sync:TaynanGT/Vice-Tay:issue:5532319807 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/363). Originally posted by [maximecmb](https://github.com/maximecmb) on 2026-11-27T19:52:54Z. --- ## 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)
TaynanGT commented 2026-11-27 20:34:40 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by TaynanGT on 2026-11-27T20:34:40Z.


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.

<!-- greyfinch-sync:TaynanGT/Vice-Tay:comment:7227638778 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/363#issuecomment-7227638778). Originally posted by [TaynanGT](https://github.com/TaynanGT) on 2026-11-27T20:34:40Z. --- 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.
maximecmb commented 2026-11-28 08:06:22 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by maximecmb on 2026-11-28T08:06:22Z.


Closing: the launcher change and its measurements are in main through 374, as noted above. Thanks for reproducing it on the RTX 4090. The remaining documentation is in 364, now with main merged in so it differs by the document only.

<!-- greyfinch-sync:TaynanGT/Vice-Tay:comment:7236366285 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/363#issuecomment-7236366285). Originally posted by [maximecmb](https://github.com/maximecmb) on 2026-11-28T08:06:22Z. --- Closing: the launcher change and its measurements are in `main` through 374, as noted above. Thanks for reproducing it on the RTX 4090. The remaining documentation is in 364, now with `main` merged in so it differs by the document only.
TaynanGT commented 2026-11-29 11:25:41 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by TaynanGT on 2026-11-29T11:25:41Z.


Thanks for confirming the launcher change landed through #374 and keeping the documentation separate in #364. The RTX 4090 reproduction was helpful.

<!-- greyfinch-sync:TaynanGT/Vice-Tay:comment:7255104697 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/363#issuecomment-7255104697). Originally posted by [TaynanGT](https://github.com/TaynanGT) on 2026-11-29T11:25:41Z. --- Thanks for confirming the launcher change landed through #374 and keeping the documentation separate in #364. The RTX 4090 reproduction was helpful.

Pull request closed

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
TaynanGT/Vice-Tay!363
No description provided.