The partial-threadgroups variant refused a kernel with an imageblock slice write every
invocation shares (texture::cooperative), as SharedSliceWrite. The walk guarded the shared
write like any other instruction, so its trailing workgroup barrier stood under `if live`,
and the walked invocations past Metal's threads skipped their shares. It now takes the shared
slice as one of the walk's synchronizations, on every tier (texture::shared_slice, in
SyncSet::WorkgroupBarriers and divergent::is_sync):
- every invocation reaches the slice's barrier;
- the invocations live at the slice write the slice's cells among them. In a partial
threadgroup those are Metal's threads: the first EmitCx::entry_threads invocations by lin.
The step of the shared loop is now that count rather than the workgroup's size, so Metal's
threads write every cell;
- a cell no thread of Metal's stored holds zero, the threadgroup arena's null initializer;
- the walked invocations store nothing in their cells before the barrier (the predicated walk).
The M3 Max recorded the same for Metal's own partial threadgroup, so this matches the
measurement rather than any documented rule. Probe imageblock_slice_past_the_grid, job
m3-max-85078: each cell of a thread past the grid lands zero, in two runs of two dispatches.
No MSL or Metal text says what such a cell holds, and the docs claim nothing beyond the
recording.
The shared slice is never by itself a reason to walk. Its guard's branch, at a
workgroup-uniform point, is taken by every invocation, so a kernel whose only non-uniform
synchronization is a shared slice keeps its unwalked module. Outside a walk the shared loop is
unchanged.
- error: PartialThreadgroupsCause::SharedSliceWrite goes, since nothing else raises it.
mesh::plan_partial_groups no longer refuses the variant for it. Feature::PartialThreadgroups'
and LoweringInputs::partial_threadgroups' docs drop it and say what the slice writes.
- runtime: its cache's refusal markers drop m2v-refused-slice (cache::REFUSALS has 5 entries).
PartialThreadgroupsSite::Structure's doc and the README's gap paragraph drop the slice.
Caches::refused now reads a variant's translation file in one lookup (the planner's
read-back of the cause table). It asked the store once per marker, and each Store::holds
opened the file in young and then old, and read it whole where its length was the marker's.
Three markers are 16 bytes, so one 16-byte file was read up to three times. Store::holds_one
takes the markers with their tags, opens the file once a generation, reads it only where its
length is a marker's, and matches the bytes against each. Store::holds is holds_one of one
marker. A hit in old still moves into young. Lookups count their opens under the tests
(Store::file_opens).
- tests:
- the red test turns green;
- each_structure_the_variant_does_not_take_names_its_cause keeps compute derivatives and
the tile function;
- the runtime's marker test drops the cause;
- api_signatures.tsv loses the two variant rows. REFUSALS.md and basis.rs regenerate
unchanged.
- a_variant_refusal_is_read_back_in_one_lookup_of_its_file writes each marker of REFUSALS
under a key of its own and reads each back with exactly one open. A missing key opens at
most twice, and a lowering of a marker's length is no refusal.
- SEMANTICS_VERSION 2366 (renumbered at landing: 2363-2365 went to arm 9, the blob move and the 1D bicubic): a partial-threadgroups
variant with a shared slice now compiles. RUNTIME_VERSION stays: no run of an unchanged
artifact differs, and the runtime-source fingerprint's inputs are untouched.
Verified:
- red d1d4b5cc9c, job m3-max-85298: a_partial_threadgroup_s_shared_slice_holds_zero_past_its_threads
fails at its compile ("unsupported: PartialThreadgroups: SharedSliceWrite"), and the filter's
other 20 tests pass. With Caches::refused asking once per marker, as before, the same job's
a_variant_refusal_is_read_back_in_one_lookup_of_its_file fails at 2 opens for
Structure(ComputeDerivatives). Green: 23 passed.
- suites (85298): product 3498 passed, 1 failed (golden_hashes_match_the_table, re-blessed on
development), 24 skipped; validation 1344 passed, 2 skipped; conformance 1055 passed,
0 skipped; doctests EXIT=0.
- clippy plain 85194, m2v_gpu 85193 and m2v_cpu_icd 85197 EXIT=0; rustdoc and api-docs 85195
EXIT=0, all at the tree of this change and the case that follows it.
- the guest's kernels, job m3-max-85164 (release, a Ryzen 7 7840HS): the two kernels this
refusal held in a recording's libraries lower and pass spirv-val on all 15 committed profiles,
under the plain module and both partial-threadgroups variants. The slowest row is moltenvk-m3's
emulated variant at 0.017 s, and the peak resident set is 32.6 MiB a process. Before this
change both variants were refused as SharedSliceWrite (job m3-max-85052).
- Metal's own answer, in the conformance case that follows (compute-imageblock-slice-past-the-
grid): recorded on the M3 (m3-max-85134), and equal on llvmpipe and on the RX 7900 XTX
(m3-max-85149).