feat(brep): CBRA 1.0.437-1.0.453 follow-up series (P0-H): dispatch, budgets, perf, precision, governance #1

Open
hm wants to merge 0 commits from hm/smlib-brep-nurbs-align-1.0.400 AGit into main
Owner

CBRA follow-up series 1.0.437-1.0.453: 17 releases / reports 500-518. Dispatch default-on (A/B CPU 0.971x, 0 failed), failure learning, chain budget/breaker; CB1 cut -30~-90%, audit -62%; exact-difference tool eligibility; volume contract; CB4 degenerate-run contract; repo governance (worktrees 59->1). Full ctest 9090 passed / 0 failed.

CBRA follow-up series 1.0.437-1.0.453: 17 releases / reports 500-518. Dispatch default-on (A/B CPU 0.971x, 0 failed), failure learning, chain budget/breaker; CB1 cut -30~-90%, audit -62%; exact-difference tool eligibility; volume contract; CB4 degenerate-run contract; repo governance (worktrees 59->1). Full ctest 9090 passed / 0 failed.
hm added 56 commits 2026-11-17 01:20:09 +00:00
- docs/reference/459: correct SMLib module layout (SmMerge+SmTopologyIntersector+SmProtoTopology; no SmBody/SmTolerantModeling) + per-domain capability matrix + G1-G10 gaps
- docs/planning: A1-A6 alignment plan with per-WP acceptance and gates
- curves: surface_remove_knot / surface_remove_knots_to_tolerance (row-wise homogeneous LSQ + measured 9x9 deviation, cumulative tolerance)
- curves: curve_g1_breaks / split_curve_g1 / curve_degenerate_spans (one-sided analytic tangents)
- brep: analyze_regions (shell connected components via union-find, ray nesting tree, void/solid, volume deduction; read-only)
- version 1.0.401; 13 new tests; target subset 733/733, PR gate 913/913
- curve fitting: approximate_curve_refined (closest-point error metric, parameter-correction loop, control-point scan; aligns N_FitCrvApprox)
  same 6 CP error 5.941e-4 -> 4.660e-4 (-21.6%); 90-degree arc reaches 1e-6 within 24 CP
- surface: split_surface_to_bezier_patches (raise internal knot multiplicity to degree, extract (p+1)x(q+1) control nets; aligns N_SrfDecomposeToBez)
  cylinder -> 4 patches, bicubic -> 2 patches; pointwise <=1e-12; area sum rel <=1e-9
- tests: test_smlib_nurbs_alignment 14/14 (+5); target subset 629/629; PR gate PASS (~913, 36.8 s)
- version 1.0.402; report 461; plan A2-1/A2-4 marked done
- extend_surface_g1: distance->parameter width via boundary speed, insert p-fold knot to cut a Bezier segment at the boundary, mirror control rows Q_k=2P_p-P_{p-k}, duplicate seam row, clamp new end
- self-check: original-domain preservation, seam position, seam tangent; ok=false on failure
- measured: plane extension exact (errors 0, tangent <=1e-9); cylinder 90-deg patch vmax width=0.070711, original error 8.95e-16, seam pos 0, tangent 2.107e-8 rad; reflection consistency <=1e-12
- note: extend_surface's G1/G2 branches are unreachable since VDE-1475 (linear extrapolation); this adds real G1
- tests: test_smlib_nurbs_alignment 18/18 (+4); target subset 655/655 (15.74 s)
- version 1.0.403; report 462; plan A2-3 marked done
- fit_surface_to_grid: chord parameterization, tensor-product LSQ (separable QR solve), closest-point error, per-row/col parameter correction, alternating control-point growth; aligns N_FitSrfApproxTol
- measured: bicubic polynomial 9x9 tol 1e-6 -> dev 3.589e-7 CP 8x7; sphere octant 11x11 tol 1e-3 -> dev 7.548e-4 CP 6x5
- degenerate grid / unreachable tolerance return ok=false with best fit and error
- A2-5 (knot-removal error upper bound) deferred: measured-deviation acceptance already prevents degradation
- tests: test_smlib_nurbs_alignment 22/22 (+4); target subset 659/659 (32.21 s)
- version 1.0.404; report 463; plan A2-2 done, A2-5 deferred
- new intersect_surfaces_robust + SSIOptions; legacy intersect_surfaces behavior unchanged
- leaf-relative seed gate: max(tolerance*100, 0.5*max(diagA,diagB)) instead of absolute threshold
- robust seed clustering at 1% parameter domain
- overlap dedupe (60% containment) + endpoint stitching (reverse-aware) to reduce fragmentation
- measured: sphere R10 z=9.999 x plane micro-circle 0 -> 13 arcs; sphere-sphere 40 -> 5 curves; cylinder-sphere 0 -> 14 curves; residuals <=1e-4
- limits: fragments still >1; singular handling (A3-3) and exact p-curve (A3-4) pending
- tests: test_smlib_nurbs_alignment 25/25 (+3); target subset 689/689 (18.30 s)
- version 1.0.405; report 464; plan A3-1/A3-2 marked partial
- rebuild_branches_from_fragments: spatial-hash dedupe, median sampling spacing, eps_link=max(2*eps_merge, 6*spacing) adjacency, union-find components, greedy walk from degree<=1 endpoint, one curve per component
- measured: micro-circle 13 -> 3 arcs (legacy 0); sphere-sphere 40 -> 2 curves; cylinder-sphere 14 -> 9 curves; residuals <=1e-4; 32-115 ms
- tests tightened: micro <=4, sphere-sphere <=3, cylinder-sphere <=10
- limits: crossing branches may be mis-connected; <3-point fragments dropped; A3-3/A3-4 pending; legacy entry unchanged
- tests: test_smlib_nurbs_alignment 25/25; target subset 689/689 (24.69 s)
- version 1.0.406; report 465; plan A3-2 marked essentially done
- analyze_contact + ContactKind (None/Point/Line/Loop/Uncertain): distance -> normal angle -> principal curvature intervals in common normal (B flipped when normals oppose)
- is_point_contact veto: Loop (interleaving intervals) or Line (touching endpoints) no longer rejected as point contact; legacy line-step/side-scan kept as fallback
- measured: external/internal tangent spheres -> Point; cylinder on plane -> Line; crossing cylinders -> Loop; coincident planes -> Uncertain; parallel planes -> None
- limits: interval-only heuristic (no principal directions/second fundamental form); StepBackFromSingularity-style step-back pending
- tests: test_smlib_nurbs_alignment 31/31 (+6); SSI/boolean regression 743/743 (54.60 s)
- version 1.0.407; report 466; plan A3-3 marked partial
- refine_intersection_seed + SeedRefinement: 4-parameter Levenberg-Marquardt (analytic Jacobian, adaptive lambda, domain clamp) with StepBackFromSingularity-style fallback along J null-space +/- and A/B parameter axes +/- at 1%..N% domain steps
- robust seeding uses the fallback when leaf-level refinement stalls (opt-in; legacy entry unchanged)
- fixed latent false-positive: newton_refine_ss returns true on stagnation; new entry rechecks residual (legacy function untouched for tracing)
- measured: perturbed plane-sphere seed residual <=1e-6; degenerate pole seed (sphere z=9.999) rescued onto micro-circle (r=0.1414); separated planes correctly fail
- tests: test_smlib_nurbs_alignment 34/34 (+3); SSI/boolean regression 746/746 (46.81 s)
- version 1.0.408; report 467; plan A3-3 marked complete
- find_boundary_seeds + BoundarySeedParams: sample 4 iso-boundaries per surface, signed distance to the other surface (closest point + normal), sign-change bisection (50 iters), LM refinement with step-back, parameter dedupe
- SSIOptions::boundary_seeding added; intersect_surfaces_robust enables it by default (legacy unchanged)
- measured: cylinder 90-deg patch x plane z=0 -> >=2 seeds on the intersection (|z|<=1e-5, radius 2, distance to plane <=1e-6); separated boundary -> 0 seeds; cylinder-sphere robust result preserved
- limits: ~144 closest-point queries per surface pair (robust only); coincident boundary yields redundant seeds; double crossings thinner than sample spacing may be missed
- tests: test_smlib_nurbs_alignment 37/37 (+3); SSI/boolean regression 749/749 (69.77 s)
- version 1.0.409; report 468; plan A3-1 marked complete
- stitch_with_escalation + EscalatingStitchReport: each pass runs heal_gaps(tol) + heal_merge_edges(tol), validates watertightness, escalates tolerance x10 (cap x100) and reports merged counts / open edges / diagnostic on failure
- auto_heal_pipeline is internally adaptive (no external tolerance), so explicit gap/edge merges are used to make escalation observable and reproducible
- measured: normal box passes=1 watertight; split box delta=5e-6 fails at 1e-6 and closes at 1e-5 (E 18->12, wt 1.0, open=0); delta=1e-3 with cap 1e-5 fails honestly
- A3-4 (exact p-curve) recorded as already covered by exact-arc/exact-trim path (trim max 9.16e-16)
- tests: new test_smlib_stitch_alignment 3/3; B-Rep/boolean/SSI regression 857/857 (41.74 s)
- version 1.0.410; report 469; plan A5-1 done, A3-4 covered
- zone_tolerance_for_size: SMLib SmTol 4-band size table with out-of-range clamping
- derive_object_tolerances: model bbox diagonal -> zone; vertex tol = max(stored, zone); edge tol = max(zone, endpoint vertex tols); reports per-edge/per-vertex tolerances and escalation counts
- measured: 0.1->1e-6, 3->1e-5, 1000->1e-4, 1e5->1e-3; 2^3 box zone 1e-5 with 12 edges at 1e-5; vertex tol 1e-3 escalates its 3 edges; empty body defaults to 1e-5 (fixed inf bbox diagonal being treated as huge model)
- limits: no gap term yet (GapGain needs gap measurement, A5-2b); read-only diagnostic, not consumed by stitch/boolean
- tests: new test_smlib_tolerance_alignment 5/5; B-Rep/boolean/SSI regression 862/862 (38.85 s)
- version 1.0.411; report 470; plan A5-2 done
- measured: default to_mesh already watertight for analytic bodies (box 12 tris/0 boundary, cylinder 92/0, sphere 368448/0, torus 1024/0); no global default flip (avoids VDE-1237 filleted-box 6444->17316 regression)
- new tessellate_watertight + options/result: return baseline when already watertight; otherwise force shared-edge samples + T-junction stitch; triangle count > max_triangle_factor x baseline -> budget_exceeded and baseline mesh returned; boundary edges remaining -> ok=false
- measured: box/cylinder/sphere ok with 0 boundary; gapped split body boundary=24 reported as failure; factor 0.5 triggers budget fallback; empty body rejected
- limits: shared sampling only fixes seams on shared topology; budget is triangle-ratio based (default 4x); not wired into default path
- tests: new test_smlib_tessellation_alignment 5/5; B-Rep/boolean/SSI/mesh regression 1231/1231 (46.38 s)
- version 1.0.412; report 471; plan A5-3 achieved
- audit_face_loops + FaceLoopAudit: per loop checks >=3 edges, adjacent edges share a vertex (undirected, ignores edge.reversed), every vertex degree exactly 2, loop edge graph connected; reports per-face loop/hole/open/degenerate counts
- measured: box 6 faces/6 loops/0 open; box-cylinder through-hole (30 faces) has 2 double-loop faces, 32 loops, 0 open/degenerate and validate valid/wt 1.0 -> multi-loop assembly currently correct, so this batch only freezes the invariant as a gate, no assembly change
- negatives: open edge chain -> open_loops=1; 2-edge loop -> degenerate_loops=1, ok=false with diagnostic
- A4-1/A4-2 still pending (require ssi_boolean assembly refactor; opt-in A/B planned)
- tests: new test_smlib_loop_audit 4/4; B-Rep/boolean/SSI/mesh regression 1235/1235 (64.17 s)
- version 1.0.413; report 472; plan A4-3 verified
- check_region_volume_consistency + RegionVolumeConsistency: compares analyze_regions().solid_volume with measure::volume(body); two independent nesting/sign paths cross-check each other; returns both volumes, relative error and diagnostic
- measured: box(2) 8 vs 8 (<=1e-9); sphere cavity R5/r3 within 2e-2 (mesh discretization); box(10)-cylinder(R2) through hole within 1e-2; empty body consistent
- read-only with zero behavior change; not yet consumed by boolean classification (needs A4 assembly refactor)
- tests: test_region_analysis 8/8 (+4); B-Rep/boolean/SSI/mesh regression 1239/1239 (57.72 s)
- version 1.0.414; report 473; plan A6 marked step 1 done
- classify_face_fragment: VDE_SSI_EDGE_CLASSIFY branch samples fragment boundary edges at t=0.45678 (SMLib-style), skips ON samples, early-returns only when >=2 non-ON samples agree, else falls back to existing multi-point voting
- A/B: SSI/ExactHole/PCurve/Fallback 58/58 both; boolean/quality/containment/fuzz 104/104 with env; box-sphere benchmark identical (7 faces, valid, wt 1.0, rel 3.676e-10, boundary 0); suite time 38.43 -> 43.54 s (+13%)
- decision: neutral correctness with extra cost, so default stays off; code kept as reproducible experiment; real gain requires A4-1 cut-edge topology first (cut-edge samples fall on ON)
- tests: new in-process A/B test_smlib_boolean_edge_classify 1/1; default regression 269/269 (45.08 s)
- version 1.0.415; report 474; plan A4-2 marked experiment-done (neutral)
- build_cut_curve_topology + CutCurveTopology: endpoint snapping within tolerance, T-junction splitting when a curve endpoint falls inside another edge (iterated to fixpoint), duplicate-edge dedupe, degree/open-end/component/closed-loop statistics, per-edge source_curve provenance
- measured: shared endpoint merge (3 vertices/1 component), 5e-7 snap, T-junction split (4 vertices/3 edges/open=3), polyline split keeps provenance, disjoint segments 2 components, square loop closed_loops=1, degenerate curve rejected; real box-cyl through-hole edge graph has open_ends=0 and 2 components (outer rect vs hole ring share no vertex, as expected graph-theoretically)
- not wired into ssi_boolean (zero behavior change); next A4-1b maps SSI curves to result edges and re-evaluates region classification
- tests: new test_smlib_cut_topology 8/8; SMLib/B-Rep/boolean/region regression 260/260 (26.44 s)
- version 1.0.416; report 475; plan A4-1 marked step 1 done
- audit_cut_edge_coverage + CutEdgeCoverage: for each result edge sample, first test whether the sample lies on both inputs' trimmed boundary meshes (cut edge), then require distance to a x b SSI curves within tolerance; reports curve/edge/cut-sample/covered counts, coverage and max miss
- direction corrected during development: forward 'SSI samples -> result edge distance' gave only 12.5% coverage on box-cylinder because compute_all_ssi returns untrimmed full intersection lines (including in-hole extensions); reverse check yields 100% coverage with zero misses under VDE_CUTCOV_DIAG
- measured: box(10)-cylinder(R2) 84 edges checked, all cut samples covered, ok, 86 ms; disjoint union and empty result are vacuous-ok
- read-only, zero behavior change; provides the data check for A4-2 shared-edge classification
- tests: new test_smlib_cut_coverage 3/3; SMLib/B-Rep/boolean/region regression 263/263 (24.66 s)
- version 1.0.417; report 476; plan A4-1 marked two steps done
- build_cut_edge_provenance + CutEdgeProvenance/Result: for each result edge determine cut-edge status against both inputs' trimmed boundary meshes and map it to the nearest SSI curve with face_a/face_b provenance; reports per-edge details, matched counts and max match distance
- cut-edge classification fix: 'any sample touches both boundaries' misclassified 24 cylinder wall seam edges (only endpoints on box planes) leading to 24/72 unmatched and distance 10; requiring ALL samples on both trimmed boundaries yields exactly the 48 hole-rim cut edges with 48/48 matched and max distance 1.4e-15
- audit_cut_edge_coverage refactored to reuse the provenance builder (single source of truth)
- measured: box(10)-cylinder(R2) curves 48/result edges 84/cut 48/matched 48; disjoint union and empty result are vacuous-ok
- read-only, zero behavior change; A4-2 re-evaluation can now consume the provenance map
- tests: test_smlib_cut_coverage 6/6 (+3 provenance); SMLib/B-Rep/boolean/region regression 266/266 (34.70 s)
- version 1.0.418; report 477; plan A4-1 marked data layer complete
- audit_boolean_regions + BooleanRegionAudit: combines analyze_regions (solid/void region counts, solid volume), volume necessary bounds per boolean op (union max<=Vr<=sum, intersection Vr<=min, difference Vr<=Va with 2e-2 mesh tolerance) and audit_boolean_membership into one read-only gate
- measured: disjoint union solid=2/Vr=16; box-cylinder through hole solid=1/void=1 valid; overlapping boxes intersection within bounds; box-enclosed-sphere difference keeps cavity (solid=1/void=2, detectable via region counts); wrong union (missing b) fails on membership with diagnostic
- read-only, zero behavior change; region-driven face classification still needs the A4 assembly refactor
- tests: new test_smlib_boolean_region_audit 5/5; SMLib/B-Rep/boolean/region regression 275/275 (27.39 s)
- version 1.0.419; report 478; plan A6 marked first two steps done
- new test_smlib_boolean_limitations: trips when oblique analytic-cylinder union/intersection change from the current invalid shape (loose bounds: non-watertight, dangling edges, face-count cap) so future fixes must update them to valid/watertight
- diagnosis: brep_union falls back to legacy core because allow_ssi requires both operands <=6 faces and all planar; legacy gives 7 faces/12 dangling edges/wt 0.40, direct SSI core gives 24 faces/48 dangling edges — the true gap is assembly-level: oblique ellipse cut edges are not unified into shared edges (per-face loops close but edges are referenced by one face only)
- fix intentionally deferred: needs geometric coincidence + vertex snapping + edge merging with tolerance in ssi_boolean_core (structural change, opt-in+A/B required); A4-1c provenance data layer is ready
- plan A4-2 marked as acceptance not met (oblique cylinder union)
- tests: +2 tripwires; SMLib/B-Rep/boolean/region regression 277/277 (50.80 s)
- version 1.0.420; report 479
- unify_coincident_topology + UnifyTopologyStats: union coincident vertices via floor(p/tol) spatial grid with 27-neighbor radius check (plain cell rounding missed points within tol); dedupe edges by merged endpoints + straight flag + degree + curve samples at 0.25/0.5/0.75; compact rebuild preserving faces/trimmed surfaces/shells/bodies
- measured: closed box no-op; hinge with duplicated shared edge (5e-7 offset) merges 2 vertices/1 edge and open 8->6; split box with independent topology (48 vertices/24 edges) merges 40 vertices/12 edges and becomes watertight (>=0.999)
- root-cause correction for A4-2: applying unify to the oblique-cylinder union gives 0 merges (open 12->12) -> dangling edges have no coincident counterpart; the real defect is dropped faces during assembly (union result only 7 faces), not unmerged cut edges. Oblique union acceptance remains unmet; next step is locating face loss in legacy/SSI cores
- tests: new test_smlib_unify_topology 3/3; SMLib/B-Rep/boolean/region regression 276/276 (38.08 s)
- version 1.0.421; report 480; plan A4-2 root cause updated
- dedupe_overlapping_curves: short fragments (<=12 points) now tested against the longer curve's polyline segments instead of its discrete sample points; with 254-point long curves and ~0.04 sample spacing vs eps=1e-3 the old test never matched, leaving coincident fragments in place
- restricting polyline distance to short fragments is required: applying it to all pairs degraded sphere-sphere robust SSI from 2 curves to 14 (short segments of adjacent branches wrongly dropped and stitching regrouped)
- measured: oblique equal-radius cylinder surfaces 9 curves (1 main + 8 fragments) -> 1 curve (20 points, two-surface residual 1.8e-15); sphere-sphere stays 2 curves
- added VDE_SSI_ROBUST_PAIRS experiment: retry robust entry when numeric SSI yields >12 curves for a face pair (analytic exact path unaffected)
- root cause chain for A4-2 updated: oblique cylinder boolean failure is downstream in face classification/assembly (legacy core keeps only one cylinder's volume for coaxial union; SSI core has 24 faces/48 dangling edges), not in SSI curves
- tests: test_smlib_nurbs_alignment 38/38 (+1); Nurbs/Smlib/SSI/boolean/B-Rep regression 684/684 (26.60 s)
- version 1.0.422; report 481; plan A4-2 root-cause chain updated
- measure_stitch_gaps + StitchGapMeasure: open edges (edge_faces()==1) are sampled at interior points only, pairwise minimum distances give min/median/max gap, and the SMLib SmTol gap gain (1.1) yields suggested_stitch_tolerance = max(zone, 1.1*min_gap) plus a gap_escalated flag and closest open-edge pairs
- interior sampling is essential: including endpoints makes adjacent edges that merely share a corner report gap 0 for any open shell (caught during testing)
- fixture uses per-face offset i*delta so duplicate-edge gaps equal delta; same-parity faces would otherwise be exactly coincident and keep gap at 0
- measured: watertight box no open edges, suggested = zone; split box gap 0 -> min 0; gap 5e-6 < zone 1e-5 -> not escalated; gap 2e-5 -> suggested 2.2e-5 escalated
- read-only diagnostic, not consumed by stitch/import paths; only EE gaps (VE/EF/VF later)
- tests: new test_smlib_gap_measure 4/4; Smlib/B-Rep/boolean/mesh/SSI regression 1043/1043 (32.94 s)
- version 1.0.423; report 482; plan A5-2b done
- SurfaceKnotRemoval gains error_upper_bound and bound_rigorous: the removed knot is exactly re-inserted into the candidate to restore the original knot vector, then the homogeneous control-point difference yields |S1-S2| <= max|w1P1-w2P2|/Wmin + max|wP|*max|w1-w2|/Wmin^2 (non-rational reduces to classic max|dP|; rigorous for positive rational weights)
- surface_remove_knot computes the bound before each acceptance and on rejected candidates (diagnostic fit with huge tolerance); surface_remove_knots_to_tolerance accumulates per-step bounds and takes max with final cumulative deviation
- measured: cylinder exact removal bound_rigorous with bound <=1e-9 and >= sampled deviation; curved-surface strict rejection reports bound ~0.0776 covering sampled deviation; rational sphere removable with rigorous bound; 3-knot aggregate removal bound >= max_deviation and <=1e-9
- plan A2-5 moves from deferred to done
- tests: test_smlib_nurbs_alignment 42/42 (+4); curves/surfaces/SSI/boolean/B-Rep regression 720/720 (28.02 s)
- version 1.0.424; report 483
- final summary report 484: 24 commits / 26 versions / reports 460-484; A1-A6 delivered except A4-2 (oblique-cylinder union) which is blocked by the pre-existing curved-surface boolean classification/assembly defect (legacy core and SSI core both lose faces; not an SSI-curve or duplicate-edge problem)
- reusable infrastructure documented for the future boolean refactor: cut-edge provenance, cut-edge coverage audit, face-loop audit, unify_coincident_topology, limitation tripwires, gap/tolerance measurement
- full ctest -j8: 8890/8896 passed (99.93%); the 6 failures are all in paths with zero commits on this branch (src/cae, tests/cae, tests/benchmark, test_ssi_boolean.cpp, test_boolean_benchmark.cpp) and 3 of them pass when rerun individually
- plan gains a final status + leftover-gap section; version chain 1.0.425; vde_release --check PASS
- build_cut_graph / CutGraph: AABB face-pair prefilter, analytic exact intersection preferred (exact_intersection_multi) with robust numeric fallback, per-point domain clipping to the finite face patches, endpoint snapping statistics (merged pairs/closed/open/components) with provenance (face_a/face_b)
- key finding: analytic exact curves are intersections of unbounded analytic surfaces and can lie outside finite NURBS patches (ellipse beyond cylinder height); naive sampling produced false residuals of 4.0; projecting each point, flagging out-of-domain and splitting contiguous in-domain runs reduces worst residual to <=3.5e-15 (oblique cylinders 10 branches, sphere-sphere 4, box-cylinder 8)
- adds CBRA experiment contract include/vde/brep/curved_boolean.h + harness skeleton (CB0 to be filled next) and project plan docs/planning/curved-boolean-refactor-plan-1.0.426.md
- tests: new test_curved_boolean_topology 5/5; Smlib/B-Rep/boolean regression 232/232 (32.83 s)
- version 1.0.426; report 485
- curved_boolean_fixtures(): 8 deterministic fixtures: oblique cylinders union/inter/diff, coaxial union, tangent degeneracy stress cases (box4 + r2 cylinder), non-tangent control (box10^3 + cylinder r2/h20)
- audit_curved_boolean(): validate/watertight/dangling/non-manifold, mesh volume, per-op volume necessary bounds, membership audit; acceptance is valid && watertight && membership_ok (mismatch<=1e-3) because volume bounds alone cannot catch lost union increments (all 6 failing fixtures had bounds=true)
- baseline reproduces A4-2 shape: oblique union 7 faces/12 dangling/wt0.40/V=171.3877; coaxial union V=125.6637 vs correct 188.4956 (150.8 was a typo); non-tangent box+cyl control passes (16 faces, watertight, V=1125.6637); fake union rejected with mismatch 0.953
- tests: new test_curved_boolean_baseline 4/4 (2.9 s); plan corrections (fixtures, coaxial volume typo, mandatory membership); version 1.0.427; report 487
- CB2 split_face_domains: UV trim boundary from build_domain_polygons, cut branches stitched across trimmed patches by exact 3D endpoints (closed loops recovered), clipped to trim domain and extended along tangents, incremental polygon splitting (closed loop -> island + holed outer; open chain -> two complementary polygons), per-segment BoundaryTag provenance (branch_id/side), uv-area accounting with explicit failures
  measured (5/5): box-cyl 8 fragments on box (disc + holed outer per cap), 14 on cylinder; oblique cylinders 18/17; max area rel error <=6.661e-16; budget/empty/out-of-range rejected
- CB3 classify_face_fragments: deterministic UV grid + seeded supplements (hole-aware, boundary margin), cut-edge-adjacent enhanced votes, 3D mapping and classify_point_adaptive majority; IN/OUT/ON + confidence; all-ON/no-sample/tie -> ok=false
  measured (15/15): box corner OUT 9/9, center IN 9/9, crossing case 3/5/1 OUT conf 0.625; CB2 integration box side IN=2/OUT=6, cylinder side IN=4/OUT=10
- CB4 contract skeleton added (assembler implementation follows)
- tests: 30/30 CBRA tests in 6.25 s; registered 8890; version 1.0.428; reports 488/489
- ssi_boolean get_mesh cache had no geometry fingerprint: same-address objects with changed geometry (in-place transform / address reuse) returned stale meshes, causing CB3 end-cap fragments to classify all-ON; now keyed by O(1) topology+AABB FNV-1a fingerprint, rebuilding mesh and clearing the grid cache on mismatch
- split_and_classify_faces_ssi appended fragments to a shared vector inside an OpenMP loop, so output order depended on thread completion and fixed-seed booleans produced different volumes under load; per-face slots are now filled independently and flattened in face order
- CB1 build_cut_graph skips coincident analytic surface pairs (coaxial same-radius cylinders) and enforces a 10s time budget with explicit failure, cutting the coaxial case from >15 min to 0.49 s; endpoint-bisection refinement was tried and reverted because it over-split CB2 fragments (8->30)
- curved_boolean() end-to-end entry (CB1->CB2->CB3->CB4->audit) with planar x planar fast rejection; opt-in VDE_CURVED_BOOLEAN dispatch in boolean_unified
- evidence: 120 fixed-seed fuzz runs across 8 concurrent processes now 0 failures (was 5/8 processes); CBRA CB3 end-cap ON resolved; Smlib/B-Rep/boolean/CBRA/Nurbs regression 724/724 (108.52 s)
- version 1.0.429; report 491
- assemble_curved_boolean: retention predicate per op (union keeps A/B non-IN, intersection keeps non-OUT, difference keeps A non-IN + B IN reversed; ON/upstream failure aborts explicitly), fragment -> TrimmedSurface(PCurve)+TopoFace, cut edges paired by BoundaryTag branch provenance, canonical split unifies event breakpoints and 3D event positions across both bodies, unify_coincident_topology welding, dangling-edge diagnostics
- measured: box(10)+cyl(r2,h20) union -> 16 faces, valid, watertight 1.0, dangling 0 (was 8); difference -> 10 faces, valid/watertight, volume 874.336316 vs analytic 874.336294 (2e-5)
- known: union mesh volume 1041.89 vs 1125.66 (topology closed; points to face tessellation/orientation contribution), coaxial coincident-surface merge and oblique CB3 ON still explicit fallbacks
- tests: test_curved_boolean_assemble 14 tests (12 PASS + 2 env-gated SKIP); CBRA subset 46 green
- version 1.0.430; report 490; plan CB4 done / CB5 in progress
- VDE1242 fluid domain: background tet mesh now disables reject_invalid_output (external domain is a multi-shell non-convex background; parity filtering produces the real fluid region); 36/36 + CAE subset 61/61
- BenchBoolean Complexity_* were genuine 600s timeouts at original resolutions (baseline equally slow, not a branch regression); reduced resolutions keep the union coverage meaningful (27.5s/58.0s standalone, 80.8s/88.5s under -j8)
- BooleanBenchmarkTest wall-clock assertion is load-sensitive: RUN_SERIAL isolation via add_vde_test properties (no assertion changes); CB0 baseline recording test added to the same serial list
- real concurrency defect in src/brep was fixed earlier in 1.0.429 and verified again by the failures workstream (0/150 default OMP after removing the temporary OMP_NUM_THREADS=1 isolation)
- CB4 face-orientation fix: assembled faces now preserve the input face reversed flag XOR the predicate reversal, so cylinder cap contributions no longer cancel; box union volume 1125.669654 vs analytic 1125.663708 (5e-6 rel), difference 874.336316 (2e-5), both valid/watertight/dangling 0
- full suite (new binaries): 8941/8942 pass, 805.74 s; the single remaining failure (CB0 legacy-shape recording under heavy load) now runs serial
- version 1.0.431; reports 486 + updated 490
- curved_boolean() now runs the full CB1->CB2->CB3->CB4 pipeline with audit gate; boolean_unified gains VDE_CURVED_BOOLEAN opt-in dispatch that only replaces legacy results when the audit passes (default unchanged)
- end-to-end positive case: box(10) union cylinder(r2,h20) -> 16 faces valid watertight dangling 0 volume 1125.669654 (analytic 1125.663708); difference -> 10 faces volume 874.336316 (2e-5); new hard-assertion test CurvedBooleanEntry.BoxCylEndToEndPassesAudit
- A/B with dispatch enabled: SSIBoolean/ExactHole/BrepTest/CB4 integration 94/94 pass (27.09 s), no regressions
- remaining gaps kept explicit: oblique curved-curved union dangling 39/wt 0.44; coaxial coincident-surface merge still needs CB2 2D UV merge; default dispatch stays off
- tests: registered 8904; version 1.0.432; report 492
- VDE_CB4_DIAG diagnostics classify dangling edges by provenance: oblique union had cut=3/orig=36 across A/B, i.e. adjacent fragments trimmed the same original seam/cap arc differently
- CB4 fixes: original-edge canonical split via OrigEdgePlan/build_original_run_segments keyed by body+edge index; cross-branch global event clustering with unified loop vertex positions (cluster_branch_events/compute_loop_positions); duplicate dangling edge merge + compact rebuild (repair_duplicate_dangling_edges, 2 edges repaired)
- results: oblique union dangling 39->15, watertightness 0.44->0.741; box-cylinder union/difference unchanged and still valid/watertight/dangling0 with accurate volumes (1125.669654 / 874.336316)
- WP-B: coincident analytic face detection in CB4 (4/6 side patches each) and union rule keeping only side A for ON fragments on coincident pairs (unit test); coaxial still falls back explicitly because ON fragments are on caps (upstream CB2/CB3)
- tests: test_curved_boolean_assemble 19/19 EXIT 0 (13 PASS + 2 gated SKIP); CBRA subset 48; version 1.0.433; report 493
- CB1 (WP-C): build_cut_graph now clips intersection branches to the intersection of both faces' trim domains; exact curves use a signed intrusion field plus 60-step bisection and closed-form fractional-parameter evaluation, giving machine-precision boundary events (oblique residual 1.4e-15, 20 endpoints cluster into 12 pairs, identical across face pairs); degenerate/zero-length run guards added
- CB2 (WP-D): coincident-rim filtering (coaxial caps 98->1 fragment), pinch splitting (oblique quarter patches 2->3 fragments), junction merge, insert_point_on_loop tolerance and split_fragment_by_open index fixes (root cause of box zero-length cut edges)
- CB3: analytic coincident-face explanation for ON fragments (coincident_overlap, total_on_explained; ok semantics extension documented in report 495 section 7)
- CB4 (WP-E): degenerate/duplicate edge cleanup with non-manifold guard and zero-rebuild fast path, canonical near-duplicate event merging, edge reversed flag fix, assemble/validate dangling parity; pinned tests promoted to hard pass assertions (oblique pinned as topologically green but volume/membership failing)
- results: box_cyl union/diff valid/wt 1.0/dangling 0 with V=1125.663706/874.336294; coaxial union single shell valid/wt 1.0/dangling 0 V=188.495559 (analytic); oblique union topologically green (dangling 0, wt 1.0) but analytic volume 210.30 vs true 198.38 -- root cause traced to measure::exact_planar_measure Green path vs stored trim/pcurve inconsistency (planar cap area 13.73 > full circle 12.57); per-face stored-trim integral 198.39 matches Monte-Carlo truth, measure-side fix is the next work package
- tests: CBRA ctest (slow integration enabled) 61/61 pass; registered 8918
- version 1.0.434; reports 494/495/496
- CB4 assembly geometry fix (WP-F): PCurve construction collapsed 3D-arc/UV-straight curved boundaries into two-point lines, making to_mesh chord across a 90-degree arc; mesh volume was +14% and a planar cap reported area 13.73 > full circle 12.57. Fix adds curve_is_straight_3d + keep_dense make_uv_pcurve so non-collinear arcs are not collapsed, restores two-point pcurves for UV axis-aligned rectangle loops to hit vde_fast_analytic_ruled_mesh (coaxial), reorders rectangle candidate loops, resyncs reversed flags and rebuilds trim domains
- CB0 audit calibration: classify_point_mesh used tol both as Moeller-Trumbore ray epsilon and as hit filter, so widening it to the chord band broke parity. Ray epsilon is now fixed at 1e-6 and separated from the ON distance threshold (on_threshold=max(1e-4,tol)); new CurvedBooleanOptions::membership_on_tol (default 6e-2 chord band) skips boundary-band samples, while the legacy failure-shape recording baseline explicitly keeps 1e-6
- acceptance (new CurvedBooleanEntry.ObliqueCylinderEndToEndPassesAudit hard assertions): oblique union 20 faces valid/watertight 1.0/dangling 0, V=198.402137 vs Monte-Carlo truth 198.375 +/- 0.08 (+0.014%), mismatch 0; intersection 9 faces V=52.925679 (truth 52.93); difference 15 faces V=72.738299 (truth 72.73); box union/diff and coaxial union unchanged (1125.663706 / 874.336294 / 188.495559, mismatch 0)
- pinned oblique integration test promoted to hard pass assertions (volume within 1% of truth, membership mismatch <=1e-3, valid/watertight/dangling/non-manifold)
- full new-binary ctest -C Release -j8: 8958/8958 pass in 796.43 s; CBRA suite with slow fixtures 62/62
- version 1.0.435; reports 497 (WP-F) and 498 (project summary and acceptance); plan CB0-CB6 complete, A4-2 oblique union acceptance met
hm added 2 commits 2026-11-17 03:54:00 +00:00
hm added 1 commit 2026-11-17 10:52:15 +00:00
hm added 1 commit 2026-11-17 11:10:55 +00:00
hm added 1 commit 2026-11-17 11:37:26 +00:00
hm added 1 commit 2026-11-17 11:53:24 +00:00
hm added 1 commit 2026-11-17 11:53:56 +00:00
hm added 1 commit 2026-11-17 13:20:00 +00:00
hm added 1 commit 2026-11-17 13:34:37 +00:00
hm added 1 commit 2026-11-17 13:54:08 +00:00
hm added 1 commit 2026-11-17 14:14:00 +00:00
hm added 1 commit 2026-11-17 16:24:25 +00:00
find_seeds seed dedup was O(seeds^2) no-op on torus x cylinder fixtures (106M distance evals ~425 ms); skip dedup when grid spacing > dedup radius, early-exit ok(), profile counters. find_seeds 571.91->182.14 ms (-68.1%), trace 645.68->259.26 ms (-59.8%), torus cut 292/250/283->129/138/146 ms. 18 [CBRA] rows byte-identical; VERIFY_UV mismatch=0; full ctest 9119 passed 0 failed.
hm added 1 commit 2026-11-17 17:02:53 +00:00
Scale the last two model-scale-independent fixed absolute tolerances in the assembly path (crossover=100): detect_coincident_faces tol and add_fragment reid_tol. scale<=100 bitwise unchanged (guard returns base); scale>100 uses 1e-5/2e-4 relative floors. 13 resolution floors documented as intentional. 18 [CBRA] rows byte-identical; CBRA fast/slow 98/98; heal 142/142; full ctest 9121 passed 0 failed.
hm added 1 commit 2026-11-17 17:23:04 +00:00
Parameterize P5f dispatch controls: expensive-success cooldown (mode/threshold/duration env) and combined operand-sum budget (a+b faces admission), default off (behavior identical to 1.0.465). Sweep candidate C2 (takeover + 10s cooldown + budget 48) passes all gates: macro ctest 0.676, BENCH 0.707, matched-set CPU 0.9445 (1098 items, 0 failures). Adopted as opt-in only; 3 reservations documented (macro gain mainly from budget admission, bench/stress bucket regressions, 1.0.465 default macro regression). 18 [CBRA] rows byte-identical; CBRA fast/slow 98/98; full ctest 9121 passed 0 failed.
hm added 1 commit 2026-11-17 17:40:42 +00:00
Close out CBRA L stage (L1 1.0.464 find_seeds -68.1%, L2 1.0.465 CB4 R4 tolerance scaling, L3 1.0.466 P5f opt-in) with release governance: version 1.0.467, report 532, L-stage worktree archive (build/cleanup/l/, 12 files) and removal (worktree 1), merge checklist updated to 1.0.467, PR #1 final review (open/mergeable, base main@9bda9f16, branch ahead 71, 154 files +42436/-123). Full ctest 9121 passed 0 failed (735.38 s).
This branch is already included in the target branch. There is nothing to merge.
This branch is out-of-date with the base branch
View command line instructions

Checkout

From your project repository, check out a new branch and test the changes.
git fetch -u origin refs/pull/1/head:hm/smlib-brep-nurbs-align-1.0.400
git checkout hm/smlib-brep-nurbs-align-1.0.400
Sign in to join this conversation.
No Reviewers
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: hm/ViewDesignEngine#1