D3D12.X: drop the replaced two-pass PSO outside the TWO_PASS lock #2882
Loading…
Reference in a new issue
No description provided.
Delete branch "upstream-pr/2882"
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 ivall/xcl. Originally posted by crazymanjared on 2026-11-26T21:11:04Z.
Fixes the deterministic
0xc0000005 write 0x0 at game_scarlett_master.exe+0x23cf683world-load stop (the title's GPU watchdog) on AMD + Wine — root cause below. Discussion + thread dumps: #846 (comment 7202650249).finish_two_passregisters a finished mesh pipeline withinsertreturns the replaced entry, which until now dropped as a statement temporary while the lock was still held. During the boot registration storm, freed mesh-PSO addresses are reused, so the replaced entry's last reference dies inside the lock:TwoPassPso::drop->pso_async::release(compute) ->Release->pso_releasetakesTWO_PASSagain -> std locks are not reentrant -> the worker blocks on its own lock. Every draw queues behind it and the title's watchdog fires ~100 s in. Thread dump at 105 s (RX 6950 XT, Wine): both pso-pre workers stuck acquiringTWO_PASS(finish_two_pass,pso_release) while the main thread queues on thetwo_pass_ofread behind them.The fix binds the replaced entry and drops it after the guard releases — two lines.
Verified: on RX 6950 XT + GE-Proton Wine the stop is gone: 2,700+ frames presented (past the old hard wall at ~2,400–2,730 / ~100 s) and the run survives 40+ minutes of world load, the deepest AMD + Wine run reported on #846. Happy to share the thread dumps and full logs.
Imported from ivall/xcl. Originally posted by github-actions[bot] on 2026-12-01T02:35:44Z.
Nothing has happened on this PR for 3 days, so it is marked
staleand will be closed in 4 days. A push or a comment takes the mark off: rebase it ontomainif it conflicts, and say in one line what it still fixes. If it only waits for a maintainer, a comment saying so is enough.Imported from ivall/xcl. Originally posted by Foniass on 2026-12-01T09:07:34Z.
Triage (#1607) – head
3e8e2c4No open or merged PR makes the same change (#3132, the nvidia-dev port, is closed).
The fix is correct: in the one-statement form, the
Option<Arc<TwoPassPso>>thatinsertreturns is a temporary. It is dropped before theTWO_PASSguard. A replaced entry'sDrop(late_release::hold_pipeline, which withXCL_LATE_RELEASE=0goes topso_async::release->pso_release->forget_pso) then takesTWO_PASSagain while the lock is still held.forget_psoalready uses the samelet gone = ...; drop(gone)pattern.The PR has no test, and the deadlock can only happen with
XCL_LATE_RELEASE=0(by default the drop only queues the pipeline). The description should say so.Recommendation: keep open.
AI review: Claude Code (Claude Opus 5.5), diffs read only, not built or run; not checked by a human.
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.