Files
metal2vulkan/docs
Anees Iqbal 3de483d86f RUNTIME 2459: Joined completions: a command buffer marked to join the next groups under Exact
CommandBuffer::set_completion_joins_next marks a command buffer, before its
commit, as one whose completion may be seen with the next one's. Under
CompletionPolicy::Exact, on a device whose merge check holds and whose
queues are not relayed, a marked command buffer's batches wait in the
scheduler's group as every batch does under Grouped. The first batch of the
VkQueue behind them that is not marked goes last in that group, which then
goes at once (GroupEnd::Closed, WorkCounts::group_ends_closed), so it is
seen complete at its own end and never held back. Its submission check runs
with the marked ones' (check_heads), so they are found ready together. No
group is kept past its pass under Exact (Alone::Unkept,
WorkCounts::batches_held_alone_unkept): a kept group can reach the GPU after
the work ahead of it ended, which would delay the unmarked one behind it.
Everywhere else (Grouped, no merge, relayed queues, the encoder trail,
batches that never group) the mark changes nothing.

Why: on the Iris Xe, ANV on i915 lists every VkDeviceMemory in each
execbuffer, about 170-190 us of driver time a vkQueueSubmit at the
consumer's import count, and the consumer cuts each guest command buffer
into about 12 parts committed under Exact, one kernel submission each.
In its walk the GPU sat idle about 1.5 ms per waited guest buffer between
parts already committed, behind a backlog of those calls. The consumer will
mark every part but the last of a cut whose completion nothing observes.

Grouped-completion's notice, docs/API.md's catalogue, FAST-PATHS row 38, the
runtime README, CompletionPolicy::Exact's doc, api_signatures and REFUSALS
say so. Tests: runtime_lane::joined_completions (marked parts group and a
group is closed by the last; checked parts too; a no-op where the device's
own check finds no merge; unmarked parts go alone; an unmarked command
buffer is seen complete while the long one behind it still runs, the marked
one before it complete by then), on lavapipe with the merge assumed.

Joined completions: the cost table's length, and the order test's first work done before

The conformance cost table's SHARED list holds 36 rows with
batches_held_alone_unkept. In the order test the marked command buffer took
the new buffers' first work, which no batch in a group takes, so it went
alone and nothing grouped: the buffers' first work now runs before it.

Verified: clippy and lavapipe lane job m3-max-36769 showed the failure
(grouped 0 with grouping true); the rerun is the next job.

Verified at 8e6c37c263: m3-max-36784 (msi) clippy --workspace --all-targets --all-features 0; m3-max-36785 (msi, lavapipe, --cfg m2v_cpu_icd) joined_completions + grouped_submissions + alone_batches 21/21 (marked parts under Exact with the merge: 7 command buffers in 2 submissions; unmarked: 7 submissions, 0 grouped; lavapipe's own merge check, not Holds: 0 grouped; an unmarked buffer is seen complete at its own end). The Iris merge check answers Holds (m3-max-36725: 9.6 us in one call of 4 against 26.4 us apart). Release-mode lavapipe, clippy --cfg m2v_gpu and m2v_cpu_icd and rustdoc run after the merge.
2026-11-16 08:18:12 -08:00
..