step.motion.path.passes.lowering¶
Lowering pass — turn a tree of Step objects into the path IR.
This is the entry point of the pipeline. It walks the Step tree, recursively
flattens Sequential and Parallel composites into a linear node list,
identifies the motion spine inside parallel branches, and produces:
list[Optional[PathNode]]— flat path nodes (Segments, SideActions, orNoneplaceholders for deferred steps).list[tuple[int, Defer]]— deferred entries to resolve at runtime, keyed by their index in the node list.
Functions¶
|
Extract motion IR from a resolved step via its |
|
Resolve a builder to a concrete Step instance. |
|
Check if two segments can use warm-start (same motion type). |
|
Recursively flatten |
|
Flatten a Parallel step, identifying the motion spine branch. |
|
Flatten a list of steps into a linear path. |
Module Contents¶
- step.motion.path.passes.lowering.extract_segment(step: step.Step) step.motion.path.ir.Segment¶
Extract motion IR from a resolved step via its
lower_to_segments().A step that is not optimizer-supported returns
Noneand is rejected here withTypeErrorsoflatten_onecan treat it as a side action.
- step.motion.path.passes.lowering.resolve_step(step) step.Step¶
Resolve a builder to a concrete Step instance.
- step.motion.path.passes.lowering.is_same_type(a: step.motion.path.ir.Segment, b: step.motion.path.ir.Segment) bool¶
Check if two segments can use warm-start (same motion type).
follow_lineis treated as a forward linear for warm-start purposes: it runs the sameLinearMotionaxis internally, so velocity can be carried acrosslinear(Forward) ↔ follow_linetransitions.splinenever warm-starts.
- step.motion.path.passes.lowering.flatten_one(step, nodes: list[step.motion.path.ir.PathNode | None], deferred: list[tuple[int, step.logic.defer.Defer]]) None¶
Recursively flatten
stepinto path nodes.Appends to
nodesin-place. Deferred steps becomeNoneplaceholders with entries indeferredfor runtime resolution.
- step.motion.path.passes.lowering.flatten_parallel(par, nodes: list[step.motion.path.ir.PathNode | None], deferred: list[tuple[int, step.logic.defer.Defer]]) None¶
Flatten a Parallel step, identifying the motion spine branch.
- step.motion.path.passes.lowering.flatten_steps(steps: list) tuple[list[step.motion.path.ir.PathNode | None], list[tuple[int, step.logic.defer.Defer]]]¶
Flatten a list of steps into a linear path.
- Returns:
(nodes, deferred)wherenodesis a flat list ofSegment,SideAction, orNone(deferred placeholder), anddeferredis a list of(index, Defer)pairs for runtime resolution.