cam_blend: seam_matches debug-assert panics on near-degenerate hosts from acute-corner ring offsets #98

Closed
opened 2026-07-23 19:34:00 +00:00 by patman-assist · 0 comments
Collaborator

Found while wiring blend visualization (PR #97) into the STEP wedge showcase scene (PR #96).

Repro: blend_pass on any ring pass of the filleted_wedge_plate scene (cam_viz::scene::build_scene("d") with a nonzero blend_corridor) panics at the seam_matches debug assertion (CAM/blend/src/junctions.rs:706).

Key observation: corridor-magnitude-independent — reproduces at 4 µm, 1 µm, and 1 nm, so it is not a tolerance-tuning issue.

Analysis: the wedge plate has an acute ~56° corner; plan_rings inward offsets drive that corner toward a near-medial-axis collapse. min_blend_chord anticipates near-degenerate hosts but the force_skip pre-filter does not account for post-halving trim shrinkage, so near-degenerate hosts slip into the Blend outcome of resolve_junction, where the seam invariant then fails.

Current workaround: scene d plans with blend_corridor = ZERO and cam_viz::scene::build_scene has a skip_blends guard (doc comment there cross-references this limitation). Note BlendParams::validate() also rejects max_deviation == 0, so zero-corridor cannot be expressed through blend_pass itself — worth deciding whether zero should mean "no blending" at the API level.

Suggested fix direction: extend force_skip to account for post-halving trim shrinkage, or degrade to a Host passthrough when the seam invariant cannot be met, rather than debug-asserting.

Found while wiring blend visualization (PR #97) into the STEP wedge showcase scene (PR #96). **Repro:** `blend_pass` on any ring pass of the `filleted_wedge_plate` scene (`cam_viz::scene::build_scene("d")` with a nonzero `blend_corridor`) panics at the `seam_matches` debug assertion (`CAM/blend/src/junctions.rs:706`). **Key observation:** corridor-magnitude-independent — reproduces at 4 µm, 1 µm, and 1 nm, so it is not a tolerance-tuning issue. **Analysis:** the wedge plate has an acute ~56° corner; `plan_rings` inward offsets drive that corner toward a near-medial-axis collapse. `min_blend_chord` anticipates near-degenerate hosts but the `force_skip` pre-filter does not account for post-halving trim shrinkage, so near-degenerate hosts slip into the `Blend` outcome of `resolve_junction`, where the seam invariant then fails. **Current workaround:** scene d plans with `blend_corridor = ZERO` and `cam_viz::scene::build_scene` has a `skip_blends` guard (doc comment there cross-references this limitation). Note `BlendParams::validate()` also rejects `max_deviation == 0`, so zero-corridor cannot be expressed through `blend_pass` itself — worth deciding whether zero should mean "no blending" at the API level. **Suggested fix direction:** extend `force_skip` to account for post-halving trim shrinkage, or degrade to a Host passthrough when the seam invariant cannot be met, rather than debug-asserting.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
patman/KGROO#98
No description provided.