GPU loading allowance follows elapsed frame waits #19
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/19"
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 DexNom/VIctory. Originally posted by Artking175 on 2026-11-25T18:49:14Z.
Problem
The loading allowance was charged against each individual wait. With a 500 ms base budget, sequential waits of 400, 400 and 200 ms in one frame leave 500 ms to charge. The previous code charged zero. With the default shared wait window, two overlapping 800 ms waits should spend 300 ms beyond the base, but per-wait accounting can count 600 ms.
Change
Account for elapsed waiting beyond the ordinary budget once per frame and pipeline kind. Count overlapping waits once in the default mode. Track reserved time separately from completed waits so the reserve mode only charges time that elapsed. The loading allowance already recorded for the current frame is excluded when calculating that frame's remaining budget.
Verification
Tested on Windows 10 22H2 (19045), RTX 2060 (driver 531.41) and Rust 1.98.1 MSVC on base
2e01ab4.cargo test --locked -p victory-gpu --lib pipeline::make -- --test-threads=1passed all 10 tests, including two new deterministic regressions.cargo test --locked -p victory-gpu --lib -- --test-threads=1gave 187 passed, 1 failed and 3 ignored on main, and 189 passed, 1 failed and 3 ignored with the patch. Both runs faileddepth_bounds_pipeline_loads_and_filters_drawswith0x80070057during root-signature creation.git diff --checkpassed.Gameplay FPS was not measured. Related discussion in #7.
Imported from DexNom/VIctory. Originally posted by andrewDoing on 2026-11-26T23:02:52Z.
I reproduced a loading-allowance accounting regression across frame rollover at
cd05b6a. WithWAIT_MS=500andPIPELINE_GATE_S=1, frame 1 waits about 800 ms on a pending pipeline. Just before that wait completes, a second thread starts a frame-2 wait using an already-ready pipeline. Frame 2 replaces the frame state; the frame-1 completion is then discarded atmake.rs:429, so its extra 300 ms is not charged to the cumulative loading allowance.Using the production
wait()with real wall time and two threads, observed frame budgets were[1000,1000,700]ms on parent2e01ab4and[1000,1000,1000]ms on this PR. A deterministic timestamp fixture reproduced the same behavior in Window, Reserve and PerThread modes; ending the first wait just before the second begins retained the expected 700 ms. Only budget observation and the test fixture were added. No GPU, gameplay or frequency claim.Verification was AI-assisted with GPT-6.2 Astra.
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.