The 32 lanes of a Metal simdgroup are needed only by operations that read outside a quad. A kernel
whose every cross-lane operation is a quad operation (lower::simd::quad_only: some group operation,
each of quad scope, and no simdgroup-scope operation, AGX or matrix multiply-add, or subgroup-scope
barrier or fence) now takes the Direct tier with full subgroups and no required size where the
kernel stage runs full subgroups of its operations and its narrowest subgroup is below 32 lanes
(device::subgroup::quad_free, read from the stage's size range alone). Its requirement
(quad_requirement) sets ALLOW_VARYING_SUBGROUP_SIZE where the stage can take a size, and a local
size that is a multiple of the stage's largest size (VUID-VkPipelineShaderStageCreateInfo-flags-02758);
a threadgroup that is not runs the emulated-simdgroups variant, as a pinned kernel's does. Such a
kernel pins nothing, so the widest-pin rule does not weigh it. The pin to 32 stays where 32 is the
device's narrowest size.
Why it is exact: a quad is four subgroup lanes from a multiple of 4, all in one subgroup (Vulkan
9.27.9), and a compute dispatch runs one subgroup size (9.5.2); the kernel's simdgroup builtins
derive from the linear index (SubgroupId * SubgroupSize + SubgroupLocalInvocationId, reading the
SubgroupSize builtin where no size is pinned), and its quad operations from SubgroupLocalInvocationId
& 3 and & ~3, so every size of 4 lanes or more gives Metal's quads.
The guard min >= 4: a quad must be four lanes of one subgroup. A stage whose narrowest subgroup is
1 or 2 lanes could split a quad across subgroups, so such a stage keeps the tier its class takes.
A kernel with compute derivatives keeps the tier its class takes: their quads need its
two-dimensional local size, which the flattened tiers refuse (ComputeDerivativesWithSimd). Without
this exclusion lavapipe's quad kernels with derivatives, which run emulated today, would be refused.
Where it applies among the committed profiles: the four Intel ANV profiles (8 to 32: multiple 32,
varying), lavapipe and gate-lavapipe-x86_64 (8: multiple 8) and gate-lavapipe (4: multiple 4). Not
on NVIDIA (32), RDNA (32 to 64), moltenvk-m3 (its kernel stage takes no size, so it runs the API's
32 alone) or runtime-floor (no quad class).
Measured on the Iris Xe (RPL-P, ANV), job m3-max-71702, the lane-only form of this change (E: the
base at eda92e1207, Q: this form, E2: the base again; cold plays of the consumer's recording to
frame 345): the regression row's kernel took Q in all 21 of its constant sets (15832 dispatches,
100%); per dispatch E 1.6018 ms, Q 0.7314 ms, E2 1.6006 ms (Q/E 45.7%); values E/Q and E/E2 0
differing of 261 buffers; translation 18 s and 0.92 GiB peak against 17 s and 0.92 GiB. The
driver's executable statistics (job m3-max-71726): Q compiles at SIMD8 (SIMD16 for one state),
15 to 50% fewer instructions than the emulated form, against about 2800 spills a state when pinned
to 32.
SEMANTICS_VERSION 2297 (modules change on the profiles above); ARTIFACT_FORMAT_VERSION 595
(SubgroupRequirement gains `varying`).
Tests: device::tests::subgroup (the predicate over size ranges, the guard, and the committed
profiles it takes), engine_simd (a quad-only kernel's requirement on every committed profile, and
the flattened kernels' constraint), engine_quad_ops (the quad fixture's kernels in the Direct tier at
8 on lavapipe and at 8, 16 and 32 on an Intel profile; the emulated variant on lavapipe),
engine_dispatch (derivatives beside a quad keep lavapipe's emulated tier), and the runtime's
every_device_runs_a_quad_only_kernel_at_the_size_it_gives under a device cfg.