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

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

@⁠urielbeaupre on GitHub · 2026-11-26 15:16 UTC · original
urielbeaupre:fix/pipeline-wait-per-pipeline → main · +106 −3 · 2 files · 1 commits · open

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

**@⁠urielbeaupre** on GitHub · 2026-11-26 15:16 UTC · [original](https://github.com/avatarmanz/VIctory-7900XTX/pull/303) `urielbeaupre:fix/pipeline-wait-per-pipeline` → `main` · +106 −3 · 2 files · 1 commits · open 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)
A pipeline whose build outlasts the frame's wait budget, or that is never
made, took the whole budget again in every frame that bound it (four such
pipelines held every world frame at 500 ms waited in
fxceless/victory-fork#1181; #61 and #67 have that shape).

- Each pipeline 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 is spent; the draw is dropped as one past the frame's budget and
  finds the pipeline when a worker has made it.
  VICTORY_PIPELINE_WAIT_EACH_MS (500 by default; 0: no limit, as before).
  Passes over the screen get VICTORY_SCREEN_WAIT_MS once in all, not per frame.
- HostPipeline::new runs under catch_unwind: a panic is logged with the
  shaders and taken as a refusal, instead of ending the worker with the
  pipeline MAKING for good, WAITING and its slow slot never given back.

Tests: the pipeline's budget arithmetic, a pipeline never made waited for
until its own budget is spent and not again in later frames, a panic while
making as a refusal. Not run in the title.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
github-bot locked as GitHub sync and limited conversation to collaborators 2026-11-26 15:20:39 +00:00
This pull request has changes conflicting with the target branch.
  • crates/victory-gpu/src/pipeline/make.rs
View command line instructions

Manual merge helper

Use this merge commit message when completing the merge manually.

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin '+refs/pull/303/head:github-bot/gh-303'
git switch 'github-bot/gh-303'

Merge

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