GPU: release presenter mutex before recursive two-plane fallback #1459
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/1459"
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 trustno1-coder/VIctory-NVIDIA. Originally posted by steven-seagull27 on 2026-11-28T20:20:32Z.
Commit
c9876bfrefactoredself.presenterfromMutex<Option<Presenter>>toMutex<Presentation>(let mut presentation = self.presenter.lock()...; let Presentation { presenter, retry } = &mut *presentation;), leavingdrop(presenter)in all three two-plane composer fallback paths insideHost::present_planes(crates/victory-gpu/src/host.rslines 10800, 10843, and 10903).Because
presenteris now&mut Option<Presenter>,drop(presenter)is a no-op (flagged bydropping_references) while theMutexGuardpresentationremains held across the recursiveself.present_planes(texture, state_u32, None, frame, video)call — causing a guaranteed self-deadlock onself.presenter.lock()whenever two-plane composer creation or recording falls back to the base plane.This change drops
presentationinstead ofpresenterat all three fallback sites, releasing the lock before recursing and clearing all threedropping_referenceswarnings.Verification (synthetic tests only)
923e38c, Windows 11 x64, Rust 1.98.1 MSVC.cargo test --locked -p victory-gpu --lib host::tests -- --nocapture: 71 passed, 0 failed.cargo check --locked -p victory-gpu --all-features: passes with zero warnings inhost.rs(all 3dropping_referenceswarnings cleared).crates/victory-gpu/src/host.rs(pre-existinglower.rssize warning inxtask policyuntouched).AI-assisted. Synthetic verification only.
Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by babuakhil on 2026-11-28T21:05:33Z.
Independent confirmation: I hit the same bug from clippy on
main(923e38c) and arrived at the identical three-line change before finding this PR.Cause, as I read it:
c9876bf(swap-chain retry) changedlet mut presenter = self.presenter.lock()…intolet mut presentation = …; let Presentation { presenter, retry } = &mut *presentation;. From then ondrop(presenter)drops only the&mut, so the three base-plane fallbacks callpresent_planesagain while still holding the guard, and that call locks the sameMutexon the same thread. Droppingpresentationrestores whatdrop(presenter)did beforec9876bf.Checked here (Windows 11, RTX 3060, Rust 1.98.1), with this change on
923e38c:dropping_referenceserrors are gone from both clippy builds (with and without--all-features)cargo test -p victory-gpu --lib --locked: 5 of 5 full runs passed. Two earlier runs each had one failure:descriptor::host::tests::views_off_their_elements_get_a_copy_of_their_bytes, which also fails on plainmain(1 of 10 runs alone), andwatch::tests::faults_that_take_no_lock_tell_the_same;watchtests fail now and then onmaintoo (another one did in my runs without this change), and neither area is touched hereNot checked: the fallback paths themselves. They only run when the composer can't be made or the composite can't be recorded, which no test reaches, and I haven't run the game.
Note for CI: on current
main, clippy stops at twovictory-shadererrors (lower.rs: an unusedcolour, a manual checked division) before it reachesvictory-gpu, so CI won't show thesedropping_referenceserrors until those are fixed. #1470 also lists "a hang on the present's fallback" and may overlap.Imported from trustno1-coder/VIctory-NVIDIA. Originally posted by nick0451 on 2026-11-28T21:44:30Z.
A smoke test in play: RTX 3090 24 GB (driver 610.88), i9-14900K, Windows 11. A release build of this PR merged onto main
923e38c, run in turn with main and three other PR builds. Series S, DLSS Performance, frame generation off. The same frozen save, outdoors on a balcony, standing still. Two rounds, each run 40 s to settle and 60 s measured, then a screenshot.ERRORline in about 7 minutes of play. The two-plane composer fallback this fixes was not reached in this scene, so this shows only that the change does no harm on the normal present path.drop(presentation)releases the guard before the recursivepresent_planes, wheredrop(presenter)only dropped a reference.Tested with an AI assistant (Claude Code); results are from this PC.