From fb49fe664cf67ef2d283cd0ad2d115ddd31627aa Mon Sep 17 00:00:00 2001 From: Anees Iqbal Date: Thu, 19 Nov 2026 02:41:44 -0800 Subject: [PATCH] conformance: the new runtime's side answers a compute state's staticThreadgroupMemoryLength RtSide left Side::static_threadgroup_memory_length at the trait's default, so compute-threadgroup-simd-scratch ended refused on rt at its first site (case/static-threadgroup-memory-length, "Unavailable" with the call's name) before it dispatched anything. rt's ComputePipelineState now answers staticThreadgroupMemoryLength (the translator's ComputePipelineMetalInfo value, rounded up to 16 as Metal reports it), so the side answers it from the held state, as the old runtime's side does from its own. The compute module's held_pipeline is shared with the parent module for it. Verified at this commit: cargo fmt only; the build, the suite and the lavapipe replay run in the lane's check job. --- crates/metal2vulkan-conformance/src/rt_side.rs | 5 +++++ crates/metal2vulkan-conformance/src/rt_side/compute.rs | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/crates/metal2vulkan-conformance/src/rt_side.rs b/crates/metal2vulkan-conformance/src/rt_side.rs index 0ee0fc4b7..116f01a76 100644 --- a/crates/metal2vulkan-conformance/src/rt_side.rs +++ b/crates/metal2vulkan-conformance/src/rt_side.rs @@ -614,6 +614,11 @@ impl Side for RtSide<'_> { Ok(keep(&mut self.pipelines, state)) } + fn static_threadgroup_memory_length(&mut self, pipeline: Handle) -> Answer { + let state = self.held_pipeline(pipeline)?; + Ok(u64::from(state.static_threadgroup_memory_length())) + } + fn buffer(&mut self, bytes: &[u8]) -> Answer { let handle = self.zeroed_buffer(bytes.len())?; let contents = (self.held(handle)?.contents()) diff --git a/crates/metal2vulkan-conformance/src/rt_side/compute.rs b/crates/metal2vulkan-conformance/src/rt_side/compute.rs index 7362f5756..ce35ea1de 100644 --- a/crates/metal2vulkan-conformance/src/rt_side/compute.rs +++ b/crates/metal2vulkan-conformance/src/rt_side/compute.rs @@ -57,7 +57,7 @@ impl RtSide<'_> { }) } - fn held_pipeline(&self, handle: Handle) -> Answer<&rt::ComputePipelineState> { + pub(super) fn held_pipeline(&self, handle: Handle) -> Answer<&rt::ComputePipelineState> { (self.pipelines.get(handle.0 as usize)) .ok_or_else(|| Failure::named("NoSuchHandle", format!("compute pipeline {}", handle.0))) }