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

Closed
Indy2l wants to merge 662 commits from upstream-pr/424 into main
Indy2l commented 2026-11-28 17:19:39 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by Indy2l on 2026-11-28T17:19:39Z.


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

<!-- greyfinch-sync:TaynanGT/Vice-Tay:issue:5542723634 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/424). Originally posted by [Indy2l](https://github.com/Indy2l) on 2026-11-28T17:19:39Z. --- ## 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)
Kal0s-design commented 2026-11-29 10:44:47 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by Kal0s-design on 2026-11-29T10:44:47Z.

Review: COMMENTED


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

<!-- greyfinch-sync:TaynanGT/Vice-Tay:review:6102526148 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/424#pullrequestreview-6102526148). Originally posted by [Kal0s-design](https://github.com/Kal0s-design) on 2026-11-29T10:44:47Z. **Review:** COMMENTED --- 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
Indy2l commented 2026-11-29 11:29:44 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by Indy2l on 2026-11-29T11:29:44Z.


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).

<!-- greyfinch-sync:TaynanGT/Vice-Tay:comment:7255149897 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/424#issuecomment-7255149897). Originally posted by [Indy2l](https://github.com/Indy2l) on 2026-11-29T11:29:44Z. --- 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).
TaynanGT commented 2026-11-29 11:37:21 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by TaynanGT on 2026-11-29T11:37:21Z.


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.

<!-- greyfinch-sync:TaynanGT/Vice-Tay:comment:7255236884 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/424#issuecomment-7255236884). Originally posted by [TaynanGT](https://github.com/TaynanGT) on 2026-11-29T11:37:21Z. --- 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.
Indy2l commented 2026-11-29 17:09:47 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by Indy2l on 2026-11-29T17:09:47Z.


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.

<!-- greyfinch-sync:TaynanGT/Vice-Tay:comment:7259472352 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/424#issuecomment-7259472352). Originally posted by [Indy2l](https://github.com/Indy2l) on 2026-11-29T17:09:47Z. --- 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.
TaynanGT commented 2026-11-29 19:02:06 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by TaynanGT on 2026-11-29T19:02:06Z.


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.

<!-- greyfinch-sync:TaynanGT/Vice-Tay:comment:7260953536 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/424#issuecomment-7260953536). Originally posted by [TaynanGT](https://github.com/TaynanGT) on 2026-11-29T19:02:06Z. --- 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 commented 2026-11-30 17:07:50 +00:00 (Migrated from github.com)

Imported from TaynanGT/Vice-Tay. Originally posted by TaynanGT on 2026-11-30T17:07:50Z.


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.

<!-- greyfinch-sync:TaynanGT/Vice-Tay:comment:7285765539 --> Imported from [TaynanGT/Vice-Tay](https://github.com/TaynanGT/Vice-Tay/pull/424#issuecomment-7285765539). Originally posted by [TaynanGT](https://github.com/TaynanGT) on 2026-11-30T17:07:50Z. --- `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

Sign in to join this conversation.
No reviewers
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
TaynanGT/Vice-Tay!424
No description provided.