Menu warm-up: victory play makes host pipelines beside the title at its menus #3744

Closed
github-bot wants to merge 1 commit from github-bot/gh-3744 into main AGit
Owner

@⁠stasadance on GitHub · 2026-11-30 05:51 UTC · original
stasadance:feat/menu-warmup → main · +585 −13 · 8 files · 1 commits · closed without merging

What it changes

victory play now makes host pipelines in the background while the title sits at its menus, so fewer are made in-world.

  • It starts victory warm on a third of the logical cores (at least 2), at idle priority, in a job object with KILL_ON_JOB_CLOSE, so it can never outlive the game.
  • The job ends once frames hold 1000 draws or more for 5 s in a row (the frame meter's draws_per_frame), i.e. once the player is in the world.
  • It goes on from warm-done.txt at the next start.
  • It never touches the host pipeline library (VICTORY_WARM_SHARED taken out). Its slow list goes to slow-pipelines-warm.txt, which into_library reads too, since the game writes slow-pipelines.txt over whole.
  • VICTORY_MENU_WARM (default 1; 0 off; 2 and up: that many processes) is in play's settings and read from victory-settings.txt.

How it was tested

  • GPU and profile: RTX 4090 on Linux (NVIDIA 620.73.04, kron4ek Wine 11.23, vkd3d-proton GE cae8353ed), DLSS + frame generation 2X
  • Before: pipelines known to the cache but not yet made were all made on first use in-world.
  • After: at the menus, the warm made 6,000 of 88,871 known pipelines in 419 s beside the title (10 processes), and the run went on in-world without errors.
  • cargo test passed for the crates it touches: native cargo test cannot build victory-gpu on a Linux host (same on main), so no; cargo xwin clippy for the Windows target adds no warning over current main.

Checked for overlap

  • I searched the open pull requests for the same issue and for the files this touches. Related: #1001 (warm inherits play's settings), #2168 (warm-up restarts under Proton), #1268.
**@⁠stasadance** on GitHub · 2026-11-30 05:51 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3744) `stasadance:feat/menu-warmup` → `main` · +585 −13 · 8 files · 1 commits · closed without merging ## What it changes `victory play` now makes host pipelines in the background while the title sits at its menus, so fewer are made in-world. - It starts `victory warm` on a third of the logical cores (at least 2), at idle priority, in a job object with `KILL_ON_JOB_CLOSE`, so it can never outlive the game. - The job ends once frames hold 1000 draws or more for 5 s in a row (the frame meter's `draws_per_frame`), i.e. once the player is in the world. - It goes on from `warm-done.txt` at the next start. - It never touches the host pipeline library (`VICTORY_WARM_SHARED` taken out). Its slow list goes to `slow-pipelines-warm.txt`, which `into_library` reads too, since the game writes `slow-pipelines.txt` over whole. - `VICTORY_MENU_WARM` (default 1; 0 off; 2 and up: that many processes) is in play's settings and read from `victory-settings.txt`. ## How it was tested - GPU and profile: RTX 4090 on Linux (NVIDIA 620.73.04, kron4ek Wine 11.23, vkd3d-proton GE cae8353ed), DLSS + frame generation 2X - Before: pipelines known to the cache but not yet made were all made on first use in-world. - After: at the menus, the warm made 6,000 of 88,871 known pipelines in 419 s beside the title (10 processes), and the run went on in-world without errors. - `cargo test` passed for the crates it touches: native `cargo test` cannot build `victory-gpu` on a Linux host (same on main), so no; `cargo xwin clippy` for the Windows target adds no warning over current main. ## Checked for overlap - [x] I searched the open pull requests for the same issue and for the files this touches. Related: #1001 (warm inherits play's settings), #2168 (warm-up restarts under Proton), #1268.
play starts `victory warm` (a third of the logical cores, at least 2) at idle
priority in a job object with KILL_ON_JOB_CLOSE, and ends the job once frames
hold 1000 draws or more for 5 s in a row (the frame meter, draws_per_frame).
It goes on from warm-done.txt at the next start. It never touches the host
pipeline library (VICTORY_WARM_SHARED taken out), and its slow list goes to
slow-pipelines-warm.txt, which into_library reads too, since the game writes
slow-pipelines.txt over whole. VICTORY_MENU_WARM (default 1, 0 off, 2 and up:
processes) is in play's settings and read from victory-settings.txt.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-30 05:57:12 +00:00
- Wine's CreateProcess ignores IDLE_PRIORITY_CLASS (kernelbase "ignoring
  some flags"), so warm processes ran as normal ones: wineserver maps NT
  priority onto nice (apply_thread_priority), nice -1 with RLIMIT_NICE 30.
  Each warm process now calls SetPriorityClass(IDLE) on itself (mapped by
  wineserver), and under Wine renices each of its threads to 19 and puts
  them in the idle I/O class through sh (started as a Unix program; our
  pid read from /proc/self/stat, since Wine's double fork hides $PPID).
  At the start and again once its workers or the driver are up.
  VICTORY_WARM_NICE=0 leaves it.
- warm-made.txt: pipelines a warm made, by their library name (a hash of
  the translated code, root signature and state) under the driver, program
  and card, not the translator. A warm process leaves those out, so a
  translator change that gives the same code no longer makes all 88,000
  again. warm-done.txt marks are read as before.
- VICTORY_MENU_FPS (120 by default, 0 off): the frame clock ticks at most
  that often until the world (1000 draws a frame for 5 s, as the menu
  warm-up tells it) or while the menu warm-up runs; off for good after.
- The menu warm-up writes warm-progress.txt; the window title shows
  " | warming 15.0k/88.9k pipelines" while it runs.
Author
Owner

@⁠stasadance on GitHub · 2026-11-30 09:17 UTC · original

Added two commits after running this under Wine:

  • Wine's CreateProcess ignores IDLE_PRIORITY_CLASS, so the warm processes ran at normal priority beside the title. Each warm process now sets its own priority class to IDLE (wineserver maps that), and under Wine one loop holds all of their threads at nice 19 and idle I/O. VICTORY_WARM_NICE=0 leaves them alone.
  • Menu frame cap: the frame clock ticks at most VICTORY_MENU_CAP_FPS (120 by default, 0 off) times a second until the player is in the world or while the warm-up runs, so the menus stop taking a core from the warm. It has its own name; at first it shared one with the frame-rate cap setting.
  • warm-made.txt keys pipelines a warm made by their library name, so a translator change that gives the same code doesn't make all ~88,000 again. The window title shows "warming 15.0k/88.9k pipelines" while it runs.

Tested on an RTX 4090 under kron4ek Wine 11.23 (run 20261130-020521): the menus ran at 119.9-120.1 fps (title bar "120 fps 8.3 ms/frame ... warming 3.6k/88.9k pipelines"), and each warm worker was reniced to 19 within 1-2 s of starting (sampled every 3 s; workers live about 10-40 s each, so a few % of their time is still at the inherited nice). Windows clippy adds no warning over main.

**@⁠stasadance** on GitHub · 2026-11-30 09:17 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3744#issuecomment-7273989660) Added two commits after running this under Wine: - Wine's CreateProcess ignores IDLE_PRIORITY_CLASS, so the warm processes ran at normal priority beside the title. Each warm process now sets its own priority class to IDLE (wineserver maps that), and under Wine one loop holds all of their threads at nice 19 and idle I/O. `VICTORY_WARM_NICE=0` leaves them alone. - Menu frame cap: the frame clock ticks at most `VICTORY_MENU_CAP_FPS` (120 by default, 0 off) times a second until the player is in the world or while the warm-up runs, so the menus stop taking a core from the warm. It has its own name; at first it shared one with the frame-rate cap setting. - `warm-made.txt` keys pipelines a warm made by their library name, so a translator change that gives the same code doesn't make all ~88,000 again. The window title shows "warming 15.0k/88.9k pipelines" while it runs. Tested on an RTX 4090 under kron4ek Wine 11.23 (run 20261130-020521): the menus ran at 119.9-120.1 fps (title bar "120 fps 8.3 ms/frame ... warming 3.6k/88.9k pipelines"), and each warm worker was reniced to 19 within 1-2 s of starting (sampled every 3 s; workers live about 10-40 s each, so a few % of their time is still at the inherited nice). Windows clippy adds no warning over main.
# Conflicts:
#	apps/victory/src/play.rs
#	apps/victory/src/warm.rs
#	crates/victory-gpu/src/pipeline/host.rs
#	crates/victory-gpu/src/pipeline/known.rs
#	crates/victory-gpu/src/pipeline/library.rs
#	crates/victory-hle/src/lib.rs
Author
Owner

@⁠stasadance on GitHub · 2026-12-01 02:13 UTC · original

Merged current main (e1251c3) into this branch (5258c3e). Main independently added done marks by pipeline name (known::made_for, library::name_only, done_names in warm.rs), which duplicated this PR's warm-made.txt skip. I dropped ours and kept main's. What's left is the menu warm-up itself: menu_warm.rs, VICTORY_MENU_WARM, low-priority warm workers beside the title, the menu frame cap and warm progress in the title bar. Main's #4177 preload runs before launch, so it doesn't overlap with this. Windows-target clippy for victory-gpu, victory-hle and victory builds with no new warnings. The in-game run quoted above was on the pre-merge branch.

**@⁠stasadance** on GitHub · 2026-12-01 02:13 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3744#issuecomment-7298374237) Merged current main (e1251c3) into this branch (5258c3e). Main independently added done marks by pipeline name (`known::made_for`, `library::name_only`, `done_names` in `warm.rs`), which duplicated this PR's `warm-made.txt` skip. I dropped ours and kept main's. What's left is the menu warm-up itself: `menu_warm.rs`, `VICTORY_MENU_WARM`, low-priority warm workers beside the title, the menu frame cap and warm progress in the title bar. Main's #4177 preload runs before launch, so it doesn't overlap with this. Windows-target clippy for victory-gpu, victory-hle and victory builds with no new warnings. The in-game run quoted above was on the pre-merge branch.
github-bot force-pushed github-bot/gh-3744 from 5258c3e5e0 to 10e84bba5b 2026-12-01 02:58:43 +00:00 Compare
github-bot closed this pull request 2026-12-01 03:52:11 +00:00
Author
Owner

@⁠stasadance on GitHub · 2026-12-01 03:50 UTC · original

Closing this. Main's preload (#4177) now builds the pipeline book before launch: 12,428 pipelines in 606 s on our 4090 rig, run v11j. That leaves nothing for the menu warm-up or its title-bar progress to do. Thanks to everyone who looked at it.

**@⁠stasadance** on GitHub · 2026-12-01 03:50 UTC · [original](https://github.com/trustno1-coder/VIctory-NVIDIA/pull/3744#issuecomment-7300119075) Closing this. Main's preload (#4177) now builds the pipeline book before launch: 12,428 pipelines in 606 s on our 4090 rig, run v11j. That leaves nothing for the menu warm-up or its title-bar progress to do. Thanks to everyone who looked at it.

Pull request closed

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!3744
No description provided.