A compute encoder opened after another took its command buffer's state lock
7 times as it opened and 3 times as it ended (a debug count on lavapipe):
the protection check, settle_end's three takes, the open itself,
enter_predication and inherited_residency; end_predication,
note_scheduled_work and the end itself. About 17 ns each under perf, 118 ns
of a folded dispatch's open and 55 of its end on msi.
- EncoderCore::open checks the protection options (compute and render),
settles the last render encoder's end where one waits (CommandBuffer::
settled: the three takes only where something is there, else the lock it
holds), and runs the kind's own state work as a closure under its lock:
compute's enter_predication and State::inheriting, blit's protection
options.
- end_with_replay notes the scheduled work and, for a compute encoder whose
command buffer has no predication record, its unit's work under its own
lock. Captures::unpredicated tracks that: false at open where the command
buffer has a record, cleared by the encoder's own record, false for an
encoding again, so those keep end_predication's lock.
Tests: tests::encoder_state_locks (debug, device): a compute encoder and a
blit encoder opened after a compute encoder lock once at open and once at
end.
No behaviour changes (what a run answers, records and submits is the same), so RUNTIME_VERSION
stays 2304 and the runtime-sources pin alone moves.
Verified (msi, lavapipe): tests::encoder_state_locks 1 lock at open and 1 at end for compute and
blit (negative control with the base sources: compute 7/3, blit 5/2); touched runtime suites
156/156 (render_fold 13, encoder_fold 22, ...); validation predication and protection_options
18/18; clippy plain, m2v_gpu and m2v_cpu_icd 0; rustdoc 0. Release A/B (base 0c3c24ec0e vs
tip, own target dirs, medians of 4 interleaved): host time per dispatch within the run's noise
(about 200 ns): long folded encode 4246 -> 4303, short folded 4122 -> 4018. Kept as a
correct, neutral change.