Files
reims-vgpu/docs/graphics-kext
Anees Iqbal e969f9137d 🆕 Carry command buffers' event signals and waits to the host
encodeSignalEvent:value: and encodeWaitForEvent:value: were stubs that only
logged: no command buffer ever signalled an event, a wait ordered nothing, and a
shared event's CPU set never reached the host.

The wire gains the framing ops SIGNAL_EVENT and WAIT_EVENT (an event or a
shared event, and a value), between encoders, and SHARED_EVENT_SET_VALUE on the
control ring. The host carries the ops with encode_signal / encode_wait, faults
one with an encoder open or naming no event, sets a shared event on the CPU's
set, and sets one made at another value to it after its create. Once a buffer
finishes, each shared event it signalled goes to the guest as EVENT_SIGNALLED on
its queue's completion ring, ahead of its CB_COMPLETE; the guest sees the signal
at the buffer's end rather than where its GPU reaches it (design.md says what
that means for a CPU wait on a mid-buffer signal). GPU waits wait on the host's
event and are not affected.

The bundle writes the ops, keeps the event while the buffer runs, posts the
CPU's sets, and hands a queue reader's EVENT_SIGNALLED to the device's reader,
where shared events listen. As Metal's (measured on the M3 Max), the value only
rises, and notifyListener blocks run on their listener's queue with the value
they were registered at, where they ran synchronously on the completion thread
with the current one.

A command buffer that waits is watched: one not finished 5 s after its commit is
named in the log, and again when it finishes. Diagnostics only.
2026-11-05 21:58:33 -08:00
..