GPU: cap cumulative wait per pipeline across frames and guard worker panics (#73) #125
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/125"
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?
Imported from avatarmanz/VIctory-7900XTX. Originally posted by ESAT586 on 2026-11-26T05:25:15Z.
Fixes #73.
Problem
Fix (crates/victory-gpu/src/pipeline/make.rs)
Verification (zero game data)
(Authored and verified with Gemini 4 Neon — High Mode, AI coding agent — with zero game data.)
Imported from avatarmanz/VIctory-7900XTX. Originally posted by gomeaw on 2026-11-26T07:20:18Z.
I reproduced a gap in the cumulative cap using the PR's
wait_withunchanged in a small host-independent harness. With shared frame budgets enabled, holdDONE.0, start a waiter for frame 1, and wait untilSPENTshows its reservation. Then start a waiter for frame 2 and wait for its reservation before releasingDONE.0. Both waiters read the samewaited_usbefore either charges it. With a 250 ms pipeline budget, they each waited 250 ms and the final charge was 500 ms.I would reserve the pipeline allowance before blocking, independently of frame accounting, and give back the unused allowance alongside the frame refund. A test with overlapping frames can cover this with shared frame budgets enabled. With
VICTORY_PIPELINE_WAIT_SHARED=0, callers in the same frame can also overlap.One other race to close while here: when
catch_unwindsurroundsget_or_init, another caller ofmakecan start initializing the emptiedOnceLockbetween the panic andset(None). Handle the unwind inside the initializer and returnNonethere so the refusal is published by the same initialization. That covers the synchronousnowcaller overlapping a pipeline worker.Imported from avatarmanz/VIctory-7900XTX. Originally posted by gomeaw on 2026-11-26T07:32:40Z.
The reservation and initializer fixes are ready as a PR against your branch. The overlap test holds the first waiter before completion and checks that the second frame gets no reservation. The Windows job repeats that test eight times. The change is a single commit,
c326c7a, if you prefer to cherry-pick it.Imported from avatarmanz/VIctory-7900XTX. Originally posted by avatarmanz on 2026-11-26T07:36:16Z.
Left open: a pipeline past its total wait is dropped instead of waited for, on every card; needs an in-game check on the 7900 XTX first.
Imported from avatarmanz/VIctory-7900XTX. Originally posted by gomeaw on 2026-11-26T07:46:52Z.
The hardware A/B branch applies #125 and the reservation fix to
39031cb, with only pipeline scheduling and its tests changed. A paired 7900 XTX run with the same initial cache can compare the first world frame, screen passes that run once, and the p95 Present interval. The overlap regression passed eight consecutive times on Windows.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.Warning: The "Autodetect manual merge" setting is not enabled for this repository, you will have to mark this pull request as manually merged afterwards.