conformance: the running-signal case's MTLEvent reading may be Committed on rt alone, where its submit thread is still busy

On the Iris Xe, event-wait-behind-a-running-signal's MTLEvent row read the
waiting command buffer Committed with no handler run, where the M3 Max had
scheduled it while the signaller ran. This held in 3 of 3 runs (m3-max-52564).
The trace showed why. The waiter's wait was met at once by the signal's
staging. rt's one submit thread was still inside the signaller's
vkQueueSubmit2, the device's first submission, which took 27-30 ms on ANV. The
waiter was scheduled 0.02 ms after that call returned. Apple defines Scheduled
as all dependencies resolved and the command buffer scheduled for execution,
and promises no time between the two. The planner ruled this a timing
difference and not a conformance bug.

The case now declares, on rt's run alone (Justification::NewRuntimeAccepted),
that the MTLEvent row's waiting status while the signaller runs may be
Committed or Scheduled, and its handlers none or the scheduled one. The
declaration cites a new accepted difference in docs/API.md, 'The new runtime
schedules a command buffer once its submit thread is free'. The shared event's
row is not loosened: both runtimes hold its waiter until the value is reached.
The old runtime's run compares both sites exactly.

New test: a_wait_met_by_a_running_signal_may_read_committed_on_the_new_runtime_alone.
It checks that the Iris answers are no divergence on rt and are rows on the old
runtime, that the shared event's sites still diverge, and that a status other
than the two still diverges.
This commit is contained in:
Anees Iqbal committed 2026-11-19 08:21:39 -08:00
1 parent 7469fe748d
commit 1e583d5e0c
3 files changed
+146 -4

No files matched your search

+13
View File
@@ -6625,6 +6625,19 @@ each item named states the rule in full.
of the same functions answered an object maximum of 64, where a first compile answers 1024
(`mesh_pipeline_limits.m`).
**Queues and command buffers**
- **The new runtime schedules a command buffer once its submit thread is free**
(`metal2vulkan-rt`'s `CommandBuffer::status`, `add_scheduled_handler` and
`wait_until_scheduled`). Apple defines `MTLCommandBufferStatusScheduled` as "All dependencies
have been resolved and the command buffer has been scheduled for execution", and promises no
time between the two. The new runtime schedules each command buffer on the device's one submit
thread, once that thread's earlier `vkQueueSubmit2` calls have returned, whichever queue they
were for (the runtime's README, the known gaps of queues). So a command buffer whose wait an
earlier submission's signal meets stays `Committed`, its scheduled handlers not run, for as long
as that submission's driver call lasts, where an Apple M3 Max had scheduled it while the
signalling command buffer still ran.
**Process exit**
- **On Linux, an exit while the driver still runs the runtime's work past the exit's wait for it