Files
metal2vulkan/crates
Anees Iqbal 2f127db94b Binder: a mixed dispatch is checked against the emulated variant's rules with its deep threadgroups
The question: does the emulated-simdgroups variant's plan let a [1, 1, 96] threadgroup through on
a device whose maxComputeWorkGroupSize z is 64? It does, and rightly: the variant is a kernel of
the Spec form without compute derivatives (a flattened tier refuses them,
lower::dispatch::plan_kernel), so it declares SpecKey::DeepThreadgroup, and its plan runs a
threadgroup deeper than DEEP_THREADGROUP as one row (sx*sy*sz, 1, 1). The flattened plan's
up-front check of a mixed dispatch's regions (emulated_rules) copied deep = false from the
flattened tier's rules, so it refused, with LocalSize Z, a dispatch the variant runs. The wrong
side was the up-front check.

- bind/dispatch.rs: emulated_rules sets deep: true, with the reason in its doc.
- RUNTIME_VERSION 2542 (a mixed dispatch of a deep interior now runs instead of being refused).
- Tests: engine_simd_emulated's a_mixed_dispatch_is_checked_against_the_variants_limits on
  nvidia-rtx50-linux (Direct, z at most 64): an interior of [1, 1, 96] and of [1, 1, 64] asks for
  the variant, whose plan runs both regions. rt's every_device_runs_a_threadgroup_deeper_than_the_floor:
  simd_sum_k (engine/simd_ops.ll) as one threadgroup of [1, 1, 96] answers Metal's simdgroups of
  32 consecutive threads.
2026-11-20 10:31:21 -08:00
..