Translator: an object function has one grid form, folded; the unfolded object grid is deleted

What: given_inputs compiles every object function folded (LoweringInputs::folded_groups), alone or
in a mesh render pipeline, so its draws run any object grid in pieces within the task stage's
limits (bind::mesh_arguments). The unfolded form is deleted: DispatchPlan::object_grid and the
decl's object_grid (an unfolded object function's threadgroups per grid, wrapped at 2^32),
lower::mesh::folds_object_grids with lower::mesh::mesh_stages, which only it called, and
compile_mesh_pipeline's choice between the two. The single-region builtins test keeps its kernel cases and drops the object grid's.

Why: condition 1 of the planner's ruling on the mesh build: one grid form, no device-chosen
second one. folds_object_grids chose the folded form on a device that runs mesh stages and has
device addresses, 64-bit integers, multiDrawIndirect and drawIndirectCount. Device::from_queries
refuses a device without the first two, and object and mesh functions now need the last two
with the extension, so every device that compiles an object function took the folded form and
the unfolded one was reached only by an object function compiled alone.

No SEMANTICS_VERSION bump: an object function's key holds folded_groups, so its key changes with
its module, and every profile refuses object functions under the identity domains today.
docs/API.md's mesh pipelines section and LoweringInputs::folded_groups say an object function
is always folded.

Verified: see the job named below.
This commit is contained in:
Anees Iqbal committed 2026-12-03 17:05:40 -08:00
1 parent 7948443887
commit 3e2e65ee1a
8 files changed
+16 -53

No files matched your search

+2 -3
View File
@@ -1194,9 +1194,8 @@ A grid Metal draws nothing for (an axis past 65,535 threadgroups, or more than 1
measured on the M3 Max) draws nothing: an object function's wrapper launches nothing for such a
grid.
An object grid runs at any count Metal runs, past the task stage's limits too, on a device with
`multiDrawIndirect` and `drawIndirectCount` (every committed profile with the extension): the
object function is compiled folded, its object stage reading the
An object grid runs at any count Metal runs, past the task stage's limits too: an object function
is always compiled folded, its one grid form, its object stage reading the
threadgroups Metal runs and its grid from a 32-byte region record at its
`PushField::ReplayRegionAddress`, so a draw runs its grid in pieces within the task limits. Metal's
threads per grid wrap to 32 bits along each axis, as its builtins report them. The lowering takes