Skip to content

feat(parser): E10 phases 2+3 — arc planes + coordinate systems (probe-aware) (#157, #158) - #208

Merged
sobechestnut-dev merged 2 commits into
devfrom
feat/157-158-motion-arcs-wcs
Jul 26, 2026
Merged

feat(parser): E10 phases 2+3 — arc planes + coordinate systems (probe-aware) (#157, #158)#208
sobechestnut-dev merged 2 commits into
devfrom
feat/157-158-motion-arcs-wcs

Conversation

@sobechestnut-dev

Copy link
Copy Markdown

Closes #157 · Closes #158 · Epic #191 (E10) · DD-010 D3/D4. Completes E10's motion-model gaps from the #154 audit.

Phase 2 — arc planes G17/G18/G19 (#157, D3)

g2 is plane-parameterized: the in-plane pair uses the two relevant center offsets (I/J, I/K, or J/K) and the through axis ramps linearly. G17 reproduces the previous XY math exactly — the XY-arc corpus is byte-identical. G18/G19 arcs (previously mis-flattened onto XY, K ignored) now render in the correct plane; R-mode generalized to the active plane. Folds in the deferred G91-arc geometry. New capability arcPlanes.

Phase 3 — coordinate systems + probe-aware datum (#158, D4)

Honors work-coordinate systems and G92 X/Y/Z, keeping the IR in the logical/work frame so identity-WCS files stay byte-identical:

  • G54–G59 active work offset (G10 L2/L20); G53 one-shot machine-coord bypass.
  • G92 X/Y/Z — a datum shift when the position is known (G92 X0 at X50 → G1 X10 → X60).

Probe awareness — a D4 amendment (maintainer)

A bare G92-XYZ datum shift mis-rendered the mach3 plasma fixture, whose G92 Z0 follows an un-modeled G31 probe (it shifted Z up 0.2″ off the stale pre-probe height). So D4 now tracks per-axis position certainty:

  • G31 reaches its endpoint at runtime → the probed axis is runtime-dependent, disclosed via a new probe-position-runtime-dependent warning; never advanced to the un-reached commanded value.
  • A G92 after a probe is a logical resync — the current logical position is declared to be the given value, and a new frame starts at the datum so no fabricated move is drawn across the unknown probe result. G31 Z-11.8G92 Z0G00 Z0.039 now renders at logical 0.039 (not 0.239).

New capability coordinateSystem. DD-010 D4 + decision log amended accordingly.

Golden discipline (DD-010 D5)

  • Identity-WCS corpus byte-identical — verified per-fixture that the only golden change is the additive arcPlanes + coordinateSystem keys; no position/kind/tool/layer/srcByte digest moved.
  • demo-mach3 intentionally diverges from the inherited engine (which ignored G31 and G92 Z) — a documented semantic correction, pinned by its native golden and excluded from strict adapter-equivalence (it.skipIf).

Verified

131 parser tests pass (1 intentional skip); +13 motion-model tests (G18/G19/R-mode/G91 arcs; G53/G54–G59/G10; G92 datum shift; G31→G92 resync, partial-axis recovery, no-false-connecting-geometry). Root 292, typeCheck, lint, docs:links all green. Two changesets (phase 2, phase 3).

🤖 Generated with Claude Code

sobechestnut-dev and others added 2 commits July 26, 2026 14:51
Closes #157. DD-010 D3. Arc flattening (G2/G3) now runs in the active plane
(G17 XY default, G18 XZ, G19 YZ) instead of always assuming XY.

- g2 is plane-parameterized: the in-plane pair uses the two relevant center
  offsets (I/J, I/K, or J/K) and the through axis ramps linearly. G17 reproduces
  the previous XY math EXACTLY — the whole XY-arc corpus is byte-identical (the
  only golden change is the additive `arcPlanes` capability key).
- G18/G19 arcs (previously mis-flattened onto XY, K ignored) now render in the
  correct plane; R-mode chord solve generalized to the active plane's two axes.
- Folds in the deferred G91-arc geometry: arc endpoints honor G90/G91; I/J/K stay
  current-relative center offsets in both modes.
- New capability `arcPlanes` ('known' once a plane word seen, else 'inferred').
- Motion-coverage matrix updated; +5 motion-model tests (G18/G19/R-mode/G91 arc);
  native goldens regenerated (additive only).

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
)

Closes #158. DD-010 D4 (amended: probe awareness). Honors work-coordinate
systems and G92 X/Y/Z, keeping the IR in the logical/work frame so identity-WCS
files stay byte-identical.

- G54–G59 select an active work offset (G10 L2/L20); G53 is a one-shot
  machine-coordinate bypass for the next move.
- G92 X/Y/Z is a datum SHIFT when the position is known (continuity: G92 X0 at
  X50 then G1 X10 → X60).
- Probe awareness (D4 amendment): per-axis position certainty. G31 reaches its
  endpoint at runtime → the probed axis is marked uncertain and disclosed via a
  new `probe-position-runtime-dependent` warning (never advanced to the un-reached
  value). A G92 after a probe is a logical RESYNC — the current logical position
  is declared to be the given value and a new frame starts at the datum, so no
  fabricated move is drawn across the unknown probe. The mach3 fixture's post-probe
  path now renders in its authored logical range instead of a stale +0.2" shift.
- New capability `coordinateSystem`.

Golden discipline (DD-010 D5): identity-WCS corpus byte-identical (only the
additive `coordinateSystem` key changed). demo-mach3 intentionally diverges from
the inherited engine (which ignored G31 and G92 Z) — a documented semantic
correction, pinned by its native golden and excluded from strict adapter
equivalence. Motion-coverage matrix + DD-010 decision log updated; +8 tests.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@sobechestnut-dev
sobechestnut-dev enabled auto-merge (squash) July 26, 2026 23:56
@sobechestnut-dev
sobechestnut-dev merged commit dc1c535 into dev Jul 26, 2026
4 checks passed
sobechestnut-dev added a commit that referenced this pull request Jul 27, 2026
* docs: mark E10 complete + renderer color backlog + E8 DD in the epic table

E10 (motion-model) is done — #208 merged (arc planes #157 + coordinate systems
#158 with the probe-aware G92 amendment); #157/#158 closed. Color-by-speed #177
and color-by-object #178 shipped (#209). E8 has a proposed DD-014 (awaiting the D6
evidence-gate decision). Update the docs/README current-state table + heading.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

* docs: reference DD-014 as text (file lands with #210, not yet on dev)

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

---------

Co-authored-by: Nathaniel Chestnut <sobechestnut-dev@users.noreply.github.com>
Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
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.

fix(parser): honor G53/G54–G59 coordinate systems fix(parser): honor G17/G18/G19 arc-plane selection

1 participant