A compute encoder can leave a dispatch to its host step (Deferred::Dispatch,
indirect_dispatch.rs): an indirect dispatch off the GPU's own path, or any
dispatch while an indirect stage-in region is set. The host step reads the
arguments once the work before it completed, and resolves the buffers its
encoder named as it records. Deferred::resolved_at_its_calls is false for it,
so the commit keeps the pages of every buffer over host pages the command
buffer used until it completes. A rebind of one meanwhile is refused with
Invalid(Rebind(EncodedUses)), where Metal's replace before the submission
reaches the new pages.
Encoding the encoder again (the reverted 947c110e49) would not reach this
path: the rebind is refused before any encoding again. So the behaviour stays,
and is now recorded:
- rebind.rs's module doc lists the dispatch among the commands that keep a
committed command buffer counting as uncommitted until it completes, with
the refusal;
- the doc comments of RebindProblem::EncodedUses and of Buffer's and Heap's
rebind_bytes_no_copy name the committed case;
- Deferred::resolved_at_its_calls names its false arm (an execution, a
dispatch left to its host step, a loop's check);
- the runtime README's rebind sentence names the committed case;
- docs/FAST-PATHS.md has a known-gaps entry.
HOWTO does not state the rebind's refusal, so it is unchanged.
The test is host_step_reads.rs's
a_rebind_while_an_indirect_dispatch_s_host_step_is_left_is_refused_until_completion.
On a device without device addresses (shaderInt64 withheld), it dispatches
[4, 1, 1] threadgroups from a no-copy page behind a shared-event gate, and
rebinds the page before the signal over one holding [2, 1, 1]. It asserts:
- the rebind is refused with Invalid(Rebind(EncodedUses));
- the command buffer completed with no error;
- the host step ran;
- the dispatch ran the encoded page's 256 threads;
- a rebind is taken once the command buffer completed.
Degradation kinds added or removed: none.