perf(pipeline): start a host pipeline when a list being recorded binds it (VICTORY_PIPELINE_KICK, VICTORY_PIPELINE_BOOST; off by default) #637

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

@⁠Raptorbk45 on GitHub · 2026-12-05 22:37 UTC · original
Raptorbk45:perf/pipeline-start-at-bind → main · +193 −7 · 6 files · 1 commits · open

With list calls only written down (list::thin) and translated later, a frame's new pipelines are found one after the other: each draw queues its own host pipeline at translation time and waits for it before the next draw is even looked at. In one long frame we traced, nine new pipelines of 25–90 ms each stood the frame for 344 ms while seven pipeline workers were idle.

  • VICTORY_PIPELINE_KICK=1: SetPipelineState, Reset and list creation (the title's call, before translation) queue the pipeline's host pipeline if it is neither made nor asked for, without waiting and without marking it used. A new queue level KICKED sits between the draw-requested ones and the early (prewarm) ones; a draw asking for it later promotes it as before.
  • VICTORY_PIPELINE_BOOST=1: a non-screen worker making a pipeline that a draw asked for (or, with the kick, a list bound) runs at BELOW_NORMAL instead of LOWEST while it makes it.

Both off by default. With both off nothing is queued at bind (pipeline::kick returns at the switch check), the queue never sees KICKED, and the worker priority is not touched: same behaviour as main. Compared by reading the paths; the only runtime cost when off is one cached OnceLock read per bind.

How it was checked

Run after the final edit, on Linux (CachyOS), against main at 8c4e6633:

  • ./build.sh check (release, MSVC target): passes; the one warning (room_lately never used, resource.rs) is already on main
  • cargo xtask policy: passes
  • cargo test -p victory-core --lib menu (the run.conf.default entries parse): 18 passed
  • PKG=victory-gpu ./build.sh test --lib -- pipeline::make under Wine: 9 passed, the two new ones included

Not run: the game. Nothing here was observed in play on this branch.

Branch head: b42982aa.

New tests in pipeline/make.rs: bound_pipelines_go_between_the_early_and_the_asked_for (queue order and single hand-out; fails to compile/pass without KICKED) and a_bind_starts_the_pipeline_without_waiting_for_it.

Data (old, from our fork, not re-measured on this branch)

On our fork on 2 December 2026 (a base of main from that day plus our own changes), kick + boost against neither, one play session each, frames of 100 ms or more went from 174 to 6 and of 200 ms or more from 6 to 2, at the same average (24.3 fps). Conditions: RX 7700 XT 12 GB, Ryzen 5 5600X, CachyOS, RADV from setup.sh's Mesa, CONSOLE=series-s, 1920x1080, no hardware ray tracing (VICTORY_BVH_HARDWARE=0), VICTORY_FRAME_INTERVAL_MS=0. The route of the two sessions was not fixed and there is one run each, so treat it as indicative. Whether it holds on current main with a fully prepared pipeline cache (first-use waits are rarer then) is not known. Measurements welcome: compare long frame lines and the PipelineWaitUs counter (diagnostics build) with and without the switches.

Cost

A pipeline bound and never drawn is now made anyway (when on). The boost may make workers compete with the translating threads during world entry on small CPUs; that is why it is a separate switch.

Checks

  • One subject (pipelines made earlier for the frame that needs them)
  • New behaviour behind switches, off by default; off = main
  • Docs: docs/SETTINGS.md (experimental speed switches) and run.conf.default
  • Tests named above
  • Queue checked: #627 (prewarm memoization) and #98 touch the same module, different code; independent. Also independent of my VICTORY_PIPELINE_WAIT_MS PR (same file, different functions; both add a test at the end of the tests module, so the second to land needs a trivial rebase)
  • cargo xtask policy
**@⁠Raptorbk45** on GitHub · 2026-12-05 22:37 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/637) `Raptorbk45:perf/pipeline-start-at-bind` → `main` · +193 −7 · 6 files · 1 commits · open With list calls only written down (`list::thin`) and translated later, a frame's new pipelines are found one after the other: each draw queues its own host pipeline at translation time and waits for it before the next draw is even looked at. In one long frame we traced, nine new pipelines of 25–90 ms each stood the frame for 344 ms while seven pipeline workers were idle. - `VICTORY_PIPELINE_KICK=1`: `SetPipelineState`, `Reset` and list creation (the title's call, before translation) queue the pipeline's host pipeline if it is neither made nor asked for, without waiting and without marking it used. A new queue level `KICKED` sits between the draw-requested ones and the early (prewarm) ones; a draw asking for it later promotes it as before. - `VICTORY_PIPELINE_BOOST=1`: a non-screen worker making a pipeline that a draw asked for (or, with the kick, a list bound) runs at `BELOW_NORMAL` instead of `LOWEST` while it makes it. Both off by default. With both off nothing is queued at bind (`pipeline::kick` returns at the switch check), the queue never sees `KICKED`, and the worker priority is not touched: same behaviour as `main`. Compared by reading the paths; the only runtime cost when off is one cached `OnceLock` read per bind. ## How it was checked Run after the final edit, on Linux (CachyOS), against `main` at 8c4e6633: - `./build.sh check` (release, MSVC target): passes; the one warning (`room_lately` never used, `resource.rs`) is already on `main` - `cargo xtask policy`: passes - `cargo test -p victory-core --lib menu` (the `run.conf.default` entries parse): 18 passed - `PKG=victory-gpu ./build.sh test --lib -- pipeline::make` under Wine: 9 passed, the two new ones included Not run: the game. Nothing here was observed in play on this branch. Branch head: `b42982aa`. New tests in `pipeline/make.rs`: `bound_pipelines_go_between_the_early_and_the_asked_for` (queue order and single hand-out; fails to compile/pass without `KICKED`) and `a_bind_starts_the_pipeline_without_waiting_for_it`. ## Data (old, from our fork, not re-measured on this branch) On our fork on 2 December 2026 (a base of `main` from that day plus our own changes), kick + boost against neither, one play session each, frames of 100 ms or more went from 174 to 6 and of 200 ms or more from 6 to 2, at the same average (24.3 fps). Conditions: RX 7700 XT 12 GB, Ryzen 5 5600X, CachyOS, RADV from `setup.sh`'s Mesa, `CONSOLE=series-s`, 1920x1080, **no hardware ray tracing (`VICTORY_BVH_HARDWARE=0`)**, `VICTORY_FRAME_INTERVAL_MS=0`. The route of the two sessions was not fixed and there is one run each, so treat it as indicative. Whether it holds on current `main` with a fully prepared pipeline cache (first-use waits are rarer then) is not known. Measurements welcome: compare `long frame` lines and the `PipelineWaitUs` counter (diagnostics build) with and without the switches. ## Cost A pipeline bound and never drawn is now made anyway (when on). The boost may make workers compete with the translating threads during world entry on small CPUs; that is why it is a separate switch. ## Checks - [x] One subject (pipelines made earlier for the frame that needs them) - [x] New behaviour behind switches, off by default; off = `main` - [x] Docs: `docs/SETTINGS.md` (experimental speed switches) and `run.conf.default` - [x] Tests named above - [x] Queue checked: #627 (prewarm memoization) and #98 touch the same module, different code; independent. Also independent of my `VICTORY_PIPELINE_WAIT_MS` PR (same file, different functions; both add a test at the end of the tests module, so the second to land needs a trivial rebase) - [x] `cargo xtask policy`
github-bot locked as GitHub sync and limited conversation to collaborators 2026-12-05 22:39:15 +00:00
Author
Owner

@⁠Milkhaus-tech on GitHub · 2026-12-06 03:53 UTC · original

RDNA 4 A/B for VICTORY_PIPELINE_KICK=1 + VICTORY_PIPELINE_BOOST=1.

Setup: RX 9060 XT 16 GB (RDNA 4, Navi 44), Ryzen 7 5800X, 32 GB RAM, Ubuntu 26.04 (kernel 7.0.0-44), repo Mesa 26.3.1 RADV, GE-Proton11-11, resizable BAR on. Series X profile, potato preset, 1920x1080 output, VICTORY_FSR_4K=balanced, ML frame generation, ray tracing off.

Method: VICTORY_BENCH_ROUTE=downtown, with the same save restored before each run. I measured route start +30 s to +330 s from the stats: frame 5 s windows (about 59 per run). Rendered fps is shown; generated frames are not counted. "p10" is the 10th-percentile 5 s window. One arm per run; the arms were interleaved, not all A then all B. The default arm varied from 31.6 to 33.4 fps over 8 runs, so differences under about 2 fps are noise.

Build: main @ 8c4e663 + #596 + #637 + #639 (runs 1-2). For run 3, #611, #599 and #626 were also merged, all with switches off. Every pipeline was prepared before the game started, and no run had a pipeline built live.

Arm Runs avg fps p10 worst 5 s frames >50 ms /min frames >100 ms /min
default 8 31.6-33.4 (mean 32.5) 19.3-23.7 14.3-20.2 93-139 2.4-5.1 (mean 3.4)
KICK+BOOST 3 33.5, 32.3, 31.5 (mean 32.4) 23.8, 23.6, 23.0 17.7, 17.0, 19.1 86, 111, 121 1.0, 2.4, 2.0 (mean 1.8)

The average frame rate didn't change. Frames over 100 ms were about half the default rate, and the p10 window was consistently at the top of the default range. With a full pipeline cache, this route has no first-use misses, so I'd expect the gain to be larger in a session with a cold cache. Visuals matched the default in screenshots. No errors or crashes.

**@⁠Milkhaus-tech** on GitHub · 2026-12-06 03:53 UTC · [original](https://github.com/lobomfz/VIctory-xmem/pull/637#issuecomment-7451070612) RDNA 4 A/B for `VICTORY_PIPELINE_KICK=1` + `VICTORY_PIPELINE_BOOST=1`. **Setup:** RX 9060 XT 16 GB (RDNA 4, Navi 44), Ryzen 7 5800X, 32 GB RAM, Ubuntu 26.04 (kernel 7.0.0-44), repo Mesa 26.3.1 RADV, GE-Proton11-11, resizable BAR on. Series X profile, potato preset, 1920x1080 output, `VICTORY_FSR_4K=balanced`, ML frame generation, ray tracing off. **Method:** `VICTORY_BENCH_ROUTE=downtown`, with the same save restored before each run. I measured route start +30 s to +330 s from the `stats: frame` 5 s windows (about 59 per run). Rendered fps is shown; generated frames are not counted. "p10" is the 10th-percentile 5 s window. One arm per run; the arms were interleaved, not all A then all B. The default arm varied from 31.6 to 33.4 fps over 8 runs, so differences under about 2 fps are noise. Build: `main` @ `8c4e663` + #596 + #637 + #639 (runs 1-2). For run 3, #611, #599 and #626 were also merged, all with switches off. Every pipeline was prepared before the game started, and no run had a pipeline built live. | Arm | Runs | avg fps | p10 | worst 5 s | frames >50 ms /min | frames >100 ms /min | |---|---|---|---|---|---|---| | default | 8 | 31.6-33.4 (mean 32.5) | 19.3-23.7 | 14.3-20.2 | 93-139 | 2.4-5.1 (mean 3.4) | | KICK+BOOST | 3 | 33.5, 32.3, 31.5 (mean 32.4) | 23.8, 23.6, 23.0 | 17.7, 17.0, 19.1 | 86, 111, 121 | **1.0, 2.4, 2.0** (mean 1.8) | The average frame rate didn't change. Frames over 100 ms were about half the default rate, and the p10 window was consistently at the top of the default range. With a full pipeline cache, this route has no first-use misses, so I'd expect the gain to be larger in a session with a cold cache. Visuals matched the default in screenshots. No errors or crashes.
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/637/head:github-bot/gh-637'
git switch 'github-bot/gh-637'

Merge

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