The AIR that macOS 26.6.1's Metal on x86-64 hands its device, for a library whose own
declarations pass it so, leaves the offset position out of every 2D, 2D array and 3D texture
atomic:
air.atomic_fetch_max_explicit_texture_2d.u.v4i32
v4i32 (ptr addrspace(1), <2 x i32> coord, <4 x i32> value, i32, i32)
where Xcode's AIR passes (tex, coord, <2 x i32> offset, value, order, access). The decoder knew
only the offset form, so the declaration classified as a mismatch and the guest's
newComputePipelineState failed (18 of the 38 texture atomic cells of a sweep on the RTX 5080).
What changes: Texture::alternative() offers a legacy template for a 2D or 3D atomic, as for the
legacy texture read, and its layout leaves the offset out. classify() tries the current form, then
the legacy one, so the declaration picks the form. The lowering already treats a missing offset as
zero. 1D, 1D array and buffer atomics keep their one offset-less form.
Why: these are valid declarations Metal accepts; refusing them failed the guest's pipelines.
Verified:
- families_tests::atomic_forms_are_chosen_by_the_declaration: every operation (fetch ops,
exchange, load, store, compare_exchange_weak, the ulong max, 16-bit coordinates) on 2D, 2D array
and 3D shapes classifies the offset-less declaration as the legacy form; a 1D atomic declared
with an extra position stays a mismatch.
- engine_texture_atomic_unk::legacy_texture_atomics_without_the_offset_compile_alike: our own
fixtures, rewritten at test time without the offset, compile on the same profiles as the
originals with the same strategies, image atomic opcode counts and image formats.
- The release command line translated the five libraries the guest's sweep dumped on the RTX 5080
laptop profile; the owned verifier and spirv-val (vulkan1.2 and vulkan1.4) passed. The guest's
libraries were read only on the host that ran them; nothing of them is committed.
- clippy -D warnings (plain and m2v_gpu) and nextest --no-run on gem10.