Expand description
Metadata-only rewrite rules for the optimizer (Layers 1 and 2 of the execution model).
Reduce rules are the cheapest transformations in the execution pipeline: they operate purely on array structure and metadata without reading any data buffers.
There are two kinds of reduce rules:
-
ArrayReduceRule(Layer 1) – a self-rewrite where an array simplifies itself. Example: aFilterArraywith an all-true mask removes the filter wrapper. -
ArrayParentReduceRule(Layer 2) – a child-driven rewrite where a child rewrites its parent. Example: aDictArraychild of aScalarFnArraypushes the scalar function into the dictionary values.
Rules are collected into ReduceRuleSet and ParentRuleSet respectively, and
evaluated by the optimizer in a fixpoint loop until no more rules apply.
Structs§
- Parent
Reduce Rule Adapter - Bridges a concrete
ArrayParentReduceRule<V, R>to the type-erasedDynArrayParentReduceRule<V>trait. Created byParentRuleSet::lift. - Parent
Rule Set - A set of parent reduction rules for a specific child array encoding.
- Reduce
Rule Set - A collection of
ArrayReduceRules registered for a specific encoding.
Traits§
- Array
Parent Reduce Rule - A metadata-only rewrite rule where a child encoding rewrites its parent (Layer 2).
- Array
Reduce Rule - A metadata-only rewrite rule that transforms an array based on its own structure (Layer 1).
- DynArray
Parent Reduce Rule - Type-erased version of
ArrayParentReduceRuleused for dynamic dispatch withinParentRuleSet.