What: two changes to how an indirect command's record names a pipeline state the program
released.
1. A record's state word gains a bit, KERNEL_PIPELINE (layout::KERNEL_PIPELINE = 2,
CommandRecord::kernel_pipeline, RecordView::kernel_pipeline). A kernel's pipeline setter writes
it wherever the token names a state. A kernel's copy carries it with the pipeline word, and its
"reports" test now reads RETAINED alone. A kernel's compute reset keeps the bit beside RETAINED.
Metal's reset leaves the command executing with the pipeline it had (measured on the M3 Max and
the M4: reported cleared, run by the next dispatch). For a kernel's write, that pipeline is the
state the write resolved, so the retained pipeline keeps saying the kernel wrote it. The CPU's
compute reset does the same. The CPU's pipeline setter clears the bit, and a record the CPU
wrote never carries it. The replay's state-word check and decode accept the bit; either bit
beside no pipeline is still malformed. Where the bit is set, the runtime's host step, getter and
identifier ignore the state the CPU set and resolve the ID by its holder as the GPU last could
write it.
Case 4 (the CPU set x, x released, y took the ID, then a kernel writes the state) now runs y, as
the M3 Max and the 5300M do; before, it ran x, announced. Case 5 (the kernel writes only the
buffers) runs x unannounced, as every Mac does. The host step no longer guesses, so the
"Unsure" announcement and may_name_another are gone.
2. The device keeps the program of each freed pipeline state ID's last holder (FreedPrograms):
one per ID, dropped when any state takes the ID. Every live indirect command buffer of the
device holds the store and the device holds it weakly, since a program holds its device. A
buffer the GPU may write takes the store's programs at its first such write. Case 1 (x released
before the write, its ID taken by no one) now runs x, as the M3 Max and the UHD 630 do; the
Radeon Pro 5300M fails the command buffer instead. Where Macs disagree, the cheaper answer is
taken: failing the CB would need a failure path decided mid-flight in a host step. Bound: one
program per freed ID that no state retook, so at most the peak count of live
supportIndirectCommandBuffers states plus placed IDs, kept only while an ICB of the device
lives. Still announced (ReleasedCommandState, the command runs nothing): a state released while
no ICB of the device lived, and one past the ID's last four holders.
SEMANTICS_VERSION 2117: kernels that set pipelines now write the state-word bit, so their SPIR-V
and golden hashes change (re-blessed on development). api_signatures blessed for the new field and
method. No new Degradation kind. RUNTIME_VERSION is left to the landing.
Tests: indirect_commands::tests::records (a_kernel_s_pipeline_is_told_from_the_cpu_s, plus the
random field round trip with the bit). The engine_indirect_commands expectations of kernel writes
carry the bit, and the kernel reset keeps it. Runtime: released_programs (the freed store's one
program and its release on take) and notice_command_buffers (a host-step Unrun now reached through
a kernel's write of a state released while no ICB lived). Validation runtime_lane:
indirect_host_steps (case 1 runs the template; the forced notice past four holders and while no
ICB lived; case 4 runs the flat template; case 5 runs the template unannounced) and
indirect_executions (the GPU-writable copy case no longer announces). Run on lavapipe in the
lane's msi job; the results go in the lane report.
Also: Pin the notice of a state released while no buffer of commands lived; Replay tests: the kernel's pipeline bit runs, an unknown bit faults.
Verified (lane relstate, msi m3-max-30537): clippy --cfg m2v_cpu_icd exit 0; runtime tests
24/24; validation tests 113/113 on lavapipe, the new released-state cases 1, 4 and 5 among
them. Landed (main) at once: the plain clippy and translator rerun (m3-max-30546) and the
hand negative control (m3-max-30555, steelbrain/relstate-nc) run after landing; the engine
golden hashes of kernels that set pipelines are re-blessed on development.
RUNTIME 2319: what a GPU-written record naming a released or reused state runs changes.