From cd3e2a9274d6546ce1c86b1a69d739ea0df74d13 Mon Sep 17 00:00:00 2001 From: Anees Iqbal Date: Thu, 12 Nov 2026 09:16:41 -0800 Subject: [PATCH] SEMANTICS_VERSION 2054: AIR 2.9's private tensor intrinsics, with their new operands The commits before this one add the forms of two tensor intrinsics that Apple's compiler emits at macOS 27 (AIR 2.9, air64_v29): - air.init_strided_private_tensor.i32.{global,local} is now void (ptr, i16, ptr data, ptr, ptr, i8, ptr same-space, i32, i8), three operands more than AIR 2.8's; - air.get_extent_private_tensor.i32 is now i32 (ptr, i16, i16, i16), one i16 more. Tensor::InitStrided and Tensor::Extent each gain `trailing`, the AIR 2.9 form, through the existing `alternative` mechanism. canon's tensor form models the AIR 2.9 calls only when the new operands carry the values every call read so far passes: null, 0 and -1 for init, and 0 for extent. That covers every MPS row read and our own tns_mm sources compiled as MSL 4.1 for macOS 27 (m3-max-21620). Any other value stays a call and is refused as an unmodeled tensor operation, since what those slots carry otherwise is not established. New tests cover classification of both forms and of near-misses, and canon accepting only those values. Verified: - At 43eb38517e: metal2vulkan-air passes 558/558, clippy and rustdoc -D warnings are clean (m3-max-21641), and engine_matmul2d passes 14/14 (m3-max-21645). - Of macOS 27's 590 MPS functions in release on RDNA3 (m3-max-21638), all 55 DeclaredSignatureMismatch rows move past decode: - 3 translate and pass spirv-val; - 12 reach the existing honest refusal of a matmul2d run of the single-thread or v2 form; - 40 reach GenericPointer(Memory). 160 rows translate (157 before). The slowest row takes 0.34 s and the largest peak is 198 MB. Not run: execution of an AIR 2.9 tensor kernel on a device. --- crates/metal2vulkan/src/cache/mod.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/metal2vulkan/src/cache/mod.rs b/crates/metal2vulkan/src/cache/mod.rs index 59a9dea46..4a261d46a 100644 --- a/crates/metal2vulkan/src/cache/mod.rs +++ b/crates/metal2vulkan/src/cache/mod.rs @@ -60,7 +60,7 @@ mod tests; /// unchanged version, and its bless records the version. Independent of the crate's version and of /// [`ARTIFACT_FORMAT_VERSION`]. The commit that bumps it says what changed; this comment keeps no /// history. -pub const SEMANTICS_VERSION: u32 = 2053; +pub const SEMANTICS_VERSION: u32 = 2054; /// The byte-layout version of encoded artifacts (`CompiledFunction::to_bytes` and the /// [`PipelineArtifact`] encodings). Every encoded artifact carries it, and a decode under another