victory warm --waited: the book's compute pipelines and screen passes no run drew with, made ahead (re-land of #2580's safe part) #4257

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

@⁠Lyrnc on GitHub · 2026-11-30 17:51 UTC · original
Lyrnc:perf/warm-waited → main · +63 −4 · 4 files · 1 commits · open

Problem

  • #2580 removed the 3-11 s compile freezes (one compute pipeline took 8.5 s in the driver on an RTX 4090).
  • It was reverted (3fa588eb) because a first run from an empty cache drew every shadowed surface black until restart. VICTORY_PIPELINE_WAIT_COMPILES=1 (the graphics half's switch) did not prevent it.
  • The compute half let a dispatch wait at most VICTORY_PIPELINE_COMPILE_GRACE_MS (50 ms) once its build reached the driver's compiler, then dropped it. A program the title dispatches once (an indirect-light or probe initialisation, a buffer reset at a scene change) then never writes its result. That fits the symptom: dark until restart, and not prevented by the graphics switch.

Root cause of the bug, and what is left

  • Any runtime change that shortens a dispatch's wait drops a one-shot dispatch. Nothing in a run tells a one-shot program from one dispatched every frame. So the compute half cannot come back in any form that drops dispatches.
  • What remains safe is making those pipelines before the run asks for them. #2580 had that part too: victory warm --waited, run by the launcher before the game when VICTORY_WARM_WAITED=1.

Fix

Kajcsi's --waited from c9ffe60a, unchanged except where main moved.

  • known::waited(dir) returns the book's compute pipelines, and its passes over the screen without a mesh stage (the same test as make::Pending's screen).
  • victory warm --waited makes those of them that no earlier run drew with. The ones earlier runs drew with already load from the library. It conflicts with --used.
    • Main's warm now names pipelines in a candidates step (to_make, #2731). The --waited filter moved into that step. Everything else is as in c9ffe60a.
  • scripts/play-nvidia.ps1 (the launcher was play-foxhound.ps1 in c9ffe60a; 84bd61e2 renamed it): with VICTORY_WARM_WAITED=1 (off by default, and not with -WarmUsed), it runs warm --waited before the game, with VICTORY_PRELOAD_JOBS as --jobs. Pipelines made before are skipped, so a later start spends about a second there.

Not re-landed:

  • the dispatch grace and the "hurry" threads (the black-shadow bug);
  • the screen-pass grace (ours #3788 covers the 10 s screen waits differently);
  • the graphics half. perf/first-use-stalls has a safer form of it: draws that have a fallback wait 100 ms once, and dispatches and screen passes keep their waits.

In perf/first-use-stalls, a dispatch that blocks on a worker's build raises that worker to the title's priority and moves it to the front of the queue. The dispatch still waits. That shortens the compute stalls without dropping anything.

Verification

On 189c5eb2, in a build slot, with its own target directory:

  • cargo clippy -p victory -p victory-gpu --all-targets --locked -j 4: builds. No warning in warm.rs, main.rs or known.rs. The three it gives are on main's lines (host.rs:5092, shadow.rs:7197, xmem.rs:1933).
  • It merges without conflicts with perf/first-use-stalls and with #3347's rework, and adds no conflicting file to #3744, #3974 or #3581: those already conflict with main in the same files.
  • The script part was not run.

NOT tested

  • Not run at all, neither warm --waited on the title's book nor the launcher path. Not checked:
    • how many pipelines it makes;
    • how long that takes on a cold driver cache;
    • whether a run then has fewer compute and screen-pass freezes.
  • No unit test for known::waited / waited_entry (none in c9ffe60a either). It reads the book's entry format the same way known.rs's other readers do.
  • Bench steps:
    1. Cold cache: empty the pipeline folder, keep cache\shaders.
    2. Run victory warm --waited --jobs 6 on an idle PC. Note its "--waited: N known, M no run drew with" line and the time it takes.
    3. Run the cutscene/shootout route with RT on (VICTORY_BVH_BUILDER=1) and RT off. Compare with a run without step 2: frames over 1 s, and the compute part of the pipeline waits (#3703's long-frame line).
    4. Then check the shadowed spot at 240, 290 and 330 s, the maintainer's check. Nothing here drops a dispatch, so it should look like main.

Overlap

  • #2580 (Kajcsi): merged, then reverted (3fa588eb). This is its --waited part, with its author.
  • #3347 (ours, reworked tonight): the compile memory admission is on in victory warm processes by default. So warm --waited's processes are admitted by memory, as #4017 wants.
  • #3744 (stasadance, open): menu warm-up, which makes host pipelines beside the title at its menus. It touches warm.rs, main.rs and known.rs too. It is a different selection (at the menu, in the run's own process), and the two can coexist.
  • #3581 (BaRian29, open): the launcher makes every pipeline ahead, then plays (launcher.rs, play.rs). Broader and slower. It does not touch play-foxhound.ps1.
  • #3974 (danielsteman, open): masked twins booked (known.rs, pipeline.rs). Different functions.

AI use

Claude Code (Claude Opus 5.5) re-applied Kajcsi's commit onto current main, resolved the conflict in warm.rs, ran the checks listed above, and wrote this note. Nothing was run in game.

🤖 Generated with Claude Code

**@⁠Lyrnc** on GitHub · 2026-11-30 17:51 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/4256) `Lyrnc:perf/warm-waited` → `main` · +63 −4 · 4 files · 1 commits · open ## Problem - #2580 removed the 3-11 s compile freezes (one compute pipeline took 8.5 s in the driver on an RTX 4090). - It was reverted (3fa588eb) because a first run from an empty cache drew every shadowed surface black until restart. `VICTORY_PIPELINE_WAIT_COMPILES=1` (the graphics half's switch) did not prevent it. - The compute half let a dispatch wait at most `VICTORY_PIPELINE_COMPILE_GRACE_MS` (50 ms) once its build reached the driver's compiler, then dropped it. A program the title dispatches once (an indirect-light or probe initialisation, a buffer reset at a scene change) then never writes its result. That fits the symptom: dark until restart, and not prevented by the graphics switch. ## Root cause of the bug, and what is left - **Any runtime change that shortens a dispatch's wait drops a one-shot dispatch.** Nothing in a run tells a one-shot program from one dispatched every frame. So the compute half cannot come back in any form that drops dispatches. - What remains safe is making those pipelines **before** the run asks for them. #2580 had that part too: `victory warm --waited`, run by the launcher before the game when `VICTORY_WARM_WAITED=1`. ## Fix Kajcsi's `--waited` from c9ffe60a, unchanged except where main moved. - `known::waited(dir)` returns the book's compute pipelines, and its passes over the screen without a mesh stage (the same test as `make::Pending`'s `screen`). - `victory warm --waited` makes those of them that no earlier run drew with. The ones earlier runs drew with already load from the library. It conflicts with `--used`. - Main's warm now names pipelines in a candidates step (`to_make`, #2731). The `--waited` filter moved into that step. Everything else is as in c9ffe60a. - `scripts/play-nvidia.ps1` (the launcher was `play-foxhound.ps1` in c9ffe60a; 84bd61e2 renamed it): with `VICTORY_WARM_WAITED=1` (off by default, and not with `-WarmUsed`), it runs `warm --waited` before the game, with `VICTORY_PRELOAD_JOBS` as `--jobs`. Pipelines made before are skipped, so a later start spends about a second there. Not re-landed: - the dispatch grace and the "hurry" threads (the black-shadow bug); - the screen-pass grace (ours #3788 covers the 10 s screen waits differently); - the graphics half. `perf/first-use-stalls` has a safer form of it: draws that have a fallback wait 100 ms once, and dispatches and screen passes keep their waits. In `perf/first-use-stalls`, a dispatch that blocks on a worker's build raises that worker to the title's priority and moves it to the front of the queue. The dispatch still waits. That shortens the compute stalls without dropping anything. ## Verification On 189c5eb2, in a build slot, with its own target directory: - `cargo clippy -p victory -p victory-gpu --all-targets --locked -j 4`: builds. No warning in `warm.rs`, `main.rs` or `known.rs`. The three it gives are on main's lines (`host.rs:5092`, `shadow.rs:7197`, `xmem.rs:1933`). - It merges without conflicts with `perf/first-use-stalls` and with #3347's rework, and adds no conflicting file to #3744, #3974 or #3581: those already conflict with main in the same files. - The script part was not run. ## NOT tested - **Not run at all**, neither `warm --waited` on the title's book nor the launcher path. Not checked: - how many pipelines it makes; - how long that takes on a cold driver cache; - whether a run then has fewer compute and screen-pass freezes. - No unit test for `known::waited` / `waited_entry` (none in c9ffe60a either). It reads the book's entry format the same way `known.rs`'s other readers do. - **Bench steps:** 1. Cold cache: empty the pipeline folder, keep `cache\shaders`. 2. Run `victory warm --waited --jobs 6` on an idle PC. Note its "--waited: N known, M no run drew with" line and the time it takes. 3. Run the cutscene/shootout route with RT on (`VICTORY_BVH_BUILDER=1`) and RT off. Compare with a run without step 2: frames over 1 s, and the compute part of the pipeline waits (#3703's long-frame line). 4. Then check the shadowed spot at 240, 290 and 330 s, the maintainer's check. Nothing here drops a dispatch, so it should look like main. ## Overlap - #2580 (Kajcsi): merged, then reverted (3fa588eb). This is its `--waited` part, with its author. - #3347 (ours, reworked tonight): the compile memory admission is on in `victory warm` processes by default. So `warm --waited`'s processes are admitted by memory, as #4017 wants. - #3744 (stasadance, open): menu warm-up, which makes host pipelines beside the title at its menus. It touches `warm.rs`, `main.rs` and `known.rs` too. It is a different selection (at the menu, in the run's own process), and the two can coexist. - #3581 (BaRian29, open): the launcher makes every pipeline ahead, then plays (`launcher.rs`, `play.rs`). Broader and slower. It does not touch `play-foxhound.ps1`. - #3974 (danielsteman, open): masked twins booked (`known.rs`, `pipeline.rs`). Different functions. ## AI use Claude Code (Claude Opus 5.5) re-applied Kajcsi's commit onto current main, resolved the conflict in `warm.rs`, ran the checks listed above, and wrote this note. Nothing was run in game. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
The part of #2580 (c9ffe60a, "Stop freezing on compute and screen-pass
compiles") that changes nothing in a run: the rest of that PR was
reverted in 3fa588eb, because a dispatch dropped 50 ms into its compile
left a cold run's shadowed surfaces black.

A run waits for a compute pipeline at its dispatch, and for a pass over
the screen up to 10 s; a compile of its own froze the game 3 to 11 s at a
time (one compute pipeline took 8.5 s in the driver, RTX 4090). Ahead of
a run, `victory warm --waited` makes the book's compute pipelines and
passes over the screen that no earlier run drew with (those load from the
library), each batch in a process of its own, so that the driver has them
when a dispatch or pass first asks. The launcher runs it before the game
when VICTORY_WARM_WAITED=1 (off by default). Those made before are
skipped, so a later start spends a second here.

Re-landed from c9ffe60a by Lyrnc: warm.rs's filter now sits in the
candidates step that main's warm names pipelines in.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-30 18:09:32 +00:00
github-bot force-pushed github-bot/gh-4256 from 189c5eb2f6 to e3e5243f9d 2026-12-01 05:40:43 +00:00 Compare
This pull request can be merged automatically.
This branch is out-of-date with the base branch
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/4257/head:github-bot/gh-4256'
git switch 'github-bot/gh-4256'

Merge

Merge the changes and update on Forgejo.
git switch 'main'
git merge --no-ff 'github-bot/gh-4256'
git switch 'github-bot/gh-4256'
git rebase 'main'
git switch 'main'
git merge --ff-only 'github-bot/gh-4256'
git switch 'github-bot/gh-4256'
git rebase 'main'
git switch 'main'
git merge --no-ff 'github-bot/gh-4256'
git switch 'main'
git merge --squash 'github-bot/gh-4256'
git switch 'main'
git merge --ff-only 'github-bot/gh-4256'
git switch 'main'
git merge 'github-bot/gh-4256'
git push origin 'main'
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!4257
No description provided.