Repository navigation
feat(planning): cone helical layer validation + coverage checks - #312
Merged
Merged
Conversation
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.
4 of 5 tasks
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.pyvalidate_cone_helical_layer— a type-checker over the primitive: raisesLayerValidationErrorfor a non-reducing frustum (r1 >= r0), an unreachable geodesic angle (ClairautC > r1), then the shared coverage conditions over the large-end circuit count._validate_coverage(skip/pattern coprimality, lead-in bound, circuit divisibility, lockDegrees slot math) — verbatim fromvalidate_helical_layer, reused by both cylinder and cone. Cylinder behavior + error messages unchanged._equivalence.py—assert_cone_coveragenow also asserts pattern distribution (coprimality + divisibility); newassert_cone_circuit_countindependently verifies the lowered program lays2 * num_circuitspasses (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
pytest213 passed (11 cone tests inc. the new circuit-count check, + cone validator tests); cylinder goldens byte-identical;ruff+mypyclean.Scope (deliberate)
No
.windschema change, no planner/dispatch wiring (S3b).length > 0validation deferred to the S3b schema boundary (.windusesPositiveFloat). Expanding cones + hoop-on-cone out of scope.Closes #308.