Under the identity domains every buffer slot access rounded its address down to a word
(64-bit add, and 3, sub, subb per access) and moved 8- and 16-byte values as words. On the
RX 550's one-wave dispatches that rounding is about 20 scalar instructions per wave.
Metal's API validation refuses a buffer bound at an offset that is not a multiple of its
argument type's alignment (air.arg_type_align_size): measured on an Apple M3 Max by the
conformance crate's vector_access_placement probe, "must be a multiple of 4 but was set to 2"
for a uint * argument (constant too, and a struct of two uints), "of 16 but was set to 8" (and
4) for a float4 *, "of 2 but was set to 1" for a ushort *; a uint * at 4, a ushort * at 2 and a
uchar * at 1 pass. So each plain buffer argument with an alignment of 2 or more states
RuntimeFact::AddressAlignment { slot, align } (at most 16), for a binder to refuse what Metal
refuses. Where that alignment is at least 4 and the slot's window starts at a multiple of 16,
the slot's address is a word memory's base as it is: each access is the 32-bit byte offset
m - start from address + start, through a PhysicalStorageBuffer byte array whose element
pointer is bitcast to a pointer to a one-member Block of the unit (NonWritable for an unwritten
slot's load), then member 0; nothing is rounded, and an 8- or 16-byte access at an offset proven
a multiple of its size is one uvec2 or uvec4. OpBitcast between PhysicalStorageBuffer pointers
is valid SPIR-V (SPV_KHR_physical_storage_buffer). Every other identity slot (no alignment, 1
or 2, a buffer-table element, an argument buffer) keeps the word below each access, as before.
Atomics take their word place the same way. The default policy, so Device::new and the old
runtime, is unchanged.
The identity domains now need storageBuffer8BitAccess (in the new runtime's floor).
SEMANTICS_VERSION and ARTIFACT_FORMAT_VERSION are bumped for the new output and fact.
Measured before this change on the scratch forms (the same SPIR-V shape, the byte view at the
pushed address, no rounding, no anchor):
- the constant-reads probe's 13 columns, against the identity form before it (geomean / worst
column): RX 7900 XTX -4.3% / +0.5%, RX 550 -6.6% / +0.1%, RTX 3090 -54.2% / 0.0%. The
64-bit add without rounding failed the XTX by 8.9%;
- short-wave rows on the RX 550 (ladder job 42427, emulated module, against the old runtime):
k130 2.567x -> 2.295x, k106 1.656x -> 1.537x, k109 1.377x -> 1.233x, k171 1.342x -> 1.315x,
waves 2.461x -> 2.377x.