Files
metal2vulkan/crates
Anees Iqbal 5bf7ae2eae RUNTIME 2243: a committing command buffer counts as uncommitted until the scheduler holds its batches
The consumer's Iris walk at pin 73 (appwalk10 w-iris-26) failed one guest command buffer during
login with the runtime's own invariant "a batch's end recorded where the batch does not end"
(command_buffer/submit.rs), read as VK_ERROR_UNKNOWN (-13): the first tagged sighting of the -13
seen untagged three times on the 3090 and the 780M since pin 59.

Cause: a texture's face turn (texture/faces.rs turn_face) and a storage-form switch need the
device's Uncommitted count at 1 and the scheduler holding nothing. Both held for a command buffer
B in commit_now between slot.committed() and scheduler.commit(), where B's end is folded into its
last command buffer (face_swaps.any() false). Interleaving: B encodes an attached-read pass that
copies into the texture's other face G; B commits and folds its end; before B reaches the
scheduler, A opens a pass that turns the texture F -> G; at B's submission record_face_fixes finds
A's record and pushes a back copy G -> F after B's folded command buffer, so work.last() is not the
folded one and the command buffer fails. The same back copy would also have written stale texels
over B's rendering in F.

Now a committing command buffer stays in the Uncommitted count until scheduler.commit holds its
batches (Slot::handed; held.open still drops at committed(), so slot_wait is unchanged): no turn
or storage-form switch lands between the fold and the submission. Only turn_face and
storage_form_switch read the count, and both refuse rather than wait (Unturned::Busy and the
copy-in path; no switch), so nothing waits on it.

Verified (batchend, 42e70c6642 on 33de04117d), lavapipe on msi: new device tests holding B at a
new trace point Point::Committing while A's pass opens. Negative control (the tip without the fix,
26731): the folded test panics on the invariant (submit.rs:1145), the apart test finds B's pixels
clobbered (4096 bytes differ). Tip (26755): 6/6, finale folded 1 / apart 1 as built, Moved {swaps
0, busy 2, fixes 0}, B's pixels right at every step. Turns still happen: the existing
a_texture_s_faces_take_turns_for_its_attached_reads shows swaps 1 in each of its turn cases, the
same at base and tip. clippy --cfg m2v_cpu_icd (26758), --cfg m2v_gpu (26726), plain (26693) and
rustdoc (26725) 0. The command_buffer/submission/queue/storage_form/attached-read suites on
lavapipe (26759) and the XTX leg follow on development.

RUNTIME_VERSION 2242 -> 2243.
2026-11-13 14:26:06 -08:00
..