Avoid loading the complete pipeline recipe book into each warm worker #1647

Closed
opened 2026-11-28 23:01:17 +00:00 by NotADonky43 · 3 comments
NotADonky43 commented 2026-11-28 23:01:17 +00:00 (Migrated from github.com)
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by NotADonky43 on 2026-11-28T23:01:17Z.


On d4b5d517, pipeline/known.rs::walk_pipelines reads the complete known-pipelines.bin into a Vec, even for count/keys or a worker preparing only a small batch. A local 83,549-recipe book is 50,323,407 bytes; warm uses up to 21 independent processes on this machine. This is transient per-scan storage, not a claim about simultaneous peak or FPS. I will test a streaming record walk against the existing scanner for exact ordering, torn tails and peak allocation using synthetic records. No game assets or caches needed. Scope: crates/victory-gpu/src/pipeline/known.rs only; no change to the file format, shader translation, quarantine, or compiler settings. Related #1268 changes early-list selection rather than the scanner.

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:issue:6672199196 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/1647). Originally posted by [NotADonky43](https://github.com/NotADonky43) on 2026-11-28T23:01:17Z. --- On d4b5d517, pipeline/known.rs::walk_pipelines reads the complete known-pipelines.bin into a Vec, even for count/keys or a worker preparing only a small batch. A local 83,549-recipe book is 50,323,407 bytes; warm uses up to 21 independent processes on this machine. This is transient per-scan storage, not a claim about simultaneous peak or FPS. I will test a streaming record walk against the existing scanner for exact ordering, torn tails and peak allocation using synthetic records. No game assets or caches needed. Scope: crates/victory-gpu/src/pipeline/known.rs only; no change to the file format, shader translation, quarantine, or compiler settings. Related #1268 changes early-list selection rather than the scanner.
NotADonky43 commented 2026-11-28 23:01:21 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by NotADonky43 on 2026-11-28T23:01:21Z.


/claim

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7247144179 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/1647#issuecomment-7247144179). Originally posted by [NotADonky43](https://github.com/NotADonky43) on 2026-11-28T23:01:21Z. --- /claim
github-actions[bot] commented 2026-11-28 23:01:31 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by github-actions[bot] on 2026-11-28T23:01:31Z.


Please attach both logs from the run that went wrong. Without them we can only guess. Paste %LOCALAPPDATA% into the address bar of File Explorer to get there.

  1. The play log, in %LOCALAPPDATA%\victory\logs\: the newest victory-nvidia-play-<date>-<time>-<number>.log (from victory.exe) or victory-nvidia-<date>-<time>.log (from the script launcher). The window shows its path at the start, on the line Log: ....
  2. The crash log: %LOCALAPPDATA%\VIctory\data\7952987A\crashes.log, and, if there is one from that run, the newest victory-<date>-<time>-<number>.crash.log in %LOCALAPPDATA%\VIctory\data\7952987A\temp\.

Also say which GPU, Windows version (10 or 11)

<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7247146182 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/1647#issuecomment-7247146182). Originally posted by [github-actions[bot]](https://github.com/apps/github-actions) on 2026-11-28T23:01:31Z. --- Please attach both logs from the run that went wrong. Without them we can only guess. Paste `%LOCALAPPDATA%` into the address bar of File Explorer to get there. 1. The play log, in `%LOCALAPPDATA%\victory\logs\`: the newest `victory-nvidia-play-<date>-<time>-<number>.log` (from `victory.exe`) or `victory-nvidia-<date>-<time>.log` (from the script launcher). The window shows its path at the start, on the line `Log: ...`. 2. The crash log: `%LOCALAPPDATA%\VIctory\data\7952987A\crashes.log`, and, if there is one from that run, the newest `victory-<date>-<time>-<number>.crash.log` in `%LOCALAPPDATA%\VIctory\data\7952987A\temp\`. Also say which GPU, Windows version (10 or 11)
kalberts0089-hash commented 2026-11-29 08:00:56 +00:00 (Migrated from github.com)
Author
Contributor

Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by kalberts0089-hash on 2026-11-29T08:00:56Z.


Confirmed at e1f2eb6. I also tested #1651 against it on this PC (RTX 4070 Ti, 24 threads, Windows 11), using only a synthetic book and no game data. The PR's numbers measure the scanner on its own. These were measured in a real victory warm --these child.

Where it happens

  • crates/victory-gpu/src/pipeline/known.rs:175: walk_pipelines does std::fs::read(dir.join(PIPELINES)), so it reads the whole file. count (:189), keys (:196), make (:245) and book() (:67) all go through it. walk_shaders (:153-170) already streams through a BufReader.
  • apps/victory/src/warm.rs:17 sets AT_ONCE = 40, and child (:212-224) starts a new victory warm --these ... process for each chunk. That process calls known::make (:274), which reads the whole book and keeps only its 40 entries (known.rs:243-249). With 83,549 records that's 2,089 child processes, and each one reads the full book. On this PC jobs = cores*2/3 (warm.rs:79) comes out to 16 at a time.
  • From reading the code only (preload needs the game, so I couldn't measure it): into_library (warm.rs:177-186) runs threads threads in one process, and each calls known::make. So up to threads copies of the book can be in memory at the same time there.
  • Also from reading the code: on a read error, unwrap_or_default() gives end offset 0, and book() (known.rs:71-77) then calls set_len(0) on the file. #1651 changes this to .ok()?.

Measured: one warm child, real victory.exe

Setup:

  • Synthetic book with 83,549 records and 50,296,498 bytes.
  • An empty known-shaders.bin, so no host pipeline is compiled. This measures the scan only, not compiler memory.
  • VICTORY_CACHE_DIR/VICTORY_DATA_DIR pointed at scratch folders.
  • Ran victory warm --these <40 indices> and read peak commit from GetProcessMemoryInfo after the process exited.

Every repeat run landed within 0.1 MiB of these numbers:

build empty book 50 MB book
main e1f2eb6 11.2 MiB 56.2 MiB
#1651 on e1f2eb6 11.2 MiB 11.2 MiB

Same behaviour with #1651

  • victory warm --limit 0 reports 83549 pipelines known on the whole book and 83548 with the last 300 bytes cut off. Main and the PR agree on both.
  • victory warm --these 83500,...,83548 on the cut book gives identical output from main and the PR: 96 lines, and the torn record 83548 is skipped in both.
  • cargo test --locked --release -p victory-gpu --lib pipeline::known: 3 passed.
<!-- greyfinch-sync:trustno1-coder/VIctory-NVIDIA:comment:7252830241 --> Imported from [trustno1-coder/VIctory-NVIDIA](https://github.com/trustno1-coder/VIctory-NVIDIA/issues/1647#issuecomment-7252830241). Originally posted by [kalberts0089-hash](https://github.com/kalberts0089-hash) on 2026-11-29T08:00:56Z. --- Confirmed at e1f2eb6. I also tested #1651 against it on this PC (RTX 4070 Ti, 24 threads, Windows 11), using only a synthetic book and no game data. The PR's numbers measure the scanner on its own. These were measured in a real `victory warm --these` child. **Where it happens** - `crates/victory-gpu/src/pipeline/known.rs:175`: `walk_pipelines` does `std::fs::read(dir.join(PIPELINES))`, so it reads the whole file. `count` (:189), `keys` (:196), `make` (:245) and `book()` (:67) all go through it. `walk_shaders` (:153-170) already streams through a `BufReader`. - `apps/victory/src/warm.rs:17` sets `AT_ONCE = 40`, and `child` (:212-224) starts a new `victory warm --these ...` process for each chunk. That process calls `known::make` (:274), which reads the whole book and keeps only its 40 entries (known.rs:243-249). With 83,549 records that's 2,089 child processes, and each one reads the full book. On this PC `jobs = cores*2/3` (warm.rs:79) comes out to 16 at a time. - From reading the code only (preload needs the game, so I couldn't measure it): `into_library` (warm.rs:177-186) runs `threads` threads in one process, and each calls `known::make`. So up to `threads` copies of the book can be in memory at the same time there. - Also from reading the code: on a read error, `unwrap_or_default()` gives end offset 0, and `book()` (known.rs:71-77) then calls `set_len(0)` on the file. #1651 changes this to `.ok()?`. **Measured: one warm child, real `victory.exe`** Setup: - Synthetic book with 83,549 records and 50,296,498 bytes. - An empty `known-shaders.bin`, so no host pipeline is compiled. This measures the scan only, not compiler memory. - `VICTORY_CACHE_DIR`/`VICTORY_DATA_DIR` pointed at scratch folders. - Ran `victory warm --these <40 indices>` and read peak commit from `GetProcessMemoryInfo` after the process exited. Every repeat run landed within 0.1 MiB of these numbers: | build | empty book | 50 MB book | |---|---|---| | main e1f2eb6 | 11.2 MiB | 56.2 MiB | | #1651 on e1f2eb6 | 11.2 MiB | 11.2 MiB | **Same behaviour with #1651** - `victory warm --limit 0` reports `83549 pipelines known` on the whole book and `83548` with the last 300 bytes cut off. Main and the PR agree on both. - `victory warm --these 83500,...,83548` on the cut book gives identical output from main and the PR: 96 lines, and the torn record 83548 is skipped in both. - `cargo test --locked --release -p victory-gpu --lib pipeline::known`: 3 passed.
Sign in to join this conversation.
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
trustno1-coder/VIctory-NVIDIA#1647
No description provided.