From 99f90c750364482bf8a6ba4b24b68f609dce0eab Mon Sep 17 00:00:00 2001 From: Anees Iqbal Date: Mon, 23 Nov 2026 01:50:29 -0800 Subject: [PATCH] Translator: SEMANTICS_VERSION 2287 and ARTIFACT_FORMAT_VERSION 593 for a deep kernel's plain WorkgroupSize parts What changed in the output (ac5c562a08): every kernel of the Spec local-size form (all but compute-derivative kernels) declares its WorkgroupSize as a composite of three plain specialization constants, SpecKey::WorkgroupSize(X, Y, Z), defaulting to its LocalSize defaults, where it had OpSpecConstantOp Select parts over IMul products of LocalSize; the body is unchanged. A runtime writes the new keys with the threadgroup's others from pipeline::threadgroup_constants. The artifact format gains the SpecKey::WorkgroupSize member (the_version_593_member_round_trips). Checks for this tip, run before it lands: the translator suite, the runtime guard and rt on lavapipe (msi), clippy in every configuration and Rustdoc, rt's device tests and the conformance replay on AMDVLK and RADV on the RX 7900 XTX and a Radeon 780M, the cold #424 make on AMDVLK, and the translation census against f8181e2a6c. --- crates/metal2vulkan/src/cache/mod.rs | 4 ++-- crates/metal2vulkan/src/cache/tests.rs | 11 +++++++++++ 2 files changed, 13 insertions(+), 2 deletions(-) diff --git a/crates/metal2vulkan/src/cache/mod.rs b/crates/metal2vulkan/src/cache/mod.rs index d0093c5b9..44914e0f1 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 = 2286; +pub const SEMANTICS_VERSION: u32 = 2287; /// The byte-layout version of encoded artifacts (`CompiledFunction::to_bytes` and the /// [`PipelineArtifact`] encodings). Every encoded artifact carries it, and a decode under another @@ -70,7 +70,7 @@ pub const SEMANTICS_VERSION: u32 = 2286; /// re-typed in an encoded type, its `codec` body or its `envelope`. A variant removed while its tag /// stays unused needs no bump: an entry holding it fails to decode, which is a miss. The commit that /// bumps it says what changed; this comment keeps no history. -pub const ARTIFACT_FORMAT_VERSION: u32 = 592; +pub const ARTIFACT_FORMAT_VERSION: u32 = 593; /// The version of what this crate gives a runtime for the runs of a compiled pipeline, beside the /// compile: the device a run opens and what it enables, the Vulkan and Metal vocabularies a runtime diff --git a/crates/metal2vulkan/src/cache/tests.rs b/crates/metal2vulkan/src/cache/tests.rs index 386732439..d65c494b4 100644 --- a/crates/metal2vulkan/src/cache/tests.rs +++ b/crates/metal2vulkan/src/cache/tests.rs @@ -605,6 +605,17 @@ fn the_version_327_members_round_trip() { assert_eq!(decode::(&encode(&extension)), Ok(extension)); } +/// The member format version 593 appends encodes and decodes as itself: a deep kernel's workgroup +/// size on one axis. +#[test] +fn the_version_593_member_round_trips() { + use crate::pipeline::sym::{Axis, SpecKey}; + for axis in [Axis::X, Axis::Y, Axis::Z] { + let key = SpecKey::WorkgroupSize(axis); + assert_eq!(decode::(&encode(&key)), Ok(key)); + } +} + /// The members format version 234 appends encode and decode, each as itself: the object function's /// specialization keys and the task stage's and the payload's limits. #[test]