Pipeline library: a pipeline made during a save is handed out at once, stored after it (opt-in) #371

Open
github-bot wants to merge 1 commit from github-bot/gh-371 into a-publier AGit
Owner

@⁠Esteban-V on GitHub · 2026-11-26 22:49 UTC · original
Esteban-V:perf/pipeline-library-unblock → a-publier · +181 −9 · 1 files · 1 commits · open

A library save holds saving.write() across GetSerializedSize and Serialize of the whole library (1.3-1.5 GB), at most every 20 s. A pipeline finished meanwhile waits on saving.read() (crates/victory-gpu/src/pipeline/library.rs:570) to be stored before pipeline() returns it, so every compile worker that finishes during a save is blocked and draws miss their wait. docs/findings.md reports 270-660 s of a run with frames over 200 ms, nearly all while pipelines were being made. This adds three switches, all off or unset by default, so a pipeline made during a save can be handed out at once and stored after it.

  • VICTORY_LIBRARY_STORE_LATER=1: when a save holds the library, the pipeline is handed out at once and queued (store_later); the save stores the queue before and after it writes. Lock order stays one_call then saving. No effect with VICTORY_LIBRARY_LOCK=1.
  • VICTORY_LIBRARY=0: no library at all, to measure memory and frames without it (nothing is saved, the early and slow lists included).
  • VICTORY_LIBRARY_SAVE_S=N: save interval, default 20, minimum 5.
  • TRIMMED and LOADED_AT are deliberately not touched after a save, because of the device removals the file header records (runs 72, 73, 82).
  • Default unchanged: with none of the switches set, the library behaves as before.

Known gap: a pipeline queued during the very last save at exit, after its final drain, is handed out but not cached for the next run.

Already merged in DoubleGhosty/cool_fox (4a028f3), whose launcher now turns VICTORY_LIBRARY_STORE_LATER=1 on by default.

Testing

  • Windows CI (windows-latest): Clippy, default tests and diagnostics tests pass (run).
  • Type-checked and clippy-clean for x86_64-pc-windows-msvc on a macOS host (cargo clippy --workspace --all-targets -- -D warnings, default features and --all-features).
  • Unit tests the_save_interval_is_read_with_a_floor and pipelines_made_during_a_save_are_stored_once added.
**@⁠Esteban-V** on GitHub · 2026-11-26 22:49 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/371) `Esteban-V:perf/pipeline-library-unblock` → `a-publier` · +181 −9 · 1 files · 1 commits · open A library save holds `saving.write()` across `GetSerializedSize` and `Serialize` of the whole library (1.3-1.5 GB), at most every 20 s. A pipeline finished meanwhile waits on `saving.read()` (`crates/victory-gpu/src/pipeline/library.rs:570`) to be stored before `pipeline()` returns it, so every compile worker that finishes during a save is blocked and draws miss their wait. `docs/findings.md` reports 270-660 s of a run with frames over 200 ms, nearly all while pipelines were being made. This adds three switches, all off or unset by default, so a pipeline made during a save can be handed out at once and stored after it. - `VICTORY_LIBRARY_STORE_LATER=1`: when a save holds the library, the pipeline is handed out at once and queued (`store_later`); the save stores the queue before and after it writes. Lock order stays `one_call` then `saving`. No effect with `VICTORY_LIBRARY_LOCK=1`. - `VICTORY_LIBRARY=0`: no library at all, to measure memory and frames without it (nothing is saved, the early and slow lists included). - `VICTORY_LIBRARY_SAVE_S=N`: save interval, default 20, minimum 5. - `TRIMMED` and `LOADED_AT` are deliberately not touched after a save, because of the device removals the file header records (runs 72, 73, 82). - Default unchanged: with none of the switches set, the library behaves as before. Known gap: a pipeline queued during the very last save at exit, after its final drain, is handed out but not cached for the next run. Already merged in DoubleGhosty/cool_fox (4a028f3), whose launcher now turns `VICTORY_LIBRARY_STORE_LATER=1` on by default. ## Testing - Windows CI (`windows-latest`): Clippy, default tests and diagnostics tests pass ([run](https://github.com/Esteban-V/VIctory-Belobug-AMD/actions/runs/45916921038)). - Type-checked and clippy-clean for `x86_64-pc-windows-msvc` on a macOS host (`cargo clippy --workspace --all-targets -- -D warnings`, default features and `--all-features`). - Unit tests `the_save_interval_is_read_with_a_floor` and `pipelines_made_during_a_save_are_stored_once` added.
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-27 00:58:40 +00:00
Author
Owner

@⁠MamaLeVrai on GitHub · 2026-11-27 00:22 UTC · original

Tested on an RX 6950 XT 16 GB (RDNA 2), driver 32.0.21045.29003, Windows 11 build 26300, Rust 1.98.1, release, at aaddd49: cargo test --release -p victory-gpu --lib 398 passed, 0 failed, 34 ignored. Not run in the game with VICTORY_LIBRARY_STORE_LATER=1.

AI-assisted (Claude Code); no game data.

**@⁠MamaLeVrai** on GitHub · 2026-11-27 00:22 UTC · [original](https://github.com/Belobug/VIctory-Belobug-AMD/pull/371#issuecomment-7206403256) Tested on an RX 6950 XT 16 GB (RDNA 2), driver 32.0.21045.29003, Windows 11 build 26300, Rust 1.98.1, release, at `aaddd49`: `cargo test --release -p victory-gpu --lib` 398 passed, 0 failed, 34 ignored. Not run in the game with `VICTORY_LIBRARY_STORE_LATER=1`. AI-assisted (Claude Code); no game data.
This pull request can be merged automatically.
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/371/head:github-bot/gh-371'
git switch 'github-bot/gh-371'

Merge

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