Skip to content

feat(ccx): L62 isolated tolerance tier — membership is d_min <= tol, closed, at every tol - #47

Merged
sth-v merged 6 commits into
tinyfrom
l62-ccx-tolerance-tier
Aug 19, 2026
Merged

feat(ccx): L62 isolated tolerance tier — membership is d_min <= tol, closed, at every tol#47
sth-v merged 6 commits into
tinyfrom
l62-ccx-tolerance-tier

Conversation

@sth-v

@sth-v sth-v commented Aug 19, 2026

Copy link
Copy Markdown
Member

L62: CCX tolerance tier for isolated intersections

Implements the owner contract (issue doc 2026-08-18): intersection existence is tolerance-determined — at any tol >= d_min a curve pair has exactly one isolated intersection there; at any tol < d_min it has none; topology correct at every tol. The 5d05ddc strict machinery is re-scoped, not reverted: it grades the certification tag ('exact' | 'tolerance', metadata only) and guards sub-atol topology, with no membership role.

Engine (_bez_ccx4.py)

  • Vector-residual hull demoted from cell prune to zero-free certificate (pruning on it was the near-miss loss site: a z-gap of tol/1e6 erased the intersection).
  • Terminal cells: strict polish unchanged; on failure, a basin-clamped Gauss-Newton minimizer polish + certified d_min measurement — the sharper of the sq-dist-net and direct-evaluation measurements (complementary envelopes: extent² vs world position).
  • Closed membership at measurement resolution; typed uncertified_contacts when the envelope covers tol at decision scale — never a guess.
  • Phase-1 lift: four-boundary endpoint-contact scan at level tol².
  • Component rules per owner decision: no band outcome — one contact at the certified argmin per connected sub-tol component (valley-following connectivity with arrival check), k exact roots for dip-throughs, overlap = the only domain-end-anchored long touch (L47 unchanged).
  • Descent cost: coarse terminal stops (wholly-in-band, Hessian-PD unique-minimizer) + anisotropic refinement for collapsed pieces. Measured: shallow rational ellipse×spline crossing 545k → 587 cells; the 11-curve 3D grid 46s → 2.4s.
  • tolerance_tier=False = exact-only legacy (used by the nested CSX boundary-zero call).

Adapter (_nccx4.py)

  • certification/d_min in the isolated dtype; span-seam dedup prefers exact then lower d_min; seam re-verification closed with an operand slack; typed cannot-decide recorded on status['uncertified_contacts'] without aborting the scan.

Verification

  • The two strict xfails fired and are unpinned: grid 25/25, dedup == 25, zero false positives.
  • 76-test tier suite: (gap,tol) law incl. closed equality, translation invariance both directions, endpoint/corner contacts, dip-through never-merge, tangent-graze argmin-only, 2D, typed tail — plus 15 adversarial-review regression pins (35-agent review, 5 lenses × 2-skeptic verification; 15/15 findings sustained, reproduced, fixed).
  • Parallel-planes accept-path pins re-scoped per owner decision (membership tracks realized gap both directions; resolvable gaps never certify 'exact').
  • Full suite -m "not slow": 841 passed, 0 failed, 1 xfailed; check_imports / check_layering clean.

🤖 Generated with Claude Code

sth-v and others added 6 commits August 19, 2026 01:05
…closed, at every tol

The owner contract (2026-08-18): tol is the acceptance distance, the
standard CAD semantics; topology correct at every tol. The 5d05ddc strict
machinery is re-scoped, not reverted — it grades the certification tag and
guards sub-atol topology, with NO membership role.

Engine (_bez_ccx4.py):
- vector-residual hull demoted from cell prune to zero-free certificate
  (it excludes exact zeros, not tolerance members — pruning on it was the
  near-miss loss site: a z-gap of tol/1e6 erased the intersection)
- terminal cells: strict polish unchanged; on failure a Gauss-Newton
  minimizer polish + net-certified d_min measurement (two-term operand
  envelope; source term prices rational world-scale products only —
  polynomial D-construction is translation-invariant by Sterbenz)
- closed membership at measurement resolution; typed uncertified_contacts
  when the envelope covers tol at decision scale (|coords| >~ atol/eps
  tail) — never a guess
- Phase-1 lift: four-boundary endpoint-contact scan at level tol²
- pool drain with component rules: argmin per connected sub-tol region
  (owner: no band outcome exists), connectivity suppression against exact
  roots and overlap spans — the tiers cannot double-count
- envelope-slacked min-of-net/Lipschitz bars keep gap == tol alive
- descent cost: coarse terminal stops for zero-free cells (wholly-in-band;
  Hessian-PD unique-minimizer via _check_uniqueness_2d) + anisotropic
  refinement for collapsed pieces (half the dedup radius). Measured: the
  shallow rational ellipse-spline crossing 545k -> 587 cells; the 11-curve
  3D grid 46s -> 2.4s
- tolerance_tier=False restores exact-only for engine callers (CSX nested
  boundary-zero call — its own tier is a separate ledger item)

Adapter (_nccx4.py): certification/d_min in the isolated dtype, span-seam
dedup prefers exact then lower d_min, seam verification closed (> tol).

Tests: the two strict xfails now FIRE and are unpinned (grid 25/25, dedup
== 25); parallel-planes accept-path pins re-scoped per owner decision
(membership tracks realized gap both directions at every world position;
resolvable gaps never certify 'exact'); new tests/test_ccx4_tolerance_tier.py
((gap,tol) law incl. closed equality, translation invariance both
directions, endpoint/corner contacts, dip-through never-merge, tangent
graze argmin-only, 2D, typed cannot-decide tail).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…s, pin re-scope, CSX opt-out) + measured implementation notes

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…before verdict typing

An unresolvable measurement of an already-resolved component is not a
typed outcome: a candidate inside the dedup ball of an accepted exact
root (or on a certified overlap span) is suppressed regardless of its
membership verdict. Measured: at tol=1e-6 the sq-dist net's sqrt roundoff
floor exceeds atol at ordinary model scale, and the exact seam touch of a
boolean2d ray cast flagged its own root's neighborhood as
uncertified_contacts, marking the ray topology incomplete — the four
boolean2d regressions in the full suite. Connectivity suppression (a
member-verdict predicate) still runs for decided members only.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… basin-clamped minimizer, structural jurisdiction, adapter typed-continuation

15/15 review findings sustained by 2-skeptic verification, all reproduced;
this batch closes every engine/adapter defect:

- MEASUREMENT (critical): the global net envelope scales with the pair's
  extent squared and reached an ACCEPT path (d_hat <= atol + eps_d), so
  |ctrl| ~ 3e3 with atol=1e-3 accepted gaps up to 1.68*atol certified-
  complete, armed the cannot-decide tail ~6 orders early, and widened the
  connectivity walk over super-tol ridges (silent merge of distinct
  contacts). Fixed by _measure_direct_distance (de Casteljau + subtract +
  norm; envelope ~ eps*|coords|, weight-conditioned) combined with the net
  measurement — the smaller certified envelope governs at every scale.
- BASIN DISCIPLINE: the tolerance minimizer is clamped to its cell —
  unclamped Gauss-Newton jumped super-atol ridges into deeper basins and
  the abandoned basin's contact vanished (triple-dip fixture).
- JURISDICTION: the tier no longer stands down call-wide on overlap-class
  or band evidence (that silently deleted members with topology claimed
  complete); suppression is structural — certified overlap spans, and
  band-anchor CONNECTIVITY armed only when the L47 certificate holds
  crossing evidence, which is exactly the never-merge boundary.
- COMPONENT RULES: connectivity now follows the pairing (per-sample
  inversion with arrival check) instead of the straight (u,v) chord (a
  curved component shipped as several contacts; grid-verified fixture now
  reports exactly one contact per component at the argmin); the 3D-point
  radius shortcut is removed (it merged disconnected components whose
  witnesses fell within atol in space).
- ENDPOINT BAR: the pre-filter gets the envelope slack every other
  level-atol bar has (gap == atol contact survived 300/300 rotations,
  was 166/300).
- ADAPTER: a per-candidate typed cannot-decide no longer aborts the whole
  scan — payload lands on status['uncertified_contacts'] with global
  params and curve indices, aggregate marked incomplete, scan continues
  (fail-fast opt-in still raises, naming the typed cause); the NURBS-level
  seam re-verification carries an operand slack so it cannot reverse the
  engine's closed-boundary decisions.

New pins in tests/test_ccx4_tolerance_tier.py cover every fixture above.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…combined measurement, basin clamp, structural jurisdiction, adapter typed-continuation

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…embership; certification/d_min in isolated results)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@sth-v
sth-v merged commit 76735f9 into tiny Aug 19, 2026
7 of 14 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.

1 participant