Files
metal2vulkan/crates/metal2vulkan-runtime/src/contexts
Anees Iqbal c646f33ddf A recovery fails the work its lost scheduler holds, and a queue's next place waits for it
What: the scheduler's pass, on a lost device, fails every batch its order holds in commit order,
whatever it waits for (an event value no signal reaches now, a binary semaphore, a making, a
decode, room on its VkQueue, an earlier commit), as a batch whose submission met the loss: the rest
of its command buffer dropped, the command buffer finished with DeviceLost through the completion,
which answers it as the recovery's victim with its completed handlers run (fail_lost, through
Order::pop_first_where). A head whose host step or checks run, or wait to, or whose encoders a
rebind encodes again, fails once that ends. The recovery's first step waits until the scheduler
holds none and the completion took them all (Device::fail_in_flight), before the next generation
serves. A queue's place a recovery retires keeps its slots, and the queue's next place holds its
context (Contexts::hold) until no command buffer committed on the retired place holds its slot
(Slots::hold_next, released as the last such slot comes back): a queue's transitions and handlers
run in commit order across the recovery though each place's run on its own generation's handler
threads. Docs: scheduler, line.rs and queue.rs module docs.

Why: command buffers committed before a loss and held unsubmitted (behind an event, a making, a
step) stayed in the lost generation's order forever: their handlers never ran, later command
buffers of their queues completed past them, and the lost generation never came to rest.

Verified: see the lane run reported with this sha (the test commit before it fails, this one
passes).
2026-11-12 17:20:33 -08:00
..