GPU: bound the per-frame pipeline wait with VICTORY_PIPELINE_WAIT_MS #76

Closed
dutch2005 wants to merge 1 commit from upstream-pr/76 into main
dutch2005 commented 2026-11-25 13:32:50 +00:00 (Migrated from github.com)

Imported from Belobug/VIctory-Belobug-AMD. Originally posted by dutch2005 on 2026-11-25T13:32:50Z.


Why

The wait for a pipeline made by a background worker is a constant 500 ms per title frame (20 s for screen passes). On the world's first frames, where thousands of pipelines are still being made, that wait can dominate, and there is no way to trade a dropped draw for frame time. fxceless/victory-fork and upstream carry the same switch; this is written anew against this tree's budget code.

What

  • Reads VICTORY_PIPELINE_WAIT_MS once (milliseconds; 0 does not wait).
  • Default remains 500 ms; invalid values fall back to 500.
  • Screen passes keep their 20 s budget.
  • Adds a unit test for the parsing and documents the variable in the debugging table.

Testing

  • cargo test -p victory-gpu --lib pipeline_wait -- --test-threads=1 — 3 passed, 0 failed:
    • parsing (VICTORY_PIPELINE_WAIT_MS value, invalid fallback, 0),
    • the default budget is 500 ms (not Duration::default()),
    • wait actually blocks for the worker instead of returning immediately.
  • Mutation coverage: cargo mutants -p victory-gpu --in-diff <this diff> -- --lib pipeline_wait — 4 mutants, 4 caught.
  • No behaviour change when the variable is unset.

Notes

A draw or dispatch whose pipeline is not ready when the budget is spent is dropped, as an untranslated one is. Lowering the value can omit draws until their pipeline is ready; it does not make pipelines cheaper.

<!-- greyfinch-sync:Belobug/VIctory-Belobug-AMD:issue:6605651404 --> Imported from [Belobug/VIctory-Belobug-AMD](https://github.com/Belobug/VIctory-Belobug-AMD/pull/76). Originally posted by [dutch2005](https://github.com/dutch2005) on 2026-11-25T13:32:50Z. --- ## Why The wait for a pipeline made by a background worker is a constant 500 ms per title frame (20 s for screen passes). On the world's first frames, where thousands of pipelines are still being made, that wait can dominate, and there is no way to trade a dropped draw for frame time. `fxceless/victory-fork` and upstream carry the same switch; this is written anew against this tree's budget code. ## What - Reads `VICTORY_PIPELINE_WAIT_MS` once (milliseconds; `0` does not wait). - Default remains 500 ms; invalid values fall back to 500. - Screen passes keep their 20 s budget. - Adds a unit test for the parsing and documents the variable in the debugging table. ## Testing - `cargo test -p victory-gpu --lib pipeline_wait -- --test-threads=1` — 3 passed, 0 failed: - parsing (`VICTORY_PIPELINE_WAIT_MS` value, invalid fallback, `0`), - the default budget is 500 ms (not `Duration::default()`), - `wait` actually blocks for the worker instead of returning immediately. - Mutation coverage: `cargo mutants -p victory-gpu --in-diff <this diff> -- --lib pipeline_wait` — **4 mutants, 4 caught**. - No behaviour change when the variable is unset. ## Notes A draw or dispatch whose pipeline is not ready when the budget is spent is dropped, as an untranslated one is. Lowering the value can omit draws until their pipeline is ready; it does not make pipelines cheaper.

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
Belobug/VIctory-Belobug-AMD!76
No description provided.