Translator: the resident-table domains' encoder-operation lowering goes; object words stay

What: lower/access/encode.rs goes. It lowered a function's indirect-command encoder operations
under the resident-table domains, writing the binder's records and their written flags. What it
held that is still used moves to lower/access/object.rs:
- an argument buffer's command-buffer or pipeline-state member read as its word (ObjectWord);
- the plan that admits such a load only as an encoder operand.

Every encoder operation is now refused, `Unsupported{GpuEncodedIndirectCommands,
NotImplemented}`, except those the identity domains' icb.rs lowers: a render command's buffer
setters, its indexed triangle draw and a reset. icb.rs is selected first, as before. The other
deletions follow from that:
- indirect_commands.rs drops CommandEncoderOperation's per-operation policy table;
- lower/access/dynamic.rs drops the resident-set search and address helpers only encode.rs
  called (plan_search, plan_address, search_start, plain_base);
- the error doc of the depth-stencil argument names the setters' refusal;
- engine_indirect_commands.rs keeps two tests: every encoder operation refused under the
  resident-table domains on every committed profile and Profile F, and a depth-stencil member
  compiled unread and refused read. engine_handles.rs expects the refusal where a pipeline-state
  member is a command's operand;
- the command-writes interface test now takes icbcut's indexed kernel (icb_indexed_16) under the
  identity domains, plus the template that takes no command buffer;
- the authored census integration test expects the encoding case's refusal on both forms;
- docs/API.md's indirect-command section says which domain refuses what;
- docs/REFUSALS.md is regenerated.

Why: rule 4 (small) and rule 2 (one form). The runtime compiles under the identity domains, where
this lowering never ran. Under the resident-table domains, the validation executor's alone, it was
a second form of GPU-encoded commands that no consumer path takes.

No public item changes (indirect_commands is pub(crate); api_signatures.tsv is unchanged).
Versions: SEMANTICS_VERSION 2255 -> 2256 (a placeholder; the landing sets the number), because the
resident-table domains refuse what they lowered. Under the identity domains no output changes.

Verified (jobs at this commit's tree less the runtime README edit below it, 4606692494, or at the
next commit's, the runtime-sources pin, 4e9e857f8c):
- m3-max-63058 at the pin: fmt, clippy, clippy --cfg m2v_gpu, clippy --cfg m2v_cpu_icd, Rustdoc
  -D warnings and scripts/api-docs, all rc 0 (peak 7.5 GiB);
- m3-max-63040, the validation suite at this commit: 1359 of 1360 passed, the one failure the
  runtime guard, which the next commit pins;
- m3-max-63057, the metal2vulkan and metal2vulkan-runtime suites and doctests at the pin: 3349 of
  3360 passed. The failures are the render key, the AIR printout and the golden table (bless due
  at development's next pin) and the engine inventory's 8 parts: 2,142 cells moved, 0 rows new or
  gone, of which 1,342 are the storage forms' removal below this commit (ilock, m3-max-63032) and
  800 are this commit's, the resident-table encoder operations now refused: m3-max-63151, the
  parts with every difference printed, names them as 50 entries on all 16 profiles, each
  ok -> Unsupported{GpuEncodedIndirectCommands; NotImplemented}, in 31 fixtures, every entry a
  kernel that encodes indirect commands (26 engine/icb_* and 3 kernel_icb_* fixtures,
  resident_draws.ll's rd_encode and mesh_commands.ll's six enc_* kernels); the other 1,342 are
  ilock's, class for class. The inventory compiles under RESIDENT_TABLES
  (spirv::testing::committed_profiles), and its bless runs on macOS only (bless_engine_inventory
  refuses without every assembler, m3-max-63084);
- docs/REFUSALS.md regenerated by scripts/refusal-surface/refusal_surface.py;
- no states-only play: the runtime compiles under the identity domains, whose output this commit is
  expected not to change. That is read from the code: icb.rs, the identity lowering, is untouched
  and still selected first. It is not measured, because the golden table's every cell is re-keyed
  until development's bless. ilock and this commit report the same staleness: 29,792 cells,
  m3-max-63032 and 63057.
This commit is contained in:
Anees Iqbal committed 2026-11-21 04:39:28 -08:00
1 parent cbb1922b4d
commit 20ae73f152
21 files changed
+419 -3967

No files matched your search

+11 -9
View File
@@ -1484,7 +1484,11 @@ and the lowest constant level of detail). A sample's level is its sampler's to b
### Indirect command buffers
An indirect command buffer's commands are records in ordinary buffer storage
(`bind::indirect_commands`): one format whatever the descriptor, written by the CPU or by a kernel.
(`bind::indirect_commands`): one format whatever the descriptor, written by the CPU. Under the
resident-table domains a function's encoder operations are refused,
`Unsupported{GpuEncodedIndirectCommands, NotImplemented}`; under the identity domains a function
writes the render commands section 1 names, into the records `pipeline::IndirectDrawLayout`
states, and is refused the same way for any other operation.
The binder replays records into dispatches and draws: on the host, or on the device through a
preprocessing kernel (`replay_preprocess`), and through `VK_EXT_device_generated_commands` where
the device has it (`replay_preprocess_generated`). Draws of primitives under the encoder's
@@ -1501,14 +1505,12 @@ reads no buffer and no `[[primitive_id]]` may instead merge into one draw (`Draw
two merge passes (`draw_merge_module`) write each command's first vertex in the merged draw, and
the vertex function, compiled as its merged variant (`VariantKey::merged_draws`), finds its
command by that prefix and runs the command's vertex, instance and buffers, in the commands'
order. A kernel that encodes commands writes the records that start at
`bind::indirect_commands::records_address` of the buffer's ID, outside every Metal address, and
finds them only at their start: records may run past later IDs' starts, and a resident set
(`bind::ResidentSet`) keeps each records range whole. Each of the kernel's writes of a command's
record also stores 1 at the command's written flag, a `u32` a command past the records
(`bind::indirect_commands::written_flag_offset`), where the storage holds them; storage that ends
at its records takes none. A consumer whose own writes of the records set the flags too may reset
only the flagged records of a run of commands, clearing each flag with its record.
order. A buffer's records start at `bind::indirect_commands::records_address` of its ID, outside
every Metal address; records may run past later IDs' starts, and a resident set
(`bind::ResidentSet`) keeps each records range whole. Storage may hold a written flag per command,
a `u32` a command past the records (`bind::indirect_commands::written_flag_offset`): a consumer
whose own writes of the records set the flags may reset only the flagged records of a run of
commands, clearing each flag with its record.
## 7. Caching