Make requested pipelines known to take long wait for the quick ones #424

Closed
github-bot wants to merge 662 commits from github-bot/gh-424 into main AGit
Owner

@⁠Indy2l on GitHub · 2026-11-28 17:19 UTC · original
Indy2l:perf/requested-slow-pipelines-last → main · +60090 −5430 · 206 files · 662 commits · closed without merging

Summary

A pipeline that a draw requests and that the slow list (slow-pipelines.txt) knows takes long now goes after the quick requested ones and before the unrequested early ones. Before, every requested pipeline joined one first-come queue, so a quick pipeline the screen needed could wait behind compiles of 30 to 90 s. VICTORY_PIPELINE_SLOW_ASKED=0 keeps the old order, and so does VICTORY_PIPELINE_SLOW=0 (no slow list at all). Nothing about how a pipeline is made changes, only when it is made.

This matters right after a translator or driver change. The slow list survives that change, but nothing compiled does. On the prologue route about 460 to 520 pipelines are slow on this PC, 1,450 s of compiling together (see #422 and #423).

RTX 3060 12 GB, i5-12400F, 16 GB, Series S, -Machine 3060 (3 workers)

One build of fe7c6e5 with this change behind the switch. The cache state before each run was identical, copied from one template: the driver's shader cache files for victory.exe removed, and the pipelines folder holding only the early list (1,952) and the slow list (519) of an earlier run, which is the state after a translator change. All runs were recorded and compared at one frame every 10 s. Times count from the first world frame.

Run Order Scene readable Picture correct Back above 5 fps (log)
47 before (=0) only broken fragments until correct about 5 min 10 s about 8 min 05 s
49 this change about 1 min 10 s about 5 min 50 s about 8 min 05 s
48 an earlier variant: slow requested ones on at most all workers but one about 1 min about 9 min 20 s about 9 min

In run 49 the dropped draws fell to the level they keep afterwards, about 290 a frame (the ray-tracing ones), within about 1.5 minutes. Run 47 took about 5 minutes. Between those points the scene in run 49 is recognizable, but its light is not right yet: a glow on faces where light passes are still missing. Run 47 shows black with fragments over the same stretch. Neither matches the console before the slow pipelines exist. This one lets the player see where they are going.

Run 48 is why the slow requested ones are not capped. With one worker held back, it took unrequested early pipelines whenever no quick one was waiting, the slow ones the screen needed waited, and the correct picture came about 4 minutes later. Without a cap, the slow requested ones keep the same order and the same workers as before, so the full picture is not delayed beyond the spread of one pair of runs.

Verification

  • cargo clippy --locked --workspace --all-targets and the same with --all-features: clean.
  • cargo test --locked --workspace: no failures (victory-gpu lib 528 passed).
  • cargo test --locked --workspace --all-features -- --test-threads=1: no failures (victory-gpu lib 595 passed).
  • New test pipeline::make::tests::requested_pipelines_known_to_take_long_go_after_the_quick_ones: quick requested first, slow requested next in the order asked, unrequested last, and the old order with the switch off.
  • cargo run -p xtask --locked -- policy: 322 files ok. git diff --check: clean.
  • Runs as above with scripts\play.ps1 -Machine 3060 -Console series-s -Windowed -More @{VICTORY_OUTPUT='1920x1080'; VICTORY_UPSCALER='6'; VICTORY_RENDER_SCALE='0.5'}, with the switch set per run. Recordings stay local.

Related: #422 (more workers shortens the same wait) and #395 (static samplers in one order, which would keep many of these pipelines between launches and make this matter less after the first).

🤖 Generated with Claude Code

**@⁠Indy2l** on GitHub · 2026-11-28 17:19 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/424) `Indy2l:perf/requested-slow-pipelines-last` → `main` · +60090 −5430 · 206 files · 662 commits · closed without merging ## Summary A pipeline that a draw requests and that the slow list (`slow-pipelines.txt`) knows takes long now goes after the quick requested ones and before the unrequested early ones. Before, every requested pipeline joined one first-come queue, so a quick pipeline the screen needed could wait behind compiles of 30 to 90 s. `VICTORY_PIPELINE_SLOW_ASKED=0` keeps the old order, and so does `VICTORY_PIPELINE_SLOW=0` (no slow list at all). Nothing about how a pipeline is made changes, only when it is made. This matters right after a translator or driver change. The slow list survives that change, but nothing compiled does. On the prologue route about 460 to 520 pipelines are slow on this PC, 1,450 s of compiling together (see #422 and #423). ## RTX 3060 12 GB, i5-12400F, 16 GB, Series S, `-Machine 3060` (3 workers) One build of `fe7c6e5` with this change behind the switch. The cache state before each run was identical, copied from one template: the driver's shader cache files for `victory.exe` removed, and the `pipelines` folder holding only the early list (1,952) and the slow list (519) of an earlier run, which is the state after a translator change. All runs were recorded and compared at one frame every 10 s. Times count from the first world frame. | Run | Order | Scene readable | Picture correct | Back above 5 fps (log) | |---|---|---|---|---| | 47 | before (`=0`) | only broken fragments until correct | about 5 min 10 s | about 8 min 05 s | | 49 | **this change** | **about 1 min 10 s** | about 5 min 50 s | about 8 min 05 s | | 48 | an earlier variant: slow requested ones on at most all workers but one | about 1 min | about 9 min 20 s | about 9 min | In run 49 the dropped draws fell to the level they keep afterwards, about 290 a frame (the ray-tracing ones), within about 1.5 minutes. Run 47 took about 5 minutes. Between those points the scene in run 49 is recognizable, but its light is not right yet: a glow on faces where light passes are still missing. Run 47 shows black with fragments over the same stretch. Neither matches the console before the slow pipelines exist. This one lets the player see where they are going. Run 48 is why the slow requested ones are not capped. With one worker held back, it took unrequested early pipelines whenever no quick one was waiting, the slow ones the screen needed waited, and the correct picture came about 4 minutes later. Without a cap, the slow requested ones keep the same order and the same workers as before, so the full picture is not delayed beyond the spread of one pair of runs. ## Verification - `cargo clippy --locked --workspace --all-targets` and the same with `--all-features`: clean. - `cargo test --locked --workspace`: no failures (`victory-gpu` lib 528 passed). - `cargo test --locked --workspace --all-features -- --test-threads=1`: no failures (`victory-gpu` lib 595 passed). - New test `pipeline::make::tests::requested_pipelines_known_to_take_long_go_after_the_quick_ones`: quick requested first, slow requested next in the order asked, unrequested last, and the old order with the switch off. - `cargo run -p xtask --locked -- policy`: 322 files ok. `git diff --check`: clean. - Runs as above with `scripts\play.ps1 -Machine 3060 -Console series-s -Windowed -More @{VICTORY_OUTPUT='1920x1080'; VICTORY_UPSCALER='6'; VICTORY_RENDER_SCALE='0.5'}`, with the switch set per run. Recordings stay local. Related: #422 (more workers shortens the same wait) and #395 (static samplers in one order, which would keep many of these pipelines between launches and make this matter less after the first). 🤖 Generated with [Claude Code](https://claude.com/claude-code)
A draw waiting for a quick pipeline no longer waits behind compiles of a
minute. With a cold driver cache on an RTX 3060 the scene was drawn about
four minutes sooner and in full no later. VICTORY_PIPELINE_SLOW_ASKED=0
keeps the previous order.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-28 17:22:30 +00:00
Author
Owner

@⁠Kal0s-design on GitHub · 2026-11-29 10:44 UTC · original · reviewed

Read through the queue change and ran it here on Windows (6713de7, rebased on current main already).

The order looks right to me. A slow early pipeline that a draw then asks for is pushed again as REQUESTED and lands in asked_slow. Its old copy in slow is skipped by unclaimed() since its state is no longer EARLY. asked_slow pops don't set was_slow, so they don't eat into the slow limit, and that matches what run 48 argues for. asked_slow_on is set inside workers() before the first worker spawns and before start() takes the queue lock, so nothing is pushed while it's still false. The lock order (queue, then the slow list) is the same one the EARLY path already used.

  • cargo test -p victory-gpu --lib: 528 passed, the new requested_pipelines_known_to_take_long_go_after_the_quick_ones included.
  • cargo clippy -p victory-gpu --all-targets -D warnings: clean.

One small thing for the doc comment: VICTORY_PIPELINE_SLOW=0 now turns this off too, because the same LIMIT_SLOW check gates it. That's probably what you want, but the comment only mentions VICTORY_PIPELINE_SLOW_ASKED=0.

AI-assisted: yes

**@⁠Kal0s-design** on GitHub · 2026-11-29 10:44 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/424#pullrequestreview-6102526148) · **reviewed** Read through the queue change and ran it here on Windows (6713de7, rebased on current main already). The order looks right to me. A slow early pipeline that a draw then asks for is pushed again as REQUESTED and lands in `asked_slow`. Its old copy in `slow` is skipped by `unclaimed()` since its state is no longer EARLY. `asked_slow` pops don't set `was_slow`, so they don't eat into the slow limit, and that matches what run 48 argues for. `asked_slow_on` is set inside `workers()` before the first worker spawns and before `start()` takes the queue lock, so nothing is pushed while it's still false. The lock order (queue, then the slow list) is the same one the EARLY path already used. - `cargo test -p victory-gpu --lib`: 528 passed, the new `requested_pipelines_known_to_take_long_go_after_the_quick_ones` included. - `cargo clippy -p victory-gpu --all-targets -D warnings`: clean. One small thing for the doc comment: `VICTORY_PIPELINE_SLOW=0` now turns this off too, because the same `LIMIT_SLOW` check gates it. That's probably what you want, but the comment only mentions `VICTORY_PIPELINE_SLOW_ASKED=0`. AI-assisted: yes
Author
Owner

@⁠Indy2l on GitHub · 2026-11-29 11:29 UTC · original

Thanks for the review and the run. You're right, the LIMIT_SLOW check controls both paths, and that's intended: with no slow list, nothing is known to take long. The doc comment now says so (39b70e9).

**@⁠Indy2l** on GitHub · 2026-11-29 11:29 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/424#issuecomment-7255149897) Thanks for the review and the run. You're right, the `LIMIT_SLOW` check controls both paths, and that's intended: with no slow list, nothing is known to take long. The doc comment now says so (39b70e9).
Author
Owner

@⁠TaynanGT on GitHub · 2026-11-29 11:37 UTC · original

Thanks for clarifying the empty slow-list behavior and updating the comment in 39b70e9. Please retain coverage for both paths when the list is absent and when it contains known slow pipelines, so the scheduling change remains independent of the worker-count change.

**@⁠TaynanGT** on GitHub · 2026-11-29 11:37 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/424#issuecomment-7255236884) Thanks for clarifying the empty slow-list behavior and updating the comment in 39b70e9. Please retain coverage for both paths when the list is absent and when it contains known slow pipelines, so the scheduling change remains independent of the worker-count change.
Through Queue::push: with the order on and nothing listed, requested
pipelines keep the order they were asked in; once one is listed as slow,
it goes after the quick one.

Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Author
Owner

@⁠Indy2l on GitHub · 2026-11-29 17:09 UTC · original

Added a test for the list side (00a9fb8): requested_pipelines_go_after_the_quick_ones_only_when_listed_as_slow goes through Queue::push, so the slow list decides. With the order on and nothing listed, requested pipelines keep the order they were asked in. Once one key is listed as slow (library::note_time), it goes after the quick one. The existing test still covers the order itself and VICTORY_PIPELINE_SLOW_ASKED=0.

cargo test -p victory-gpu --lib: 529 passed, 0 failed. cargo clippy -p victory-gpu --all-targets -- -D warnings: clean.

**@⁠Indy2l** on GitHub · 2026-11-29 17:09 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/424#issuecomment-7259472352) Added a test for the list side (00a9fb8): `requested_pipelines_go_after_the_quick_ones_only_when_listed_as_slow` goes through `Queue::push`, so the slow list decides. With the order on and nothing listed, requested pipelines keep the order they were asked in. Once one key is listed as slow (`library::note_time`), it goes after the quick one. The existing test still covers the order itself and `VICTORY_PIPELINE_SLOW_ASKED=0`. `cargo test -p victory-gpu --lib`: 529 passed, 0 failed. `cargo clippy -p victory-gpu --all-targets -- -D warnings`: clean.
Author
Owner

@⁠TaynanGT on GitHub · 2026-11-29 19:02 UTC · original

Thanks, the new Queue::push test covers the missing distinction directly, and the reported 529 passing tests and clean Clippy are helpful. Keep this independent of #422 so the scheduling effect can be evaluated separately.

**@⁠TaynanGT** on GitHub · 2026-11-29 19:02 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/424#issuecomment-7260953536) Thanks, the new Queue::push test covers the missing distinction directly, and the reported 529 passing tests and clean Clippy are helpful. Keep this independent of #422 so the scheduling effect can be evaluated separately.
github-bot closed this pull request 2026-11-30 17:08:46 +00:00
Author
Owner

@⁠TaynanGT on GitHub · 2026-11-30 17:07 UTC · original

main has moved to a new line of the code and everything is now named Vice-Tay, so this PR no longer applies as it is (details in #468). If you'd like this change in, please rebuild it on the current main and open a new PR; I'll review it there.

**@⁠TaynanGT** on GitHub · 2026-11-30 17:07 UTC · [original](https://github.com/TaynanGT/Vice-Tay/pull/424#issuecomment-7285765539) `main` has moved to a new line of the code and everything is now named Vice-Tay, so this PR no longer applies as it is (details in #468). If you'd like this change in, please rebuild it on the current `main` and open a new PR; I'll review it there.

Pull request closed

This discussion has been locked. Commenting is limited to contributors.
No description provided.