Skip to content

SSX v5 hardening: theorem-first overlap certification, unified budgets/status, singular-case completeness (L41–L61)#45

Open
sth-v wants to merge 55 commits into
tinyfrom
ssx5-singular-hardening
Open

SSX v5 hardening: theorem-first overlap certification, unified budgets/status, singular-case completeness (L41–L61)#45
sth-v wants to merge 55 commits into
tinyfrom
ssx5-singular-hardening

Conversation

@sth-v

@sth-v sth-v commented Jul 14, 2026

Copy link
Copy Markdown
Member

Summary

55 commits hardening the bez_ssx/bez_csx/bez_ccx v4/v5 intersection stack. Work-item source of truth: docs/superpowers/issues/2026-07-07-ssx5-singular-review-ledger.md (L41–L61, all closed or explicitly dispositioned). Methodology of record: docs/superpowers/specs/2026-07-12-theorem-first-overlap-methodology.md.

  • Theorem-first overlap certification (L47/L57/L59/L60, user decision): coincidence of Bézier arcs is all-or-nothing, so spans are certified by domain-pinned ends + interior witnesses + a crossing flip guard, and the theorem carries the interior. CCX and CSX overlaps carry certification: 'exact' | 'tolerance'; certified spans bypass the subdivision grind. Replaces both prior regimes: tiny's permissive valley rule (fast but provably unsound — merges sub-tolerance-distinct sets) and the 5d05ddc exact-affine-only gate (sound but lost real overlaps into budget grinds).
  • Schema v2 + one budget module (L41, L52): results expose complete + status.reasons/status.work with complete == (not reasons) by construction; all 8 hand-rolled budget accountings merged into mmcore/numeric/_work_budget.py (documented charge-semantics registry); adapters always return status (3-tuple) with candidate-scaled default allowances.
  • Singular-case completeness (L25, L28, L43–L46, L49, L51, L53, slice 9): edge-graze arcs march past grazes; 2-D coincidence regions ship as SSXOverlapRegion; typed unresolved_regions complement (partial always names what is unresolved); Σ-truncations report the new structural unresolved_singular_set instead of misbilled work_budget.
  • Real-data validation: the six user overlap scripts are tracked; the worst case went from 57 s / 0 overlaps (lost geometry) to 4.2 s / 1 overlap with the span agreeing with tiny to sub-ptol — from a sound certificate. The bilinear L-junction family (non-affine planar quads) ships both full branches linked to the tangent point, preserved verbatim incl. knot vectors in examples/ssx/bilinear_l_junction_user_cases.py.
  • Gates: 4 exit-coded commands (coverage harness with per-case work-drift ≤ 2× checked-in baselines, budget-contract/determinism gate, 113→115 singular tests, 142→162 unit batch incl. re-pinned exactness contracts). The drift gate caught two real regressions on the day it was built.

Breaking / behavioral changes

  • nurbs_ccx/nurbs_csx (v4) return 3-tuples (isolated, overlaps, status) always; unknown kwargs raise TypeError; nurbs_csx's tolerance parameter is tol= (was atol=).
  • Overlap semantics: sub-tolerance-separated sets report as certification='tolerance' overlaps (never 'exact'); exactness contracts re-pinned accordingly (L56/L59).
  • New result fields: overlap_regions, unresolved_regions, status.reasons vocabulary incl. unresolved_singular_set, depth_limit, trace_unverified.

Test plan

  • examples/ssx/bez_ssx5_coverage_check.py — 8 cases, 100% coverage, zero spurious singularities, work ≤ 2× baselines (exit 0)
  • examples/ssx/bez_ssx5_budget_contract.py — schema v2 + determinism, 2 runs/case (exit 0)
  • pytest tests/test_bez_ssx5_singular.py — 115 passed
  • unit batch (csx/ccx/common/param-tol/exactness/budget/kwargs/overlap-tier) — 162 passed
  • examples/ssx/bilinear_l_junction_user_cases.py — all three user cases, full branches (exit 0)
  • user overlap scripts examples/csx/overlap_nurbs_intersection*_new.py — all six run clean (0.1–4.2 s)

🤖 Generated with Claude Code

sth-v and others added 30 commits July 10, 2026 16:32
…edger L41–L54

Independent review of 5d05ddc (budget concept, adapters, exactness kits):
verdict, measured probes (gates green at HEAD; 49-run exhaustion fuzz: 0 crashes,
0 contract violations, deterministic), engine survey, 15 verified findings.

User decisions 2026-07-12: overlap contract Option C APPROVED; schema v2
(complete/status.reasons/status.work) + adapter always-return-status APPROVED;
findings registered as ledger L41–L54 (curated mapping: L41 tracking, L42–L46 P0
fixes, L47/L53 decide-first, L48 tests, L49–L51 fixture-first, L52 batch, L54 audit).

Kickoff §2 re-sequenced: L41 → L42 (L28 prerequisite) → L28 → L43–L46 → L25;
session-start prompt embedded in the kickoff header.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…apter always-return-status

bez_ssx result: budget_exhausted/budget_usage replaced by complete +
status.reasons/status.work; mark_incomplete(reason) is now required, so
complete == (not reasons) holds by construction. Reasons classified from
instrumented firings on cases 12/13/14 + strip/shared-edge fixtures:
work_budget/output_cap/postprocess_cap/depth_limit (work family) and
parameter_fiber/overlap_region_unsupported/unresolved_tangential_zone/
unresolved_multiplicity/trace_unverified (structural); ambiguous
Delta-roots split by _overlap_region_boxes membership so case 12 names
its real cause (was: budget_exhausted=True at 1.9% usage). Measured:
case 12 ['work_budget','overlap_region_unsupported'], case 13
['depth_limit'], case 14 ['work_budget','parameter_fiber',
'unresolved_tangential_zone','unresolved_multiplicity']; L27 shared-edge
stays complete=True.

Adapters: _nccx4/_ncsx4 return_status default flipped to True (3-tuple
with status; return_status=False = explicit fail-fast opt-in). Default
aggregate max_cells now scales with the BVH candidate count — finding
2's second half: TestNurbsCCXMultiple2D crashed at 5d05ddc via the raise
default, then returned 2/11 intersections under a bare flip; now 11/11.
Live v4 callers migrated (boolean2d x2, public ccx(): 3-unpack +
RuntimeWarning on incomplete); boundary_intersection.py/implicitize.py
verified to import the OLD _ncsx adapter — finding-3 caller-graph
correction recorded in the ledger. Untracked examples/csx/*_new.py WIP
scripts still 2-unpack and need ", _status" when next touched.

Zero csx_max_cells/boundary_csx_max_cells/csx_max_results are honored:
refuse without invoking bez_csx (finding 11). Dead knobs removed:
solve_zero_dim stop_when/stop_requested, max_boxes (fixed 16*max_cells
backstop).

Gates: coverage 7x100% exit 0 at baseline timings; singular suite green
(95, incl. 7 new schema tests); unit batch + ssx6 contract + c1_regular
+ boolean2d + exactness contracts 153 passed; nccx4/ncsx4 17 passed
(3 pre-existing geom.curves import errors untouched). Ledger L41 FIXED.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…tial)

A valley-confirmed overlap pair whose exact-affine certificate fails
(curved-UV preimage) no longer floods Phase 2 as ptol-lattice isolated
roots reported COMPLETE. Port of the CCX non-affine fallback: Phase 2
runs under a separate bounded allowance (4,000 cells), and the outcome
is tested for the continuum chain signature (>12 in-span roots at
<=4*ptol_t spacing — catches short exact overlaps that complete under
the cap); fallback exhaustion or the chain sets budget_exhausted AND
boundary_topology_complete=False. No span exclusion, no tolerance
merging — sub-atol valleys keep their real topology and benign
near-tangent valleys stay complete.

Measured on the ledger repro (parabola on bilinear z=0 patch):
1,679 isolated @33,685 cells flagged complete -> 214 isolated
@4,006 cells flagged partial + topology-incomplete; affine control
still certifies overlaps:1 complete. Fallback-path reachability across
all 7 coverage cases (SSX + 1,400 reference slices) measured ZERO
(2 valley confirmations, both failing endpoint polish before the
certificate); case 12 unchanged (4,702 cells, same reasons/rims).

Gates: coverage 7x100% exit 0 at unchanged timings; singular suite 95
passed; csx4 32 passed (incl. new repro test); ccx4/ccx3/common/
overlap/ncsx4/exactness/ssx6-contract 61 passed. Ledger L42 FIXED;
L28 note recorded (curved rims still ship no claim — region assembler
sources rims from its own sampling per review doc §8).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
New _ssx5_overlap.py ships SSXOverlapRegion per review doc §8: rim loops
referencing kind='overlap' branches head-to-tail, sample-synchronized
closed uv loops on both surfaces, normal_agreement, a certified interior
witness (>=4*ptol/axis from every rim in BOTH parameter planes, residual
<= atol — the band rule; anything thinner stays curve-only), and a
certification dict in atol units. result['overlap_regions'] is additive
and always present.

Rim discovery is self-contained: all 8 domain edges sampled and
point-inverted onto the opposite surface, certifying every sample at
atol — covering affine rims (CSX claims) and the curved-UV rims the
exact-affine certificate correctly drops (resolves the L42 note).
Tolerance-band corner stubs (resid ~atol vs <=2e-14 on genuine rims) are
peeled by iterative degree-1 trimming before loop walking; multiple
outer loops become separate regions with containment-assigned holes.
Region rims replace their L27 2-point chords (the §8 sampling upgrade).

Reason retirement: bez_csx exports the typed L42 outcome
(uncertified_overlap_span + non_span_truncation); _run_csx types
span-only truncations as overlap_region_unsupported and sinks spans;
structural multiplicity marks record their root sites; both reasons are
retired only when every overlap box, sunk span, and recorded site is
covered by a certified region and the ledger never ran dry.

Measured: case 12 -> 1 region, 1 loop of 4 rims (2 shared-edge + 2
interior curved), complete=True reasons=[]; full containment and
identical patches -> 1 region complete; L27 skew fixture -> 0 regions,
output unchanged (negative control); u-flipped S2 -> normal_agreement
-1; strip fixture resolved (L41's pinned reason retired as §6
predicted). Rational twin: certified region, structural reasons
retired, honest work_budget remains (rational-CSX gap registered as
L55). §8's "region + separate transversal branch" sub-case documented
UNREALIZABLE for exact polynomial pairs (AS-BUILT note in ledger).

Gates: coverage 7x100% exit 0; singular suite 101 passed (6 new region
tests + 1 L41 test updated to the retired-reason contract); unit batch
+ adapters + contracts + boolean2d 171 passed (3 pre-existing
geom.curves errors untouched). Ledger L28 FIXED; L55 registered.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
L43: C3 broadphase AABB pair tests priced per-128 (the precompute
convention) instead of 1:1 with subdivision cells — case 6's c3 charge
drops 18,731 -> 348 (total 56,552 -> 38,169; the recovered headroom is
exactly the mispriced numpy); Newton/exact work keeps 1:1. Test: two
far-apart 420-vertex branches (~350k raw pairs) no longer exhaust the
250k default on zero candidates.

L44: the final point-dedup site charged the pre-rewrite O(n^2) cost for
the O(n*108) bucketed algorithm — at the 1024 output cap the 1,048,576-
unit quote was denied and dense output shipped UN-deduplicated with a
spurious partial flag. New _point_dedup_charge prices the actual probe
count; at the cap the charge is <= 1024 units and dedup runs.

L45: NaN chain closed — the boundary polish gate and the tracer's
strict-path vertex check were written reject-if-greater, so a NaN
residual (all NaN comparisons are False) was ACCEPTED as certified;
both now accept-if with finiteness guards. The binned dedup keeps
non-finite points unbinned and unique instead of crashing in math.floor
(the legacy NaN-safe contract), so one w->0 rational eval can no longer
discard a completed run.

Gates: coverage 7x100% exit 0; singular suite 105 passed (4 new tests);
csx4/ccx4/ccx3/common/overlap/c1_regular 89 passed. Ledger L43/L44/L45
FIXED.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
nurbs_curve_closest_points / nurbs_surface_closest_points gained
keyword-only max_cells=/stats= : one shared allowance across all Bezier
pieces (default: per-piece 20k scaled by piece count; explicit values
absolute), spend-through per piece, aggregate cells_processed /
budget_exhausted published — a capped sub-solve returning far-local-min
entities is now detectable instead of silently merging into the
"certified globally-closest" set (the band-semantics promise).

Interior starvation: the best-first interior heap keeps its own pop
allowance instead of sharing one total with the 4 boundary searches — a
boundary phase that burned the whole allowance used to leave the
interior ZERO pops, shipping a far boundary corner as the closest set
while the true interior minimum (0.5 vs 1.6 in the demonstrator) was
silently absent. Boundary exhaustion still marks the result capped;
counters report the honest total (<= 2*max_cells); the L37-era
shared-budget pin is updated to the new contract; trace-phase
accounting intentionally unchanged.

Tests: closest-point suite 50 passed (2 new: aggregator signal
propagation, interior-not-starved demonstrator). Ledger L46 FIXED.

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

End-of-queue adversarial review (19 opus agents, 5 lenses x 2 refuters)
over 6f362b9..1257fdb: 7 raw findings, 1 CONFIRMED — the L28 evidence-
coverage check tested only a box's S1 (s,t) center against uv1_loops,
so a box on a DIFFERENT S2 sheet sharing an S1 footprint (folded /
self-overlapping S2) was falsely marked explained and could wrongly
retire overlap_region_unsupported. Coverage now requires BOTH parameter
planes (same two-sided rule as _site_in_regions); pinned by
test_overlap_box_coverage_requires_both_parameter_planes. The 6 refuted
findings are recorded in the ledger as L54 audit leads.

Also: kickoff §2 rewritten to the shipped state (L41/L42/L28/L43-L46
done, commits ae6a4c6..1257fdb; next: L25, L47-L55, review doc §11
steps 4-6).

Gates: region/schema tests 13 passed; coverage 7x100% exit 0.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The embedded session-start prompt now targets the remaining work
(L25 fixture-first, L47/L53 decide-first, L48-L55) and records that
L41/L42/L28/L43-L46 shipped at ae6a4c6..e090f27 with schema v2 in
place.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… past edge-grazes

An SSI arc hugging a domain face (closest approach d0 > 0, transversal in
3D everywhere) was lost by _march_to_boundary in two clearance-dependent
modes, both re-pinned fixture-first (examples/ssx/bez_ssx5_case15.py):
- d0 <~ atol·sin: the fixed-face Newton stalls at the closest-approach
  WITNESS (fres = d0 exactly — the face carries no Psi zero) and the
  atol-scale acceptance committed it as an exit vertex; the strict path
  certificate then rejected every fragment -> 0 branches,
  reasons=['trace_unverified'] (total arc loss at d0=1e-5/1e-4).
- d0 >~ atol·sin: the refused exit break'ed the march unconditionally ->
  both seeds truncated one chord short of the graze -> 2 branches with a
  silent ~0.14 t-gap (worst 97·atol), falsely complete (d0=1e-3).

Root cause: the marcher's exit-commit bar (atol-scale) was inconsistent
with the tracer's path certificate (roundoff-scale), and a refused exit
aborted the march instead of recognizing the curve does not exit there.

Fix at the marcher (single site): commit an exit ONLY on a certified
on-face root (fres <= _strict_ssx_root_tol — the same bar the tracer
applies to every path vertex); otherwise retarget the predictor at the
interior halfway point (the existing deviating-exit-chord machinery) and
keep marching — a graze is walked past (the tangent's face component
flips sign at closest approach), a stalled genuine exit is re-tried from
geometrically closer inits until Newton certifies. Bounded by the
existing rejects(25)/h-floor/interior-progress guards.

Measured: 20-variant sweep (t* lattice+off-lattice, sharpness 0.01..16,
d0 in {0, ±1e-5, ±1e-4, ±1e-3}) all clean — every inside-graze now one
transversal branch at 100% analytic coverage (4001/4001). Case 15
registered in harness ALL_CASES (106/106, exit 0).

Tests: test_edge_graze_transversal_arc_survives[inside-1e-5|inside-1e-4|
inside-atol|exact|outside]. Gates: harness 8 cases exit 0 at <=1.01x
pre-fix timings, singular suite 111 passed, unit batch 75 passed.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…act); L55 resolved

USER DECISION 2026-07-12: overlaps carry certification 'exact' | 'tolerance'.
The exact-affine Bernstein identity path is unchanged; a new residual tier
certifies coincidence at modeling tolerance — the semantics CSX claims (L27)
and SSX regions (L28) already use:

- endpoint pre-gate: the four domain-end inversions (coarse scan + damped
  1-D Gauss-Newton, sound AABB pre-filter) must pin an admissible span at
  <= atol on both ends;
- 65 dense samples across the span: every C1 point inverts onto C2 at
  residual <= atol with a monotone pairing;
- sub-tolerance-topology guard (CSX invariant, 1-D form): a transverse-
  direction flip between consecutive gap-scale samples = crossing structure
  -> promotion refused, brackets handed to strict root polishing. (An
  interior-dip heuristic was built and REMOVED as unsound: a y-offset curve
  is locally tangent to its twin wherever the tangent is parallel to the
  offset — residual dips to (offset)^2·kappa with no root there.)

Reason-correct status: the bounded 2k fallback arms on classifier OVERLAP
or on BAND evidence (inward 2%/5% probes stay <= atol — a corner CONTACT,
e.g. consecutive boolean2d loop edges sharing a vertex, keeps full budget);
unpromoted + exhausted exports the typed L42-mirror outcome
uncertified_overlap_span + boundary_topology_complete=False instead of a
bare budget flag.

Measured: 1e-9-offset twins (both orientations) -> 1 'tolerance' overlap
(0,1), complete; non-affine exact reparam q(s)=(s^2+s)/2 -> 'tolerance',
residual_max <= 1e-9; +-1.2e-4 interior double-crossing inside an atol band
-> 0 overlaps + both transversal roots via bracket polish (invariant held);
woven ~3e-9 twins -> typed span (0, 0.8276) at 2,004 cells (honest partial,
was misbilled bare budget); NURBS adapter end-to-end: overlap (0,1)/(0,1)
complete at 8 cells — boolean2d's shared-edge 'AB' merge restored.

CSX nests CCX (boundary isocurves): the rational case-12 twin IMPROVED —
its coincident rational boundary faces promote instead of burning the 20k
tier / flooding the result cap, so work_budget retired: complete=True,
reasons=[], 1 certified region at 15.3k cells (ledger L55 -> RESOLVED;
rational-twin test pin updated to reasons == []).

Tests: 7 new in tests/test_bez_ccx4.py. Gates: ccx4 18 passed; unit batch +
nccx4 + ncsx4 + boolean2d green (3 documented pre-existing geom.curves
import errors); singular suite 111 passed; harness 8 cases exit 0 at
unchanged per-case timings.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…y consumers

Re-measurement corrected the review's reading: the new conservative bound
(all non-uniform-weight rational inputs) is translation-INVARIANT — the
radius-1 rational quarter-circle gives ptol 2.7346e-4 at the origin AND at
(1000, 2000). The review's 7.6e-7 was the OLD optimistic dispatch at the
translated position, spuriously shrunk ~350x by homogeneous-derivative
magnitudes scaling with world coordinates. The shift therefore restored
sane large-coordinate acceptance/dedup radii; nothing pinned it.

New tests/test_nurbs_param_tol_regression.py (5 tests, 0.5 s): dispatch +
value + translation-invariance pins for curve and surface bounds, plus the
two previously zero-coverage legacy consumers at origin AND far:
_bez_csx3.bez_csx (nurbs_ssx path tol adapters) — same single root, same t;
closest_point.bez_curve_closest_point (Bez-tree ptol) — same t*=0.5.
Both consumers measured translation-stable; consumer-scoped tolerance
policy unnecessary on this evidence.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…d silently

Fixture-first (exact interior pinch: middle control row R1 = 2P - (R0+R2)/2
collapses the s=0.5 isoline to the point P, S_t == 0 along it, P on the
plane): 12+ nested cut-face CSX calls return parameter_fibers with zero
isolated roots and budget_exhausted=False — dropped without a trace by the
multi-cut consumer loops, while the boundary path marks the SAME structure
(REASON_PARAMETER_FIBER).

Branch loss did NOT reproduce (3 variants incl. two-lines-through-pinch X:
residual SSI seeds from domain-boundary crossings, traces through P, and
the c1/c3 machinery types cusp_curve + the self-intersections). Measured
defects fixed/filed instead: the silent fiber drop (fixed here — new
_surface_cut_face_fibers mirrors the boundary policy at both live loops,
isolated flow unchanged; no interior-fiber canonicalization without a loss
repro) and a PERMANENT work_budget misbilling (reasons stay ['work_budget']
at max_cells=1e6 with 5,693 cells spent — the bounded c1-enumeration tier
on the positive-dimensional Sigma line; that is §11.6's de-budget/C1-tier
audit, tracked with L52). Caller-graph correction: the third "consumer
site" (_csx_on_cut_face via _midpoint_split) is dead code — untouched,
left for L52.

Test: test_interior_pinch_cut_face_fibers_are_surfaced (fiber reason named
+ cusp_curve typed + both analytic lines fully covered). Gates: singular
suite 112 passed, harness 8 cases exit 0 at unchanged timings.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…k charter

USER DECISION 2026-07-12: repair + document. The interior cut-face path
wrote list((lambda x: ..., seq)) — a 2-element list, not a filter call —
so the first interior cut of any run raised TypeError inside
_isoline_csx_to_global (only the boundary path was test-covered). The
repaired line is the same t-endpoint filter as the maintained v5 engine,
pinned by test_ssx6_interior_cut_face_filter_is_a_filter (RED reproduced
the exact TypeError).

The module docstring now opens with a STALE PRE-BUDGET FORK charter:
superseded by _bez_ssx5.py — no budgets / no-hang guarantee, no schema v2,
no typed singularities, none of the L-series fixes; contract guard
hard-raises on incomplete nested CSX; historical comparison only, do not
extend, future review cycles skip it beyond importability.

Import isolation verified (nothing in mmcore/ imports it). Gates: ssx6
contract suite 4 passed; singular suite 112 passed; live engine untouched.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…0 investigation

The boundary-phase exhaustion branch discarded ALL boundary-zero candidates
(csx_boundary_zeros = []) although each is individually polished through
the strict per-root certificate below — {isolated: [], budget_exhausted}
shipped with certified roots in hand and ~no Phase-2 budget to re-find
them. Now: candidates are KEPT (per-root soundness does not depend on set
completeness; CCX keeps its validated hits in the same situation), while
the valley/overlap CLASSIFICATION is explicitly gated on a complete
boundary set (pairing endpoints out of a truncated set could fabricate a
false overlap claim — the sound half of the old discard, enforced at the
right altitude). Malformed payloads still discard.

Fixture-first note: a naive starved fixture (line x plane) PASSED pre-fix —
Phase 2 re-found the trivial root in one cell; the pinned fixture prices
the re-find with a 6e-4 sub-atol valley (must be resolved, never merged),
so one remaining cell provably cannot conclude.
Test: test_boundary_exhaustion_keeps_certified_roots.

Ledger also records the L50 fixture-first investigation (mechanism
confirmed by reading; loss mode unreachable across three two-tangency
fixtures; fix direction documented — do not fix without a reaching
fixture).

Gates: csx4 suite 33 passed; singular suite 112 passed; harness 8 cases
exit 0 at unchanged timings.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… L54-verify/L52/L50

Section 2 records the completed L25/L47/L48/L49/L51/L53 queue (+L55
resolved via L47, L50 investigated-open with fix direction); the
session-start prompt now points at verifying the launched L54 line-scan
agents' findings, the L52 consolidation batch (+ the c1-tier misbilling
L49 surfaced), and L50-only-with-a-reaching-fixture. Gate list updated
(8 harness cases incl. case 15; 112 singular tests; param-tol pins in the
unit batch).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…t hardening

Both L54 line-scan angles ran (Opus agents over 6f362b9..HEAD) and every
finding was verified in-session before acting.

A2 CONFIRMED: the L47 flip test skipped any pair touching a root-like
sample, so a transversal crossing landing exactly ON one of the 65 sample
nodes (dyadic-64 fractions — 0.25/0.5/0.75, the most common symmetric CAD
locations) produced a root-like node severing both straddling pairs: the
crossing was silently absorbed into a certification='tolerance' overlap
reported complete. The flip test now BRIDGES root-like runs (consecutive
GAP samples compared), bracket at the intervening node — the root is
exactly there. Tests: test_on_node_interior_crossing_is_never_merged[3].

Corollary discovered while fixing: an offset twin is NOT crossing-free
wherever the curve's tangent parallels the offset (the offset slides the
curve along itself — curve1's vertical tangent near u=0.75), so the
original primary fixture contained a real crossing; it now gets the
woven-family honest outcome (typed span, topology-incomplete), pinned by
test_offset_twin_with_vertical_tangent_is_not_cleanly_promoted, and the
clean-promotion pins moved to a crossing-free monotone-x pair.

A2 REFUTED with measurements: the z=const!=0 strict-gate lead
(origin-centering + extent-based tiny defend at z up to 1e6); closed-curve
seams over-reject (fail-safe); reversed orientation holds. Two PLAUSIBLE
leads recorded in the ledger for L52 (csx >12 chain constant on short
exact spans; even-crossings-per-interval aliasing on the fixed 65-grid).

A1: NO FINDINGS (13 leads refuted with runtime verification). One latent
weakness hardened: a NaN fres from a degenerate fixed-face solve fell into
the L25 exit-COMMIT branch (NaN > tol is False), masked only by the
tracer's downstream finite path-guard — the commit condition is now
accept-if (isfinite AND <= strict, the L45 convention), pinned by
test_exit_commit_refuses_nonfinite_fixed_face_residual.

Gates: singular suite 113 passed, ccx+csx suites 55 passed, harness 8
cases exit 0; boolean2d + nccx4 + param-tol pins green.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
_bez_ssx5.py: _find_exit_registration, _choose_cut/_choose_multi_cut,
_isoline_csx_to_global, _csx_on_cut_face, _pick_midpoint_axis,
_midpoint_split (~13.4k chars) — all zero-caller-verified (the live
subdivision path uses _compute_split_plan + inline multi-cut loops; ssx6
keeps its own repaired copies). _bez_ccx4.py: _curve_component_scale
(audit-confirmed dead; the live scale is the origin-centered exactness
context).

Process note, recorded in the ledger: the first removal pass overcut — a
marker-range cut swallowed the six LIVE partition functions between
_isoline_csx_to_global and _split_bern_scalar_tensor; the pre-commit gate
caught it (64 singular failures, zero commits affected) and every boundary
is now def-map-verified.

Gates: singular 113 passed, harness 8 cases exit 0, unit batch 94 passed.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
The ~110-line aggregate-status machinery existed as already-diverging
copy-pasted twins (comment wording, key sets, formatting had drifted while
the semantics stayed identical — the drift channel behind several L4x
findings). New mmcore/numeric/intersection/_adapter_status.py is the
single implementation (one-cell dispatch floor, truncation-to-allowance,
honesty flags, raise-or-mark policy, documented once); the adapters keep
their historical private names as thin delegations. CSX-specific concerns
stay local: the parameter_fibers ledger field, fiber->global mapping, and
the legacy two-value fiber refusal — message texts and the raise/extend
ordering are preserved exactly.

Gates: nccx4 + ncsx4 + boolean2d 56 passed (3 documented pre-existing
geom.curves import errors).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…contract gate

Slice 2: the zero-allowance net-build preflights turned out to ALREADY
exist in both bez_ccx and bez_csx (the review's §10 debt note was stale) —
test_zero_allowance_preflights_before_net_build now pins the ordering in
both suites so a refactor cannot regress it.

Slice 4 (review §11 step 5): examples/ssx/bez_ssx5_budget_contract.py
institutionalizes the 2026-07-12 review probes as an exit-coded gate:
every registered case solved twice, validating schema-v2 presence,
complete == (not reasons), reasons within the documented vocabulary,
finite work counters, stuv within [0,1]^4, per-vertex both-surface
residual <= 6*atol (measured worst 5e-14 across all 8 cases), and md5
branch determinism across runs. Added to the kickoff §3 gate list.

Ledger: L52 progress block records the 4 shipped slices and the remaining
scope (8-way budget merge core, exactness kits, margin policies,
predicates/restrictors, kwarg hygiene, Optional-budget threading, c1 tier
+ §11.6, A2 leads, efficiency items).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… then L50

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

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… to _work_budget

One shared budget module (review §10 finding 15): mmcore/numeric/_work_budget.py
now owns the schema-v2 REASON_* vocabulary, SoftWorkBudget (verbatim
_SSXSoftBudget extraction, re-exported for namespace consumers), charge_hook
(the guarded charge-lambda pattern, 7 sites migrated), and the explicit
charge-semantics registry documenting the four deliberate accounting families.
16 contract tests pin the extracted semantics. Gates: coverage 8x100% exit 0,
budget_contract exit 0, singular 113, unit batch 110.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…hingSpend into _work_budget

BernsteinZeroBudget/_ZERO_BUDGET/bernstein_zero_budget moved verbatim into the
shared budget module (re-imported via _bern_zero_1d; ContextVar identity pinned).
c3_pass's hand-rolled _spend closure replaced by shared LatchingSpend with
identical check-then-charge/latch/external-hook semantics (3 contract tests).
Gates: coverage exit 0, budget_contract exit 0, singular 113, unit batch green.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…s join the §3 gates

9 tests were stale-red since L47 (pre-existing at b0a2094; suite pinned pre-L47
'sub-tolerance sets stay distinct' semantics and was outside the gate list).
Every failure verified against the approved contract by measurement: sub-atol
parallel pairs ship ONE certification='tolerance' overlap (residual = geometric
gap; weight-scale + translation invariant) and NEVER certify 'exact' (5e-324
stays 'tolerance'); the non-affine candidate is L47's own typed-span fixture.
No code change. Both exactness suites + test_work_budget added to the §3 batch.

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

The paired cells_remaining/cells_processed locals in bez_ccx, bez_csx and
_find_csx_boundary_zeros move onto one DownCounter (spend keeps the pair in
sync); bounded fallback sub-allowances drawn via tier(cap). spend is
deliberately unchecked — every denial policy stays inline at its site.
Gates: coverage exit 0, budget_contract exit 0, singular 113, unit batch 142.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ily onto reconcile_reported

One implementation of the min-1/clamp/overrun billing rule; _adapter_status,
the closest-point trace reconciliation, and both NURBS aggregator drains
delegate to it (equivalence argued per site). Completes the core 8-way budget
merge at the mechanics level — all 8 accountings live in or delegate to
_work_budget.py. Gates: 4/4 exit 0 (singular 113, extended unit batch 194).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ift <= 2x baseline

Review doc §11.5 remainder: the harness records status.work per case, compares
cells_processed to the checked-in bez_ssx5_work_baseline.json, and exits 1 on
>2x drift; --update-baseline refreshes deliberately. Baselines recorded for
all 8 cases; failure path verified live (fake baseline -> x3.72 -> exit 1).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…t == 0.0

Review §10 extended debt: the three optimistic-variant guards now match the
conservative variants. Measured fixture-first: the implied inf-ptol overflow
is unreachable today (squared-sum norm flushes sub-1.5e-162 components to a
0.0 norm; worst reachable quotient ~4.5e158) — this is consistency hardening,
pinned by a denormal-sweep finiteness test against future norm changes.
Gates 4/4 exit 0.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Milestone adversarial review over b0a2094..485a57d: semantics/coverage/import
lenses NO FINDINGS; 1 confirmed minor — the hump tolerance-overlap re-pin
never asserted u_range/v_range, so a mislocated/partial span would have
passed. Span assertions added; review outcome recorded in the ledger.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
sth-v and others added 25 commits July 12, 2026 15:18
…icit envelope reconciliation

6a: bernstein_product_1d moves to _bezier_common (csx broadcast shapes + ccx
longdouble factor arithmetic, bit-identity pinned); dead _eval_curve_longdouble
removed. 6b: csx's affine-overlap certificate adopts ccx's derived two-term
envelope (64*n1*n2*eps_LD op + 8192*(n1+n2)*eps_f64 source) replacing the
folded 4096*n1*n2*eps_f64 bound — measured in-axis acceptance boundary
tightens (3.0,3.5]e-11 -> (2.6,3.0]e-11; single-axis offsets unaffected
(per-coordinate source scale). Gates 4/4 exit 0.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
_residual_excludes_zero excludes only beyond 128*eps*max|coeff| (§4 invariant;
the last unmargined sign prune). Fixture-first: 240 exact-Fraction restriction
chains -> 0 wrongful exclusions, 0 near-margin cases (invariant compliance,
not a reachable bug); pipeline impact zero (work-drift gate x1.00 on all 8
cases). Gates 4/4 exit 0.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…, 11, 12-first; L56; review + process notes)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…n _bezier_common

subdivide_curve, subdivide_sq_dist_net, restrict_net_axis(_v) move verbatim
(bodies were copy-paste identical modulo docstrings/param names); both modules
delegate under their historical private names. Gates 4/4 exit 0.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
geometry_collapsed in _bezier_common (local-motion 128*eps rule; the x=1e15
misclassification lesson in its docstring); ssx _curve_geometry_collapsed and
both csx fiber-path inline sites delegate. Margin policies x3 resolved by
documentation (different certificate shapes); residuals noted in the ledger.
Gates 4/4 exit 0.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…enamed to tol=

Shared reject_unknown_kwargs wired into the three v4 **kwargs adapters; first
contact caught the adapter suite's own silently-swallowed rational= kwarg.
The tol=/atol= sibling divergence resolved (nurbs_csx now spells it tol=, the
adapter-level convention; zero live callers passed it by name). Threading
disposition documented in the registry: remaining is-not-None guards are
deliberate site policy, not null-object candidates. New gated suite
tests/test_adapter_kwargs.py. Gates 4/4 exit 0.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… not work_budget

§11.6 de-budget (the L49 misbilling): new documented structural reason
unresolved_singular_set; the c1 wiring maps evidence (shared-dry -> work;
curve-detected truncation -> structural; no-curve -> work) instead of OR-ing
flags. Measured: pinch fixture work_budget persisted at 1e6 cells with c1=509
(result-cap truncation the c1 pass itself had classified as curve-explained);
case 14 tier saturation at 20k with 5x tier measured >2min without finishing
(tier kept, justification in the comment). Invariant declared + enforced in
the budget_contract gate: no gate case may report work_budget.
Gates 4/4 exit 0 (singular 114).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… 8, 9a; next queue 9b/10/12/L50)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… test debris

Milestone review (4 lenses, 2 refuters/finding): envelope+moves lenses clean;
3 confirmed minors. (1) structural SINGULAR_SET classification now trusted
only when the FULL 20k c1 tier was available — a shared-remainder-clamped
tier truncation is budget-fixable and stays work_budget (closes the
contention hole through c1's curve_like blind spot). (2) nccx 3D fixture's
stale rational= kwarg + 2-tuple unpacks repaired. (3) untracked example-WIP
scripts' atol=/angle_tol= now fail loud (disposition noted, files untouched).
Gates 4/4 exit 0 (singular 114).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…silently complete

A2's >12 chain-constant lead CONFIRMED (corner-clipped 4.2*ptol_t continuum
shipped 3 lattice roots complete=True — the armed span evidence was blocked
by the count bar). Lattice-cluster detection replaces the bare count: >=3
roots with gaps <= 4*ptol_t whose gap midpoints ALL pass the STRICT residual
certificate -> typed uncertified_overlap_span + topology-incomplete (roots
kept, no false exhaustion). Sub-atol valley chains fail strict by construction
(never-merge invariant pinned by the negative control). 65-grid aliasing lead:
verified documented at the certificate site; no change without the user's
band-bar decision. Gates 4/4 exit 0.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…; next: 9b/12-remainder/L50)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…gions)

'Partial' now names WHAT is unresolved: depth-ceiling dumps, work-exhausted
queue remainders, and the two bail-before-queue early returns each emit typed
4-D boxes with their reason (the parameter_fibers pattern; additive field,
output-cap bounded). Case 13: 5 typed boxes alongside depth_limit.
Gates 4/4 exit 0.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ss, user fixtures) + L58 (spheres, parked)

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…cripts (user geometry)

User-authored visual test scripts, previously untracked — the only coverage
of the CSX non-affine overlap class, which let the 5d05ddc hardening break
that class silently (ledger L59). Committed as-is at the user's request;
exit-coded fixtures distilled from them land with the L59 tier.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ision + bisect evidence

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ation (user decision)

Two arcs coinciding on any open sub-arc lie on the same algebraic curve, so a
maximal overlap terminates only at operand domain boundaries: the tier arms on
cheap endpoint evidence, verifies domain-pinned span ends (curve t-ends or
PROJECTED uv-edge pins) + dense witnesses + a normal-side flip guard, and lets
the theorem carry the interior. certification: 'exact'|'tolerance'; certified
spans bypass Phase 2. SSX: certified spans feed the L28 rim channel (rational
case-12 twin regains its region) and curved-correspondence overlaps ship as
sampled residual-verified branches (user fixtures A/B now C-quality, both
branches full and linked to the tangent point). Corner-contact single-sample
runs refused. Exactness contracts re-pinned to tolerance semantics. Measured:
real-data pair 12,234-cells-empty-complete -> 1 tolerance overlap at ~180
cells; L42 parabola -> 1 'exact' overlap, 204 cells. Residual perf item = L60
(near-band emptiness grind, pre-existing). Gates 4/4 exit 0 (singular 115,
unit 161, work drift x0.99-1.19).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…2-remainder/L50; PR deferred pending user)

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

Diagnosis corrected during TDD: the worst profiled pair is a one-side-pinned
tolerance band (touch at t=0, sub-atol to the u=1 edge exit), not emptiness.
(1) geometry-aligned exclusion dot(G, n_mean) as exact L1-margined scalar net,
wired per-cell and per-interval; (2) span pins probed one grid step outward
(the tolerance boundary and the uv-edge exit coincide on real data; interior
fade-outs still refuse); (3) end-adjacent flip exemption (an inexact-data
touch at a pinned end is the endpoint root; interior flips still refuse).
Worst pair: 28,961 cells/0 overlaps -> 1 tolerance overlap; script-3 call 2:
51s -> 30s and 2 -> 7 certified spans (tiny reported 1 — under-reported).
Gates 4/4 exit 0 (singular 115, unit 162, work drift x0.91-1.13).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… pairs; split pricing

The user's 'where do the gaps go?' resolved the remainder: coincident
stretches entering AND exiting through patch edges at sub-atol clearance
produce zero exact boundary roots, so the arming gate never fired on exactly
the pairs that mattered. Armed now for zero-zero pairs (transversal calls
untouched). The flat tier price tripped the §11.5 work-drift gate live
(case 15 x3.61, case 7 x2.00, constrained case-11 test) — split: arming
scan bills 17, dense pass 145 only on a hit; baselines refreshed
deliberately. Script-3 call 2: ONE overlap (5.9230, 20.1120) vs tiny's
(5.9238, 20.1131) — sub-ptol agreement at 4.2s (57s at session start).
Gates 4/4 exit 0, all cases x1.00.

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

The ledger-flagged 'needs , _status when next touched' migration: all
2-tuple unpacks now take the status third element. All six scripts run
clean end-to-end: _new 0.6s/1 ovl, _4 1.5s/1 ovl, _5 1.2s/3 ovl, _6 0.1s/2
ovl, _3 4.2s/1 ovl (was the 57s 'freeze').

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… and green

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…, repro-first)

The methodology spec captures the user's principle, the tolerance semantics,
the measured amendments (projected pins, outward probe, corner guard,
end-adjacent flips, split pricing), the invariant interplay, the measured
record, and the open CCX woven question. L61 registers the user-reported
residual bilinear branch loss: NOT reproduced at HEAD (all five constructible
variants pass) — exact repro required before any code change; the branch does
not merge until closed.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ith knots)

The normalized fixtures deliberately drop the knot vectors (single-span nets
are Bezier-identical) — but if the user's still-failing run goes through a
NURBS-level driver, the knots and the stuv->knot mapping are the prime
suspects, and they existed only in the conversation. All three cases pass at
the Bezier level at HEAD (recorded), which moves the driver/viewer mapping
hypothesis to the front of L61.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
… overlap scripts

- Reduced default line widths in `renderer3d` for better consistency (`inner_width`, `outline_width`).
- Adjusted point sizes and surface transparency across examples for clarity and uniform visualization.
- Removed unused `--angle_tol` parameter in scripts; replaced remaining references with `tol`.
- Introduced `add_point3d` for rendering improvements in overlap scripts.
- Simplified and standardized viewer runtimes for overlap scenarios.
…ifted

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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