Files
metal2vulkan/crates
Anees Iqbal 6800559b22 rt tests: the event chain sets its held link's value only once the submit thread holds it
The chain test set the shared event's value for its last link (a wait no submitted signal
promises) as soon as the links had completed, and then asserted one hold in
Metrics::event_holds. The submit thread counts a hold only for a segment it found not ready on a
pass with nothing left to stage (WorkState::mark_holds), and counts it when it stages that
segment. Its first pass after the link's commit decides, and nothing orders that pass before the
host's set. On a loaded host the thread can still be waiting to run when the floor is raised. Its
first look then finds the wait met and stages the link at once, with nothing held, and the test
read 0 (msi-laptop lavapipe, the full rt suite, job m3-max-62988; the test alone passed,
m3-max-62993). Both orders are correct Metal behaviour, and the counter is true in both: the
assertion assumed an order the runtime does not promise.

The test now parks the submit thread in a scheduled handler of a command buffer with nothing for
the GPU, committed on the other queue just before the last link, so every run commits the link,
opens the busy work and completes the links before the thread first looks at it. It then releases
the thread, waits until the thread holds the link (Work::holding, a device-test accessor beside
Work::pending, reading the FIFO's held_since against its head), and only then sets the value.
No product behaviour changes.
2026-11-21 04:01:56 -08:00
..