Skip to content

Stage 2 — unify hoop/helical/skip as one declarative pattern primitive (cylinder) #137

Closed

Description

@CameronBrooks11

Epic. Make pattern definitions data, not imperative code. Express hoop/helical/skip as one declarative parametric primitive on the developed (unwrapped) cylinder surface that lowers to the Stage 1 Motion IR (#136). On a developable cylinder a constant-angle path is a straight line in the (z, θ) development, so the geometry stays closed-form — no ODE solver, no friction model (those are Stage 3b).

Why

Today the three patterns are three hand-written machine-axis move generators in planning/layer_strategies.py with near-zero shared path math: hoop (7 bespoke moves), helical (nested pattern→circuit→pass loops), skip (one move). Only the IR-recording layer (WinderMachine) and nominal_metrics are shared (Stage 1). The wind_angle name even means two different things — a true fiber angle in helical, but a delivery-head lean angle in hoop (layer_strategies.py:62).

Strategy (decided)

Developed-surface lowering now, not a byte-preserving front-end refactor. The unified primitive produces cleaner, different G-code, so byte-equality is retired as the gate and replaced by an equivalence harness:

  • coverage invariants — circuit count, full angular coverage, gcd(p, d)=1, circuit divisibility, lock-degrees slot math;
  • simulator parity — nominal_metrics time/material within tolerance vs pre-cutover output;
  • geometry — achieved fiber angle matches target alpha within tolerance.

The harness lands in S2 and gates every subsequent cut-over. Risk is proven on helical (hardest) first.

Slices

Done when

One declarative primitive + one lowering plans all three pattern types; the old per-pattern generators are deleted; the equivalence harness is the CI gate; validators type-check the primitive; the meridian-referenced alpha convention is normative; docs + roadmap Stage 2 marked done.

Depends on Stage 1 (#136). See docs/development/roadmap.md (Stage 2).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementepicpython

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions