Repository navigation
fix(agc): don't let a queue worker record on a device the presenter is replacing - #110
Merged
boykopovar merged 1 commit intoSep 29, 2026
Conversation
…s replacing Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01ButHENCbXXt8h4EZuWUabJ
9 tasks done
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
The presenter replaces the driver's device when the window first appears (the headless device has no surface). Queue workers don't hold
GpuMutexfor all of a packet: a dispatch's prologue loads the device atomically and records later. A worker could therefore capture the old device, lose the race with the presenter, and record onto a device thatPrepareForReplacementwas already tearing down. On Linux with NVIDIA, the next submission hung the GPU.DeviceUseGateis a small writer-preferring gate:Packets that wait on something the presenter may produce don't take the gate, so a waiting worker can't block the replacement it's waiting for. Those are WAIT_REG_MEM (0x3c), WAIT_REG_MEM64 (0x93), the rendering-wait packet and the flip.
Tested
ctest: 57/57 pass.Checklist
main; no other open PR implements the same functionsNotImplemented_nid_no_patch); silent stubs are listed in TechnicalDebt.mdfiles or images added to the repository