You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Dead code: MarlinDialect.prologue() is never emitted — G21/G94 (units & feed-mode) absent from output #322
Found while scoping #197 (machine-profile spec). Filing as an honest, separate finding — not fixing inline.
What
MarlinDialect.prologue() (fiberpath/gcode/dialects.py:35) returns ["G21"/"G20", "G94"] (unit mode + feed mode), but nothing in the production path calls it. The only caller is its own unit test (tests/gcode/test_dialects.py:48).
Consequently:
The serialized G-code (fiberpath/gcode/serializer.py:serialize) emits only ; Parameters …, G0, and G92 — no G21/G20 and no G94. Confirmed against every examples/*/expected.gcode golden (unique opcodes are just G0 and G92).
MarlinDialect.units and MarlinDialect.feed_mode are read only inside the dead prologue() method, so they currently have no effect on output.
Why it matters
A streamed program relies entirely on the controller's existing modal state. A controller left in inch mode (G20) or inverse-time feed (G93) would mis-execute the program — coordinates are authored in mm and feed in mm/min, but FiberPath never asserts those modes.
Options
Wire it in — have serialize() prepend dialect.prologue() so output is self-describing (changes all goldens; would need regeneration + a note).
Remove the dead code — drop prologue() + units/feed_mode if the contract is "the controller MUST already be in mm + units-per-minute mode," and document that as a compatibility requirement instead.
#197 will document the mm + units-per-minute assumption as an explicit compatibility requirement regardless; this issue tracks whether FiberPath should emit the setup codes or require them.
Activity
feat(planning): consume a versioned machine profile, not a hardcoded …
fix(gcode): emit a self-describing modal preamble (G21/G90/G94) (#322) (
chore(release): prepare 0.10.0 (#325)