Skip to content

AdaptivePocket tests: run the independent leading-contact check (#190, part 1) - #362

Merged
10-X-eng merged 7 commits into
stevecad:mainfrom
Wookie1:pocket-leading-oracle
Nov 21, 2026
Merged

10-X-eng merged 7 commits into
stevecad:mainfrom
Wookie1:pocket-leading-oracle

Conversation

@Wookie1

@Wookie1 Wookie1 commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

Part 1 of #190: the second acceptance point. The independent LeadingOracle engagement check from tests/roughing.rs now also runs on the AdaptivePocket (engagement_front) tests. Test-only. Part 2 (removing disk_front / stock_front) is a separate PR stacked on this one.

What changes

  • LeadingOracle and the methods it needs become pub(crate). The oracle now keeps each swept piece (line or arc) and clears exactly the points within the cutter radius of it. Before, it cleared stock within an inflated radius of sampled centres, so its reading depended on how the moves were split: a 0.1 mm slot read 179° as one move and 0° as 200 moves, and a short cut after a 1 mm lead read 0° or 179° depending on how the lead was split.
  • New helper leading_contact_deg in tests/adaptive.rs runs the oracle over a pocket's motions. Its only inputs are the stock footprint and the motions; it uses no planner, prover or stock code.
  • The check worst <= acos(1 - stepover / r) + LEADING_SLACK_DEG (3°, the roughing test's sampling slack, now a named constant) is added to the L pocket (two levels), both link-feed runs, the square and circular wall-pass pockets, and every ramp-entry run in tests/ramp_entry_front.rs.
  • Three tests check the oracle itself: a slot and side steps at w = 0.5, 1 and 1.5 mm read acos(1 − w/r); the same cuts read the same split into one move or 200; and a cut after a lead reads the same however the lead is split.

No existing assertion was changed or loosened. No source, Python, docs or benchmark change; bench/results/baseline.json and docs/benchmarks.md are untouched.

stevecad#190)

The sampled LeadingOracle from tests/roughing.rs (no planner, prover or
stock code) now also checks AdaptivePocket's engagement_front runs: the
L pocket, both link-feed runs, the square and circular wall-pass pockets,
and the three ramp-entry runs. Every cutting and stay-down link stroke's
leading contact must stay within acos(1 - stepover / r) plus the same
3 degree sampling slack the roughing test uses.

A new test checks the oracle itself: a slot through fresh stock reads the
full leading half-circle, and a pass beside a through-cut at 0.5, 1 and
1.5 mm reads acos(1 - w / r) to within its whole-degree count.

Test-only: LeadingOracle and its methods become pub(crate) so adaptive.rs
and ramp_entry_front.rs can use it; no existing assertion changes.
…acing (stevecad#190)

The allowance for slivers between sampled discs used the largest sample
step for every disc. A move shorter than that step then cleared its own
leading edge from its start: a 0.1 mm straight cut in fresh stock read 179
degrees as one move and 0 as 200 moves. Each disc now carries the allowance
of its own move's spacing. New test: the same slot and side step read the
same split into one move or 200.
The oracle cleared stock within an inflated radius of sampled centres, so
an unchecked lead could clear stock ahead of its own end: a 0.0005 mm cut
after a 1 mm lead read 0 degrees with the lead as one move and 179 with it
split in 2,000. It now keeps each swept piece (line or arc) and clears
exactly the points within the cutter radius of it, so the reading does not
depend on how moves are split or sampled. New test for the lead case.
@10-X-eng
10-X-eng enabled auto-merge November 21, 2026 14:20
@10-X-eng
10-X-eng added this pull request to the merge queue Nov 21, 2026
Merged via the queue into stevecad:main with commit 591fca2 Nov 21, 2026
9 checks passed
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.

2 participants