Skip to content

docs(ir): Motion IR as a secondary versioned format + irVersion - #319

Merged
CameronBrooks11 merged 1 commit into
mainfrom
feat/openformat-c-ir-doc
Jun 29, 2026
Merged

CameronBrooks11 merged 1 commit into
mainfrom
feat/openformat-c-ir-doc

Conversation

@CameronBrooks11

Copy link
Copy Markdown
Member

Summary

Open-format slice C (#316) of epic #141 — document the Motion IR as a secondary, independently-versioned format and add an irVersion. Self-contained (no corpus/hosting — B/D).

What's here

  • docs/reference/motion-ir.md (+ nav entry): documents the IR vocabulary (MoveKind/Move/Program/ProgramMeta, logical axes, post-segmentation "one Move == one line"), its serialized form (the emitted G-code; ; Parameters header), and its versioning policy — versioned independently of the .wind schemaVersion, with explicitly weaker stability guarantees (the IR tracks engine internals).
  • irVersion: IR_VERSION = "1.0" constant in ir.py; ProgramMeta.ir_version field (default); emitted as the leading irVersion key in the ; Parameters header; round-tripped by read_program (absent → "1.0", tolerant).

Byte impact (deliberate, verified)

The header gains one field, so the 7 cylinder example goldens are regenerated — each differs by exactly one line (the header), with all motion bytes unchanged (reviewer confirmed numstat = 1 1 per file). The cone example stays equivalence-gated (no byte golden).

Verification

  • pytest 214 passed (incl. reader round-trip + golden byte-equality on the regenerated headers); ruff + mypy clean.
  • Adversarial review: no blockers — golden integrity confirmed (header-only), round-trip + absent-version tolerance verified, no other ; Parameters/ProgramMeta consumer affected (GUI/wire/sim/plot read the IR via read_program, not the raw header), doc matches ir.py.

Closes #316.

Document the Motion IR (docs/reference/motion-ir.md) as a secondary,
independently-versioned interchange format with explicitly weaker stability
guarantees than .wind (it tracks engine internals). Add IR_VERSION ("1.0") in
ir.py and an ir_version field on ProgramMeta, emit it as the leading irVersion
key in the serialized "; Parameters" header, and round-trip it in read_program
(absent reads as "1.0").

The header gains one field, so the cylinder example goldens are regenerated:
each changes by exactly one line; all motion (G0/G92) bytes are unchanged. The
cone example stays equivalence-gated (no byte golden).

Slice C of #141 (open-format epic). Closes #316.
@CameronBrooks11
CameronBrooks11 merged commit 65ac5b4 into main Jun 29, 2026
21 checks passed
@CameronBrooks11
CameronBrooks11 deleted the feat/openformat-c-ir-doc branch June 29, 2026 23:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Open-format C — Motion IR as a secondary versioned format (irVersion)

1 participant