GPU: a pipeline is waited for in one frame only (#1181) #1234
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/fxceless--victory-fork!1234
Loading…
Reference in a new issue
No description provided.
Delete branch "github-bot/gh-1234"
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?
@milesah3ad on GitHub · 2026-11-26 01:02 UTC · original
milesah3ad:pipeline-wait-once→main· +62 −3 · 1 files · 1 commits · open@fxceless — requesting your review and merge.
Fixes the steady-state stall in #1181: a pipeline the worker has not made within a frame's wait budget was waited for again in every frame that drew with it, each time for the whole
VICTORY_PIPELINE_WAIT_MS(500 ms). In play this reads as the game freezing while you move, and un-freezing after opening the pause menu (no world draws there, so the worker catches up).Change
crates/victory-gpu/src/pipeline/make.rsonly (+60/−3):Pendinggetswaited_frame: the first title frame that waited for it. A pipeline is waited for in one frame; later frames drop its draws until it is made, exactly as draws past the budget are dropped today.VICTORY_PIPELINE_WAIT_EVERY_FRAME=1restores the old behaviour.Credit: the one-frame cap is powplusplus' (#867 — which also carries unrelated changes that removed the device for HrHd); claiming only with budget left is BradRoland's correction posted on #867. This PR is just that piece, on its own.
Tests
cargo test -p victory-gpu --locked: 195 passed, 1 failed —watch::tests::written_pages_are_reported_to_every_asker, which fails the same way onmain(a183ea2) here, without this change.VICTORY_PIPELINE_WAIT_EVERY_FRAME=1it waits 510 ms and fails; with the fix it returns immediately.cargo clippy --all-targets --all-features: nothing inmake.rs(the existing errors onmainremain; #841).In the game
RTX 5080 16 GB (wave32), driver 621.24, Ryzen 7 9800X3D, 64 GB, Windows 11 26300, Series X profile, release build of this branch (on
006c353) +VICTORY_RELAY=1 VICTORY_TEXTURE_BACK=1 VICTORY_FRAME_LOG=1, cold pipeline cache.waitedin the usual frameThe tester reported play as "very smooth and steady" where the previous build froze whenever the character moved. I did not run an A/B on this exact tree without the change, so the before side is #1181's measurement (500 ms waited every world frame with 4 stuck pipelines) plus the tester's experience on an earlier build.
Note on the cold start: with hundreds of first-time pipelines every frame still finds a new one to wait for, so the budget is spent until they are made (first row). That is the existing design and unchanged here.
AI-assisted (Claude Code, Claude Opus 5.5): the change, tests and measurements were prepared with it; a person ran the game, judged the result and asked for this PR to be opened.
🤖 Generated with Claude Code
@milesah3ad on GitHub · 2026-11-26 02:10 UTC · original
Rebased onto
fc63ce1.a35c557addedformatsandvarianttoPending, next to this PR'swaited_frame; the conflict was only that. Both are kept, and each format variant is its ownPending, so it gets its own single wait like any other pipeline.One fix to the test, too: it marked the pipeline as waited "in the frame before" with
frame.wrapping_sub(1), which at frame 0 (the test run alone) isu64::MAX, the "not waited yet" sentinel, so the run alone waited and failed. It now usesframe.wrapping_add(1). Run alone: 6/6 inpipeline::make; withVICTORY_PIPELINE_WAIT_EVERY_FRAME=1the test still fails after a 500 ms wait, as it should.Full
cargo test -p victory-gpu: passes, apart fromwatch::tests::written_pages_are_reported_to_every_asker, which fails intermittently here onmaintoo (one run 200/200, the next 199/200).AI-assisted (Claude Code).
@ArturoWolff on GitHub · 2026-11-26 07:21 UTC · original
Independent, game-free scheduler comparison on the receiving fxceless tree. This supports the one-frame wait cap, but also gives a reason to keep the policy for a once-only compute dispatch separate from that for an ordinary draw.
Setup and provenance: receiver
46bf5351707b1697c04e5d871c30973ebaa3e973, native Linux Rust 1.98.1, separate source trees and Cargo targets. I exercised the actualpipeline/make.rsworker queue, condition variable andready()implementation in a small Rust adapter. Only host pipeline construction, the frame counter, library bookkeeping and the Windows/Wine-specific environment interfaces are replaced by synthetic fixtures; no D3D12, title data, shader conversion, driver cache or GPU. Each scenario starts in a fresh process.VICTORY_PIPELINE_WAIT_MS=80, shared budget on, with explicit compute-policy selection. The shorter render budget makes the test cheap, not a proposed in-game setting.The four arms are clean receiver; the exact change from this PR at
7195775ba6f09a797b7523c749c7d8b558255a7f; the compute-wait policy only from Beqren's #129,c0fdca08d3446294336cfb6d59c2dbaa2cced69awith the concurrent-caller follow-upda4cee66b2a7d2fe1339c08f5b1a6732082f7de5; and the combination. Credit for the one-frame cap and budget-claim correction also goes to powplusplus and BradRoland (#867), as noted in the PR. The compute change on this receiver keeps its existing graphics wait, worker queue and logging style. I am testing the readiness policy, not the other #129 changes or the reworked branch now in draft.Measured:
Each controlled job builds exactly once; after eventual publication its ready result remains usable. To reproduce the compute case, hold one synthetic graphics job until the shared budget expires. Have a worker claim a second, compute job but hold its result. Call
ready()once from each of one or two recording threads. Release the synthetic builder only when each caller has entered the real condition-variable wait or returned without it. Count returned host IDs, not just queued jobs. The baseline and #1234 lose those simulated one-shot calls even though the worker soon publishes successfully. The compute-wait variant returns the same successfully built host object to both callers. This models readiness only, not the subsequent command recording, binding or dispatch effect.Controls: a pipeline that did not get any wait in one frame can still use the next frame's budget; a second graphics pipeline does not get extra budget in the spent frame. With
VICTORY_PIPELINE_WAIT_EVERY_FRAME=1the combined arm returns to four graphics waits; withVICTORY_COMPUTE_WAIT=0it returns to the baseline one-shot behavior. With a compute job deliberately held, the real 20-second allowance expires at 20,000 ms, the next call skips waiting, and the later published result is accepted. The two new tests in #1234 and the inherited scheduler tests pass in the combined arm. Totals across four arms: 50 passing focused test invocations, four intentional assertion failures that reproduce the old/missing behavior. All four isolated builds/runners exited successfully; no OOM, game launch or GPU workload.Implication: the repeated-wait fix and the once-only correctness concern are complementary, not substitutes. I would keep the cap for draws and investigate an explicitly selected bounded compute policy rather than globally setting the wait budget to zero. The 20 s limit here is per wait call before the give-up flag skips later waits, not a guaranteed total frame time; multiple delayed jobs can still accumulate long waits. The delay before a worker starts building matters too, and a real application-level dispatch/consumer witness is still needed before attributing missing geometry to this mechanism.
Beqren's corrected report is consistent with our earlier RTX 4060 runs with vkd3d-proton
71cae091, where five of the six named programs reached host completion (the sixth remained unresolved within our observation window). The converter fix is a separate matter from the remaining cold-cache readiness race. Thanks for checking that on both runtime versions. My test does not establish a native Windows/AMD/NVIDIA gameplay result, any particular head/skin repair, or a safe final choice of wait duration. No title launch or change to the installed runtime was made for this comparison.AI assistance: Hermes Agent, working on behalf of ArturoWolff. (GPT 6.2 Sol High).
@slauko on GitHub · 2026-11-26 07:30 UTC · original
Confirmed from Linux/Wine (RTX 3080 Ti, vkd3d-proton
ec20719, uiliannn's line with this patch taken as it is).Before it, every world frame stood at the wait budget, whatever the build or the preset: 507–519 ms in one run and 622–627 ms in another on the next build, and 512–514 ms in three earlier ones, all at about 4,800 draws. Each frame's first draw with one of 40 compute pipelines the workers never finished took the 500 ms again, and 340 draws were dropped a frame (
dropped 340 without a host pipeline (4 being made)).With it, the same scene (about 4,790 draws a frame): 395–413 ms, and the frame log says
pipelines: 0.0 ms waited. What is left of a 403 ms frame: 112 ms preparing, 268 ms waiting for the card, the card idle 65 ms — so it is the card's time now.For whoever worked around the old behaviour with
VICTORY_PIPELINE_WAIT_MS=0: that drops a pipeline's draw in the frame that first asks for it, every time. With the one-frame claim the default budget is right again.@Filip722 on GitHub · 2026-11-26 17:39 UTC · original
I reproduced the repeated-wait behavior from #1181 on Bazzite 44, RTX 5060 Laptop 8 GB, NVIDIA 615.78.08, GE-Proton11-14, and vkd3d-proton 3.2.0 (cae8353ed7959c4+). All three Series S replays used the same offline checkpoint, initial caches and 54-second stationary camera window before input. The compatibility baseline was main
e4245f3c1bwith the same Linux bring-up changes in each arm.Four to six pipelines were still pending in all three windows. The #1234 arm retained working camera input after the measurement. All six focused pipeline tests passed under Proton on the compatibility build.
I rebased the scheduler change onto
e4245f3, preserving the original authorship and current main's first-use tracker. The scheduler file matches the tested port byte for byte and the staged asset-policy check passed. Clean rebase c988e0f.Assisted by Codex (GPT-6.2-Sol High).
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.Merge
Merge the changes and update on Forgejo.