Expand description
2026-09-28: The buffer planner: an arena offset for every materialised edge of a plan, sized once for the widest padded row count, so no buffer is reallocated after boot (the CUDA-graph constraint: captured pointers must stay valid).
An executor may add a Layout: edges it binds to buffers of its own, outputs a kernel
writes in place over one of its inputs, and edges a kernel writes back to back.
Owner: metrale-circuit. Invariants:
- Two edges whose live ranges overlap never share a byte, unless a
Layoutalias joins them; the edges of one alias class share their bytes by construction. - An edge is live from the group that writes it to the last group that reads it; an edge read or written outside the plan (its inputs from another section, and the declared outputs) is live for the whole plan. An alias class is live over the union of its edges.
- The edges of a pack are placed back to back, in pack order, with no padding between.
- The edges of a row pack share every row: row
iof memberjsits at the pack’s base plusipack rows plus the widths of members0..j; each member’srow_strideis the pack row. A row pack placedoveran edge occupies exactly that edge’s bytes. - Offsets of unpacked storage are aligned to
ALIGNbytes; a pack’s first edge is.
Structs§
- Buffer
Plan - 2026-09-28: The arena layout of one plan.
- Layout
- 2026-09-28: Storage constraints an executor puts on a plan’s materialised edges.
- RowPack
- 2026-09-28: Edges laid side by side within each row: row
iholds rowiof every member, in order. The members must have one row count. Withover, the pack occupies that edge’s bytes (a kernel rewrites the edge in place into the members), which must be exactly the pack’s size. - Slot
- 2026-09-28: One placed edge.
Enums§
- Plan
Error - 2026-09-28: Why a plan could not be laid out.
Constants§
- ALIGN
- 2026-09-28: Offset alignment, in bytes.
Functions§
- live_
ranges - 2026-09-28: Live range of every materialised edge in
plan, keyed by edge. - plan_
buffers - 2026-09-28: Place every materialised edge of
plan, sized formax_rowsrows, with no layout constraints. - plan_
buffers_ with - 2026-09-28: Place every materialised edge of
planthatlayoutdoes not bind, sized formax_rowsrows.