Files
metal2vulkan/docs
Anees Iqbal 1fefc3d956 SEMANTICS_VERSION 2065, ARTIFACT_FORMAT_VERSION 510, RUNTIME_VERSION 2167: a one-row ragged dispatch of a simdgroup-only kernel runs flat in the call's threadgroups
The four commits before this one. A ragged dispatch of a kernel that uses simdgroups was split into a body and an edge
variant, a second full compile of the same kernel (Blender's Cycles kernels on RADV: concurrent ~11 GiB compiles).
The kernel partition now has three classes, decided from structure alone (barrier execution scope, fence and atomic
scope, simd_/quad_ functions, is_uniform, the simdgroup size, the lane builtins): Oblivious, Simdgroups and Observed;
air.all/any of a bool vector now counts as the thread's own (a BoolReduce false positive). New:
KernelFacts::partition_simdgroups, LoweringInputs and VariantKey::call_threadgroups, RuntimeFact::CallThreadgroups
(Variant mechanism, fact id 97). Under flat_grid + call_threadgroups invocations count by subgroup lane order in the
flattened tiers, so workgroup w is Metal's threadgroup w with its simdgroups; the lane builtins are derived; lanes past
the grid return before the body. The compile refuses the bit without flat_grid, with replay_bindings, or for a module
that would hold a workgroup barrier. The runtime's flat_direct tries the plain flat variant first and, for a one-row
grid in one-row threadgroups, then the call variant (its own refusal flag; None, unremembered, when the threadgroup
size asks for emulated simdgroups). Indirect and replay paths still need an oblivious kernel; a kernel with a
threadgroup barrier keeps the split.

Verified (on the branch): m3-max-23184 (gem10, at 4c5d46f8d9) workspace clippy all features, clippy m2v_gpu on runtime
and validation, rustdoc, 136/137 translator tests (the one a test's use of flat_rmw, fixed after), lavapipe 7/7
(FLAT-SIMDGROUPS VkPipelines [1, 2, 2, 2]; lavapipe's 8-lane subgroups emulate the sum, so it splits); m3-max-23193
(8a46347092) 10/10, a_flat_grid_of_the_call_s_threadgroups_admits_a_kernel_of_simdgroups over every committed
profile; 780M RADV (m3-max-23200) 4/4, VkPipelines [1, 2, 2, 1]: the simdgroup barrier + simd_sum kernel runs flat in
one VkPipeline, every thread's word matching Metal's partition, the partial last simdgroup's sum included;
m3-max-23202 workspace and m2v_gpu runtime clippy clean. No guest kernel was dispatched through this path.
2026-11-12 16:29:57 -08:00
..