From f891a2d20bee783ea55b093b4eeac6573313bbe2 Mon Sep 17 00:00:00 2001 From: Anees Iqbal Date: Wed, 11 Nov 2026 05:09:05 -0800 Subject: [PATCH] tests::engine_typed_clamp: the resources of a kernel that reads its grid position take a zero dispatch region The new sized-array fixture test's kernel reads [[thread_position_in_grid]], so its plan declares a DispatchRegion push field, which the shared resources helper refused (the translator suite at 26d6ebe604 failed that test at the helper's panic, before any run). Zero push bytes are one region at the grid's origin, as engine_absent_value_arguments fills it. --- crates/metal2vulkan/src/tests/engine_typed_clamp.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crates/metal2vulkan/src/tests/engine_typed_clamp.rs b/crates/metal2vulkan/src/tests/engine_typed_clamp.rs index 050ce21c8..1de58097b 100644 --- a/crates/metal2vulkan/src/tests/engine_typed_clamp.rs +++ b/crates/metal2vulkan/src/tests/engine_typed_clamp.rs @@ -97,6 +97,8 @@ fn slot(index: u32) -> ResourceSlot { } /// `threads` threads along x (`local` the workgroup's shape), and buffer `i` holding `bufs[i]`. +/// Zero push bytes: each buffer is bound at its start, and a dispatch region (a kernel that reads +/// its grid position) is one region at the grid's origin. fn resources(plan: &Plan, local: (u64, u64), bufs: &[Vec]) -> Resources { let mut s = BTreeMap::new(); s.insert(SpecKey::LocalSize(Axis::X), local.0); @@ -109,6 +111,7 @@ fn resources(plan: &Plan, local: (u64, u64), bufs: &[Vec]) -> Resources { (PushField::SlotBindOffset(_), PushLoc::Push { offset }) => { push[offset as usize..offset as usize + 4].fill(0) } + (PushField::DispatchRegion, PushLoc::Push { .. }) => {} other => panic!("unexpected push field {other:?}"), } }