Pipelines: a wait budget per pipeline over all frames; a panic while making one is a refusal (#73) #303

Open
urielbeaupre wants to merge 1 commit from upstream-pr/303 into main
urielbeaupre commented 2026-11-26 15:16:07 +00:00 (Migrated from github.com)

Imported from avatarmanz/VIctory-7900XTX. Originally posted by urielbeaupre on 2026-11-26T15:16:07Z.


Fixes the two gaps described in #73.

1. A wait budget per pipeline. wait() limited waiting per frame only, so a pipeline whose build outlasts the budget (or that is never made) took the whole 500 ms again in every frame that bound it. fxceless/victory-fork#1181 measured 500.1 ms waited per world frame with four stuck pipelines; #61 and #67 have that shape. Pending now keeps the time draws waited for it. wait() takes the smaller of what the frame and the pipeline have left, and returns at once when the pipeline's budget is spent. The draw is then dropped, as one past the frame's budget already is, and finds the pipeline when a worker has made it.

  • VICTORY_PIPELINE_WAIT_EACH_MS: 500 by default; 0 means no limit, as before. Added to the switch table in docs/README-fxceless.md.
  • Passes over the screen get VICTORY_SCREEN_WAIT_MS once in all, not in every frame.

2. A panic while making a pipeline is a refusal. HostPipeline::new now runs under catch_unwind, as in list/thin.rs, host/aside.rs, land.rs and queue/behind.rs. A panic is logged with the shaders and made is set to None. Before, it ended the worker with the pipeline left in MAKING for good, and its places in WAITING and slow_now were never given back.

Not included: negative entries in shader_cache::cached (the "Smaller" item in #73).

Tests: three new tests in pipeline::make: the budget arithmetic; a pipeline that is never made is waited for until its own budget is spent and not again in later frames; a panic while making is a refusal. cargo test --workspace --locked passes (1,006 tests). cargo test -p victory-gpu --all-features -- --test-threads=1 passes (437). Clippy with -D warnings fails on main already, at watch.rs:3626 and descriptor_sites.rs:277; this change adds no warnings.

Not run in the title. The tests were run on an RTX 4070 Ti with Windows 11. A before/after on a cold pipeline cache (VICTORY_PIPELINE_WAIT_EACH_MS=0 against the default) would confirm the default is right.

🤖 Generated with Claude Code

<!-- greyfinch-sync:avatarmanz/VIctory-7900XTX:issue:6629693420 --> Imported from [avatarmanz/VIctory-7900XTX](https://github.com/avatarmanz/VIctory-7900XTX/pull/303). Originally posted by [urielbeaupre](https://github.com/urielbeaupre) on 2026-11-26T15:16:07Z. --- Fixes the two gaps described in #73. **1. A wait budget per pipeline.** `wait()` limited waiting per frame only, so a pipeline whose build outlasts the budget (or that is never made) took the whole 500 ms again in every frame that bound it. fxceless/victory-fork#1181 measured 500.1 ms waited per world frame with four stuck pipelines; #61 and #67 have that shape. `Pending` now keeps the time draws waited for it. `wait()` takes the smaller of what the frame and the pipeline have left, and returns at once when the pipeline's budget is spent. The draw is then dropped, as one past the frame's budget already is, and finds the pipeline when a worker has made it. - `VICTORY_PIPELINE_WAIT_EACH_MS`: 500 by default; `0` means no limit, as before. Added to the switch table in `docs/README-fxceless.md`. - Passes over the screen get `VICTORY_SCREEN_WAIT_MS` once in all, not in every frame. **2. A panic while making a pipeline is a refusal.** `HostPipeline::new` now runs under `catch_unwind`, as in `list/thin.rs`, `host/aside.rs`, `land.rs` and `queue/behind.rs`. A panic is logged with the shaders and `made` is set to `None`. Before, it ended the worker with the pipeline left in `MAKING` for good, and its places in `WAITING` and `slow_now` were never given back. **Not included:** negative entries in `shader_cache::cached` (the "Smaller" item in #73). **Tests:** three new tests in `pipeline::make`: the budget arithmetic; a pipeline that is never made is waited for until its own budget is spent and not again in later frames; a panic while making is a refusal. `cargo test --workspace --locked` passes (1,006 tests). `cargo test -p victory-gpu --all-features -- --test-threads=1` passes (437). Clippy with `-D warnings` fails on main already, at `watch.rs:3626` and `descriptor_sites.rs:277`; this change adds no warnings. **Not run in the title.** The tests were run on an RTX 4070 Ti with Windows 11. A before/after on a cold pipeline cache (`VICTORY_PIPELINE_WAIT_EACH_MS=0` against the default) would confirm the default is right. 🤖 Generated with [Claude Code](https://claude.com/claude-code)
This pull request cannot be merged automatically due to conflicts.
Merge manually to resolve the conflicts.
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin 'upstream-pr/303:upstream-pr/303'
git switch 'upstream-pr/303'

Merge

Merge the changes and update on Forgejo.

Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.

git switch 'main'
git merge --no-ff 'upstream-pr/303'
git switch 'upstream-pr/303'
git rebase 'main'
git switch 'main'
git merge --ff-only 'upstream-pr/303'
git switch 'upstream-pr/303'
git rebase 'main'
git switch 'main'
git merge --no-ff 'upstream-pr/303'
git switch 'main'
git merge --squash 'upstream-pr/303'
git switch 'main'
git merge --ff-only 'upstream-pr/303'
git switch 'main'
git merge 'upstream-pr/303'
git push origin 'main'
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
avatarmanz/VIctory-7900XTX!303
No description provided.