Files
metal2vulkan/docs
Anees Iqbal b18b105cc0 Let a thread's own pass take the ready heads not behind, as the scheduler's does
A committing thread's pass (commit_and_submit) and a waiting thread's took
only the line head committed first of all (Order::take_first, and
claim_check's first_mut): any earlier commit held on any queue, its checks
waiting for a signal to land or run by the scheduler's thread, sent every
later commit to the scheduler's thread, a wake and a hop each, even a ready
one on another queue. A consumer's video round (5080, 1 s windows) showed it:
879 commits, 741 passes at commit, 358 batches submitted there, the other
~521 batches the scheduler's (batches_held_past_a_look 522, heads held for
checks 718, for check signals 129, for earlier commits 46; no event-value,
host-step or binary-semaphore holds), scheduler_wakes_host 668.

submit_plain_ready now takes its heads with Order::next and is_behind, the
scheduler pass's own selection: the first ready head in commit order that
waits behind no earlier commit keeping its place. claim_check takes the first
head in commit order whose checks the thread may run and that is behind no
earlier commit (no check before the batch it waits behind is submitted, as
check_heads keeps). A held head so holds back only the later commits that
wait behind it: its own queue's, and another queue's whose footprint runs in
commit order with it. Order::take_first and first_mut, now unused, go with
their two unit tests; the scheduler's next is tested by the rest of
tests::scheduler.

Test: commit_and_submit
a_head_held_for_its_check_holds_back_only_the_commits_behind_it holds queue
A's check on the scheduler's thread, then commits B (same buffer, behind A)
and C (another buffer) with commit_and_submit: C is checked and submitted on
the committing thread inside its call while A's check runs, B on the
scheduler's thread after A; handlers in submission order C, A, B; one batch
checked and submitted at commit. Before this change C's check ran on the
scheduler's thread after A's (expected; the run's evidence goes with the
landing report).

(cherry picked from commit ff664020a1c7fe171ff15422e17b3c846624d94c)
2026-11-05 18:59:00 -08:00
..