Skip to content

feat(planning): cone helical layer validation + coverage checks - #312

Merged
CameronBrooks11 merged 1 commit into
mainfrom
feat/cone-s3a-validation
Jun 29, 2026
Merged

CameronBrooks11 merged 1 commit into
mainfrom
feat/cone-s3a-validation

Conversation

@CameronBrooks11

Copy link
Copy Markdown
Member

Summary

Stage 3a S3a (#308) of epic #138 — hardens the cone winding model: cone layer validation + coverage-distribution checks. No .wind/dispatch wiring (S3b, #311); cones reach the new validator only via direct construction in tests.

What's here

  • validators.py
    • validate_cone_helical_layer — a type-checker over the primitive: raises LayerValidationError for a non-reducing frustum (r1 >= r0), an unreachable geodesic angle (Clairaut C > r1), then the shared coverage conditions over the large-end circuit count.
    • Extracted _validate_coverage (skip/pattern coprimality, lead-in bound, circuit divisibility, lockDegrees slot math) — verbatim from validate_helical_layer, reused by both cylinder and cone. Cylinder behavior + error messages unchanged.
  • _equivalence.py — assert_cone_coverage now also asserts pattern distribution (coprimality + divisibility); new assert_cone_circuit_count independently verifies the lowered program lays 2 * num_circuits passes (catches builder under-tiling, not just a proxy).
  • developed.py — comment-only: the turnaround dwell is the cylinder formula, kept deliberately (see below). No code change.

Turnaround decision (resolved with maintainer)

The backward mandrel dwell flagged in S2 review is not a cone defect — it's the existing turnaround/lock alignment mechanism, which already goes negative on high-wrap cylinder layers in the hardware-validated goldens. Decision: cones match the cylinder formula exactly. Strict mandrel monotonicity is therefore not a requirement; the in-code comment is corrected to document this.

Verification

  • pytest 213 passed (11 cone tests inc. the new circuit-count check, + cone validator tests); cylinder goldens byte-identical; ruff + mypy clean.
  • Adversarial review: no blockers — refactor confirmed byte-identical to HEAD, cone validator at-least-as-strict as the kinematics guards.

Scope (deliberate)

No .wind schema change, no planner/dispatch wiring (S3b). length > 0 validation deferred to the S3b schema boundary (.wind uses PositiveFloat). Expanding cones + hoop-on-cone out of scope.

Closes #308.

Add validate_cone_helical_layer as a type-checker over the primitive: raises
LayerValidationError for a non-reducing frustum (r1 >= r0), an unreachable
geodesic angle (Clairaut C > r1), and the shared coverage conditions. Extract
those surface-independent coverage checks (skip/pattern coprimality, lead-in
bound, circuit divisibility, lockDegrees slot math) into _validate_coverage,
reused by both the cylinder and cone validators -- verbatim extraction, cylinder
behavior and error messages unchanged.

Harness: assert_cone_coverage now also asserts pattern distribution (coprimality
+ circuit divisibility); add assert_cone_circuit_count, an independent check that
the lowered program lays 2 * num_circuits passes.

Turnaround decision: cones keep the identical turnaround/lock formula as
cylinders. The backward alignment dwell is the existing hardware-validated
mechanism (it already goes negative on high-wrap cylinder layers), so strict
mandrel monotonicity is not a requirement; only the in-code comment is corrected.

No schema/dispatch wiring (S3b). Cylinder goldens byte-identical.

S3a of #138 (Stage 3a cones). Refs #308.
@CameronBrooks11
CameronBrooks11 merged commit e289577 into main Jun 29, 2026
21 checks passed
@CameronBrooks11
CameronBrooks11 deleted the feat/cone-s3a-validation branch June 29, 2026 20:59
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.

Stage 3a S3a — cone validation + coverage correctness (turnaround matches cylinder)

1 participant