RUNTIME 2297: fold groups split at Metal's submissions where a check or a rebind fails one

RUNTIME 2293's blit fold records a blit encoder and the compute encoders
around it into one VkCommandBuffer, and those are separate Metal
submissions, which a submission check or a rebind's EncodedUseRebound fails
one at a time. Pin 90's lavapipe suite failed two tests on it (m3-max-29286
at 2293's parent passes; m3-max-29287 at 2293 fails these two):
- submission_checks::a_submission_detached_behind_a_wait_fails_alone: the
  check failed the blit's submission, whose part holds no VkCommandBuffer,
  and its fill ran inside the compute encoder's;
- rebind_reach::a_unit_s_encoder_that_laid_its_first_step_fails_encoded_use_rebound:
  the group could not be encoded again whole (the compute encoder laid its
  unit's first predication step and keeps no log), so the rebind refused
  the blit too, which Metal runs over the new pages.

Now:
- Each encoder notes whether a command of its own recorded into the
  group's shared tail (EncoderCore::in_tail; a group's first encoder always
  does). With a submission check set, the commit encodes again apart only
  those tail encoders, where they span more than one Metal submission and
  each can be re-encoded exactly (log kept, no segment). Otherwise a check
  failing one of those submissions fails all of them (State::widened), so
  the tail runs whole or not at all. Encoders whose commands all lie in
  their own VkCommandBuffers fail with their own submission alone.
- A rebind of a group that cannot be encoded again whole splits it where
  each encoder that cannot lies in a submission the rebind fails anyway
  (State::split_rebound); the group's other encoders are encoded again
  apart and run.
The FAST-PATHS known gap and API.md's committed-as-failed section say what
still differs from Metal: a shared recording that cannot be split fails
every submission whose commands it holds, and a rebind is refused where an
encoder that cannot be re-encoded sits in a submission that still runs.
No application of ours sets a submission check (reims-vgpu does not).

New test: submission_checks::a_check_failing_one_submission_a_shared_recording_holds_fails_each_it_holds.

Verified (msi lavapipe, --cfg m2v_cpu_icd): m3-max-29331 at the tip:
clippy -D warnings (all features and targets, runtime + validation) 0 under
m2v_cpu_icd and plain; 402/402 tests (rebind_reach, submission_checks,
failed_commits, predication, rebinds, indirect, encoder_fold, command_buffer,
fast_paths and pin 90's four). Negative controls on development's runtime
sources (m3-max-29315, 29330): rebind_reach, wcdc and the new test fail.
This commit is contained in:
Anees Iqbal committed 2026-11-14 07:23:37 -08:00
1 parent f2d3b54e1a
commit 8c5a1d592a
12 files changed
+417 -115

No files matched your search

+5 -1
View File
@@ -5450,7 +5450,11 @@ each item named states the rule in full.
leave work out (an unbalanced record), it cannot be recorded again outside its blocks, and such
a failure fails the whole group instead, where Metal runs the group's encoders before `n` and
those the set leaves out. So does a group one of whose calls answers otherwise when recorded
again.
again. A command buffer with a submission check (`CommandBuffer::set_submission_check`) has
the encoders whose commands such a group's shared `VkCommandBuffer` holds recorded again apart
at the commit where they lie in more than one of Metal's submissions, so a check fails its own
submission's encoders alone; where they cannot be recorded again so, a check that fails one of
those submissions fails each of them, where Metal runs the others.
**GPU hangs and faults** (a draw of private primitive type 9, `DrawPrimitiveType::Nine`)