Pipelines: one still being made waits less after its first frame (VICTORY_PIPELINE_WAIT_AGAIN_MS, unset as before) #410
No reviewers
Labels
No labels
accessibility
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
wontfix
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
github/Belobug--VIctory-Belobug-AMD!410
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-410"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
@Esteban-V on GitHub · 2026-11-27 00:07 UTC · original
Esteban-V:perf/pipeline-wait-again→a-publier· +55 −1 · 1 files · 1 commits · openA frame waits up to
wait_budget()(500 ms,VICTORY_PIPELINE_WAIT_MS,crates/victory-gpu/src/pipeline/make.rs:361) for the pipelines its draws need, andwaitstarts that budget again every frame (make.rs:454). So a pipeline that is still compiling costs up to 500 ms in every frame until it is made. One 3.4 s compile is about seven such frames, and docs/findings.md records 270-660 s of a session spent in frames over 200 ms while pipelines were being made. This PR addsVICTORY_PIPELINE_WAIT_AGAIN_MS=<n>. With it set, a pipeline still gets the full budget in the first frame that waits for it, then at mostnms in each later frame. The trade-off: a draw whose pipeline isn't ready is skipped for more frames (pop-in) instead of holding up each frame. The crude existing A/B isVICTORY_PIPELINE_WAIT_MS=50.make.rs:Pendinggainsfirst_wait: AtomicU64(0: never waited, else frame+1). It is set withcompare_exchangebecause up to five recording threads can wait for the same pipeline at once. It is set only when the pipeline actually waits, so a pipeline dropped on an already spent frame keeps its full first wait.make.rs:wait_again_budget()(OnceLock) reads the switch.budget_for()picks the full or the again budget.make.rswait: the cap is applied toleftbefore it is taken from the sharedSPENT, so the give-back (left - waited) returns exactly what was taken. Screen passes keepscreen_budget().pipeline/library.rsonly. #229 caps the total wait per pipeline, but againstmain's olderwaitand on by default.Testing
windows-latest): Clippy, default tests and diagnostics tests pass (run).x86_64-pc-windows-msvcon a macOS host.cargo clippy --workspace --all-targets --locked --target x86_64-pc-windows-msvc -- -D warnings, with and without--all-features: clean.later_frames_wait_the_again_budgetadded.@MamaLeVrai on GitHub · 2026-11-27 01:23 UTC · original
Tested on an RX 6950 XT (RDNA 2), driver 32.0.21045.29003, Windows 11 build 26300, Rust 1.98.1, release. At
9654f6e:cargo test --release -p victory-gpu --lib397 passed, 0 failed, 34 ignored.AI-assisted (Claude Code); no game data.
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.Merge
Merge the changes and update on Forgejo.