A guest's commitAndWaitUntilSubmitted could stay unanswered until the next commit (reims, XTX
RADV at pin 71, 2 of 77 runs under load: "A was never submitted"; the GPU idle; the scheduler
asleep with the batch held for 10 s; an empty commit on another queue released it at once).
Cause (reims's finding, /tmp/xqtest/m2v-finding.md): on a host whose one graphics VkQueue an
unshared queue also holds (RADV, ANV; WindowServer's queues are unshared), batch A behind H was
held by held_for_unshared() while H was in the Flight. QueueSlot::completed publishes `completed`
(fetch_max) before waits.completed takes H out of the Flight. When H completed between those two
steps, the hold read a stale Flight and gated on completed + 1, which nothing meets.
Fix:
- Unshared hold: QueueWaits::hold_ahead reads the published completed value under the waits lock;
Flight::ahead(ran, completed) counts batches at or below it as gone; Room::Hold { after, through }
carries the oldest still in flight; await_unshared_room gates on `through`, fences, and reads
again (completed >= through wakes it at once). No reorder of QueueSlot::completed.
- Kept group (submit_ready, Group::keeps read before gate_on): sets the gate, fences, then reads
again (Group::pending_through), the protocol gate_heads and check_heads use.
- A WAIT_SLICE that ends with a batch held makes a pass, as the module docs promise, counted in
WorkCounts::scheduler_slice_rescues (0 wherever every wake comes). api_signatures and host_ab
updated.
Verified (perdraw5, msi 26135, lavapipe, at 3bd14c83ac on a2ac4433ca): clippy all features and
--cfg m2v_gpu, rustdoc -D warnings, api_signatures/api_surface green; 36/36 of scheduler_held_wakes,
scheduler_wakes, completion_wakes, scheduler, unshared_hold. tests::scheduler_held_wakes forces
each interleaving with test-only hold points (completion::trace, cfg(test) + device cfgs; `Leave`
sits between QueueSlot::completed's fetch_max and waits.completed):
- unshared: H held at Leave while the next is committed; it goes with 0 slice rescues.
- kept group: both completions published between keeps and the gate; it goes in that pass, 0.
- lost wake: completion wakes dropped; the held group goes at the next slice (1 rescue, 99 ms).
Negative controls each fail only their own test: old gate (unshared held until the slice at
101 ms, and with development's code until the next commit, reims's symptom); kept recheck
removed (102.9 ms, 1 rescue); a slice making no pass (never completed within 5 s).
RUNTIME_VERSION 2231 -> 2232.