Repository navigation
feat(planning): define the typed Motion IR (Move/MoveKind/Program/ProgramMeta) - #279
Merged
Merged
Conversation
…gramMeta) First build slice (S1) of the Motion IR epic (#136): introduce the typed, machine-agnostic toolpath vocabulary that plan_wind will lower to (#274) and that Stage 2 (#137) / Stage 3a (#138) will target. New module fiberpath/planning/ir.py: - MoveKind: RAPID (G0 <axes>; also the all-zero init move), SET_FEED (G0 F<rate> state op, not a G1 cut), SET_POSITION (G92 <subset>), COMMENT (; <text>). - Move (frozen): kind, targets: dict[Axis,float] (absolute, ordered), feed, text. - ProgramMeta: mandrel_diameter, wind_length, tow_width, tow_thickness. - Program: meta + moves. Reuses helpers.Axis (no X/A/B letters in the IR). Only the four kinds ever emitted by the current planner are modelled (opcode audit: G0/G92/comment only), per the investigation's minimal-IR finding — no `lay`, no G1, no M92, no dead prologue. Pure data vocabulary: no per-kind validation (internal representation, not a trust boundary; the byte-equal golden gate catches lowering mistakes). Pure addition — nothing imports it yet, so emitted G-code, the simulator, the plotter, and all goldens/snapshots are unchanged. Unit tests cover defaults, insertion-order preservation, per-kind construction, value equality, and immutability. Part of #136. Closes #273.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #136 (Motion IR epic). Closes #273. First build slice (S1) — the typed, machine-agnostic toolpath vocabulary that
plan_windwill lower to (#274) and that Stage 2 (#137) / Stage 3a (#138) will target.What
New module
fiberpath/planning/ir.py:MoveKind—RAPID(G0 <axes>; also the all-zero init move) ·SET_FEED(G0 F<rate>state op, not aG1cut) ·SET_POSITION(G92 <subset>) ·COMMENT(; <text>).Move(frozen) —kind,targets: dict[Axis,float](absolute, ordered),feed,text.ProgramMeta—mandrel_diameter,wind_length,tow_width,tow_thickness.Program—meta+moves.Reuses
helpers.Axis(no X/A/B letters in the IR).Shape decisions (from the investigation)
Only the four kinds the current planner actually emits are modelled — an opcode audit of the committed goldens found nothing but
G0/G92/ comment lines. So, per the minimal-IR finding: nolay, noG1,G92notM92, no deadG21/G94prologue, and aProgram/ProgramMetawrapper so the header data travels structurally (consumers stop re-parsing it in S3/S4). Pure data vocabulary — no per-kind validation (the IR is internal, not a trust boundary; the byte-equal golden gate catches lowering mistakes).Pure addition
Nothing imports the IR yet (
grepconfirms), so emitted G-code, the simulator, the plotter, and all goldens/snapshots are unchanged.Verification