Skip to content

solidcore: close tolerant edges' gaps in brep_volume (#16735) - #16737

Open
brett19 wants to merge 48 commits into
tangency-labs:mainfrom
brett19:volume-strips-16735
Open

brett19 wants to merge 48 commits into
tangency-labs:mainfrom
brett19:volume-strips-16735

Conversation

@brett19

@brett19 brett19 commented Nov 14, 2026 •

Copy link
Copy Markdown
Collaborator

Fixes #16735. brep_volume integrated each face over its own UV trims, whose images run within the edge tolerance of the edge curve, not on it. Neighbouring faces therefore left gaps, and the volume fields leaked through them: the volume was wrong to first order in the tolerance, and wrong differently for every origin. The cut cylinder read 3.6e-4 low, and the issue_880 half chamfers up to 1.9e-3 low.

What the code does

brep_properties closes every volume-bounding face (a separating faceuse with do_volume) onto its edges' own curves and vertices. The work is in gap_closure in mass/integrator/properties.rs.

  • Strips. Along every edge use, a ruled strip runs from the trim's image P(τ) to the edge curve E(t(τ)).
    • t(τ) maps the trim's ends to the edge's ends. Between them it follows the nearest points on a 64-point grid, found by Gauss-Newton marching from one to the next, and is linear between grid points.
    • So the strip is one continuous ruled surface with an exact derivative, and it meets E end to end whatever the nearest points' accuracy.
    • It is integrated along τ by the integrator's own adaptive Gauss-Kronrod rule (the faces' error scales, split at the trim's knots and the grid). Across the strip it uses a 3-point Gauss rule, which is exact because the integrands are degree 4 in w.
    • A trim whose knots cannot be read is malformed; its error is the volume's.
  • Corners. At every loop corner, a fan of triangles from the centroid closes [trim end, edge curve end, vertex, next edge curve start, next trim start], with exact 3×3 Gauss rules.
  • Orientation. Contributions use the surface normal's orientation, times the faceuse's sign as for the face itself. The strips and fans add to the volume, the mass and the volume moments 4..8 only. The faces' own integrals change where close_loops closes an open uv loop or a face is continued (below), and those move the area and its moments too: 6 area rows move in the goldens.
  • Evaluation. The face is evaluated exactly as the integrand evaluates it (evaluate_simple_first_into with the integrand's flags).
  • Closed loops and continued surfaces (adapted from mass: close the faces' flux surface: whole-body volume is origin-independent, with a proved bound #15946 by @bherbruck). For each face it closes, brep_properties integrates the face itself, and builds its strips, the same way:
    • Closed loops. The face goes over its loops closed by close_loops/gap_segment. These are uv lines across gaps that create_oriented_trim_boundary leaves open, within its |d|² ≤ EFF_ZERO(1+|p|) test. An open loop loses the gap's shadow down to the integration's base. gap_closure closes each such line as a cone onto the corner's vertex, using OrientedTrimBoundary::edgeuses, which records the edge use of each boundary curve.

    • Continued surfaces. The face is evaluated on its surface continued past the domain its evaluation clamps to. This applies where the trims' control points leave that domain and the continuation is certified (Unclamped, trims_past, continuation_certified, BSplineSurface::continues_past_domain):

      • a plane;
      • a non-rational NURB;
      • a rational one whose weights enclosure::partials_over proves positive.

      Otherwise the face stays clamped, as upstream integrates it. continuation_certified polls cancellation once per box (at most 2^16).

    • Coverage gap: B-splines in polynomial form (BSplineSurfaceForm::Polynomial) stay clamped. evaluate_simple_first_into sends them through evaluate_simple, which clamps whatever the scope says. A polynomial-form face whose trims leave its domain is integrated clamped, as on main, and its strips are built on the same clamped evaluation. No golden or test reaches this case.

    • Known limit, documented on brep_properties and Unclamped::where_trims_may_leave: a face whose trims leave its domain but whose continuation is not certified stays clamped, as upstream integrates it. That covers a rational surface whose weights are not proved positive, a polynomial-form B-spline, and a kind with no B-spline part. Such a face keeps the clamped integration's first-order, origin-dependent error, and no bound is computed or reported. Refusing would turn a read-only measurement that works today into an error. No test pins this: no fixture reaches it.

    • The scope sets and restores both flags on their own. An out-of-bounds flag that is already on no longer skips the continuation (test: a_nurb_trimmed_past_its_knots_with_out_of_bounds_on_is_integrated_unclamped).

    • The strip correspondence's nearest-point solve no longer returns its guess silently. Before, that could map a whole strip onto one edge point. An evaluation error or a missing derivative is now a typed error. A zero or non-finite derivative at an iterate means a parametric singularity, as at the end of fork_cd47efd's sqrt(s) rib edge. The strip builder then solves again from the grid point's share of the edge interval, and refuses with SolidError::Mass if that seed is singular too. A plain refusal on the first singular seed broke fork_cd47efd's valid volume.

    • The closure matches each boundary curve to its side by the edge use create_oriented_trim_boundary records for it, not by position in the loop; a curve of no edge use of the loop is an error.

    • Public face_properties is unchanged.

e9: what was not closed (MEASURED)

stubs4-degenerate-brepForFillet2-e9-r0.5 moved 2.9e-4 for a shift of 100 in z. Every face's integral matched its trims' line integral, and every face's strips matched the edge path less the trims, except face 4. Face 4 is a B-spline wall whose trim runs 3.3e-6 past u = 1. With clamping, that trim's image is the domain edge's point, but its derivative is the edge's partials. So the face's Green integral and the strip along that trim integrate different curves, and the strips came out 2.9e-6 short in z. On the continued surface, the shift moves the volume by 9.7e-9, against an allowance of 1.48e-4. Its uv loops were closed exactly: close_loops alone left e9 bit-identical.

Folded from #15946:

  • close_loops;
  • the Unclamped scope;
  • its tests: the open cube ±1e-6, the plane cut short of its trims, the NURB trimmed past its knots, the 2907c hull, and the 1476 shell's origin independence (issue_16735_trims_past_domain.rs, issue_1476_volume_is_origin_independent).

Not folded:

Why it is right

  • Closed surface (ARGUED, construction): each face's strips share their edge curve exactly with the other faces of that edge, traversed the other way. The corner fans share the vertex and the curve ends. So faces + strips + corners form a closed surface, and the divergence theorem makes every volume integral that of the region it bounds. The result is independent of the origin up to quadrature.
  • Tube figure (ARGUED and diagnostic only: its widths are sampled, not certified, so it is no bound): the region differs from any solid whose faces are these faces outside the tubes by at most Σ π w_e² L_e + Σ 4/3 π r_v³, with w each strip's width along its own correspondence and r each fan's reach from its vertex; the tolerance version Σ π tol² L + Σ 4/3 π tol³ holds where w ≤ tol and r ≤ tol. The test harness measures w and r (volume_leak::leak: the closure's own grid, 8 samples per segment, a stated 1.1× margin for peaks between samples). Before, the error was O(tol·L).
  • Why the edge curve, not a strip between the two faces' trims (ARGUED): a strip from P_A to P_B needs a pairing of the two faces' trims and a rule at vertices where three or more faces meet. Non-manifold edges have no single pair at all. The edge curve and the vertex are the one reference every face of an edge or vertex shares, so each face closes itself independently.
  • Bounded work: a 64-point grid per edge use, at most 64 Gauss-Newton steps per point, the Kronrod rule's existing depth and piece caps, and cancel polling. No recursion.

Tests (fail on main; all three FAILED with the old properties.rs)

In tests/issue_880_half_arc_rim_chamfer.rs:

test asserts measured bound
issue_16735_the_original_part_is_its_closed_form |V − 250√5π| ≤ tolerance volume + 1e-10·V (PROVEN closed form; the accuracy term is the integrator's requested accuracy, not certified) −1.3e-11 (main: −3.6e-4) 3.4e-8 + 1.8e-7
issue_16735_the_volume_does_not_depend_on_the_origin volume and first moments (moved to the world origin) agree across origins (0,0,0), (0,0,−100), (37,−20,55), for the original and both flag-off half chamfers (MEASURED margins) volume ≤ 1.9e-8, moments ≤ 8.5e-7 1e-10·V (9×), 50e-10·V (10×)
issue_16735_the_half_chamfers_match_their_definitions vs #16726's definition volumes 1743.4242016449 / 1741.1795726555 definition build +1.5e-7 / +1.2e-7; flag-off −4.9e-5 / −1.4e-4 (main: −3.8e-4/−2.4e-4 and −1.7e-3/−1.9e-3) definition build: tolerance volume + 1e-7 (2.4×, 3.3×); flag-off: d·A from #16653's test (MEASURED there)

Moved results: the evidence

The harness (tests/support/volume_leak.rs). For a volume that moved from old to new, the gate is:

  • it reproduces: brep_volume gives new to 1e-9;
  • the move is within the old integrator's leak bound, Σ g·L·max|z − o_z| over edge uses (g the trim-to-edge gap at the closure's grid; peaks between grid points and corner holes are not counted, so the bound is low and the gate strict), plus twice the quadrature's own share;
  • the volume is origin-free: shifts of (0, 0, 100) and (−37, 20, −55) move it by less than 1e-9·(V + 100·A).

The tube bounds, widest strip and farthest fan are reported, not gated. difference_moved_by_the_old_leak applies the same gate to a removed volume (before − after), each body's own leak counted.

Step 1 (round pegs, kernel rig). main's peg volumes equal the rig's; each of the four moves (2e-4 to 7e-4) is within its body's old leak bound and origin-free (MEASURED, gist https://gist.github.com/brett19/5740cf69bdcc24d0c4299aa4b40f6a4a). The rig's records stay as measured; the grader takes CLOSED_GAP_VOLUMES per case and checks each move on the result body (4/4 pass). The d2 chamfer case (known failing, solidcraft#13755) moved 3.3e-6; its 0.077 is the distance from the rig's value, unchanged.

corpus.parity (issue_16735_volume_moves_are_the_old_leak, #[ignore], about 8 min; run with cargo test --profile goldens -p solidcore --test issue_16735_volume_moves_are_the_old_leak -- --ignored): the 116 moved files, read and round-tripped, 232/232 pass, with topology and status unchanged on every row.

The 41 pinned tests. Each moved pin now holds:

  • a closed form computed in the test where one exists: issue_453 (round and chamfer, the capi's exact integrals by Simpson, bodies within 3e-10), issue_2364 plate and notched block (SolidCraft 5158 and 1080's derivations, reproduced to 2.5e-10; bodies within 1.2e-11 and 5.8e-12 relative), issue_3012 (the sliver 300 dx less the derived end pieces, to 1e-8), fork_4a58f3d (1.85e-7 of its closed form, plus the 5e-10 pin), issue_1453, issue_1058/1061 (exact conservation);
  • otherwise the new value, with the move checked on the body by the harness: fork_eb883ad (8), fork_smlib104, issue_1442, issue_1480, issue_1795, issue_1950 (4), issue_2176/2223 rim, issue_2358 (4), issue_2364 round ending, wr300, wr512, wr579, wr603, wr685 (5), wr697 (3), wr_578, wr_593. These pins are MEASURED: there is no closed form, and the harness's old-leak bound is a sampled estimate (gaps at the closure's grid), not an enclosure. So a pin can be off by up to that estimate without a test failing. wr300's (5, 1) and (5, 2) laws are among them, and the test says so in its comment;
  • ARGUED only, no body in scope: issue_2431 (now 1e-11 from Joint origins can't follow an edge or a corner of a face #2403's three-together), the ops split cup (rig 1.3e-9 below).

No tolerance is loosened; several are tightened (1e-9 → 1e-10 for the closed forms, issue_3012's volume to 1e-8).

Goldens. issue_16735_golden_mass_moves (--ignored) was run with ISSUE_16735_INVENTORY set to every value that differs from main: 2230 values in 261 fillet cases. Each moved body passed four gates:

  • it reproduces its run (worst_reload 0);
  • its inventory values match the old and new integrators (worst_inventory 0);
  • every component moved within its old leak bound, an absolute bound per component, so near-zero moments are judged by it;
  • it is origin-free (worst 4.4e-12 of scale).

boolean.api_brep and offset.offset_executive_p2 keep 063387b's expectations. After fadb9fa:

  • 43 fillet rows are re-blessed (1bd5b86).
  • The 7 rows the first run left unblessed are blessed in the second expectations commit:
    • Rows: 6 area moves (sphere_diff_3cylinders e1/e4 r0.1/r0.5, 2.4e-4 and 2.0e-4 of 3.8e4; corner_box-edge13, 1.1e-7; issue-880 rim-0 setbacks 1-2, 2.2e-9; fillet1v shell, 3.7e-6) and fillet1v's shell volume (4.14e-5, past the strips' leak bound of 3.34e-5).
    • Cause: every move comes from close_loops, not from the continued surface. These faces' trim boundaries leave sub-1e-6 uv gaps open (5 to 11 per face). The old integral lost each gap's region down to the integration base, which is a second leak of the old integrator. The continuation acts on these faces only at rounding level.
    • Cross-check per face and per row (MEASURED; not a proof, and not committed): a local probe computes each inserted line's Green term ∫ F(u,v(u)) du, with F(u,v) = ∫_{v0}^{v} J dv, by composite 8-point Gauss-Legendre with 512 panels in v (its error estimate is the 256→512 change) and 8 points along the line, instead of the integrator's iso-line Runge-Kutta. It is not independent of the change: it evaluates the surface with the same evaluator, and it takes its lines from the same close_loops gap rule (|d|² ≤ EFF_ZERO(1+|p|) on create_oriented_trim_boundary's curves). It is close to shadow_pieces in issue_16735_golden_mass_moves.rs, which the harness does commit and gate on.
      • Area moves: for all 6 area rows, the Green terms equal the brep_properties area moves, new − old at accuracy 1e-12. The differences are ≤ 4.6e-12, within the probe's quadrature estimate (≤ 1.6e-11) plus the faces' 1e-12 accuracy (MEASURED).
      • fillet1v volume: its face-16 shadow carries −1.1001040e-5 of the volume (Green −1.1001040e-5, MEASURED). The remaining move is −3.04e-5.
    • fillet1v shell volume. Choice: bless the new value. Evidence: the remaining −3.04e-5 lies within the strips' old-leak bound of 3.34e-5 (91% of it). Measured-only: that bound. It is built from strip widths sampled on the closure's 65-point grid and from the shadows' sampled boxes (shadow_pieces, 65 samples per iso-line, padded by the largest step), so a gap peaking between samples is not counted. A proven bound needs an enclosure of |P(τ) − E(t(τ))| along each strip, which neither the closure nor the harness computes yet. This is acceptable because the move has the old leak's sign and size, and the closure's volume is origin-independent. A maintainer may prefer to hold the row until a certified width bound exists.
    • Harness fix: issue_16735_golden_mass_moves now counts these shadows (shadow_pieces: area Σ|F||du| and the box of the iso-u lines from v0) in every component's bound. For the area, a shadow's own area bounds its move. Re-run results: see the commit message.

Pins after the fold-in:

  • fork_eb883ad (8): re-pinned bit-exact, each move checked on the body by the old-leak gate.
  • wr685 2→50: re-pinned at 1.8e-9 relative, the fork's figure still checked within the old leak bound.
  • issue_1476 with SolidCraft's fixes: re-pinned at 1299.4830955384534. mass: close the faces' flux surface: whole-body volume is origin-independent, with a proved bound #15946's pin 1299.4830955384505 agrees to 2e-15, but that cross-check is only partly independent: this PR adapts mass: close the faces' flux surface: whole-body volume is origin-independent, with a proved bound #15946's close_loops and continuation, so the two share those mechanisms. The stronger witness is issue_1476_volume_is_origin_independent (issue_16735_trims_past_domain.rs): the volume does not move with the origin, which a leaking boundary would.
  • wr_407_default_join_loses_the_folded_cover: new witness. The old +7744 mm³ was the clamped integration of wall A's top, whose trims run 1.7 in v past the B-spline's knot domain. So it was never a valid witness. The test now asserts the defect directly:
    • a fix = false trim lies more than 1.5 past its surface's domain (PROVEN: a sampled point past the domain is a lower bound);
    • with the fix, every trim lies inside its domain ± 1e-9, checked on the control points (PROVEN: read homogeneous, each weight > 0, each point x w / w inside the box; positive weights put the curve in its control points' convex hull; NaN fails);
    • |V(fix = false) − V(fix = true)| ≤ the two bodies' tolerance volumes, each Σ_f A_f·tol_f + Σ_e π tol_e² L_e + Σ_v 4/3 π tol_v³ from the body's own stored tolerances. This replaces the underived 1 mm³ allowance. The figures are computed from the bodies; the premise (a face within tolerance moves the volume by at most area × tolerance to first order, and the closure stays in the edges' tubes) is ARGUED. Per face rather than area × the body's largest tolerance: fix = false has one edge at tolerance 2.34 (the merged cover's), so the max-tolerance form gives 9.2e4 mm³, which is vacuous. Measured: fix = false 223932.72433165, fix = true 223932.72434839, difference 1.67e-5 against 3.25e3 + 0.40 (MEASURED). The old clamped 7744 mm³ would fail this bound.
    • The fix = true closed-form check (wr_407_walls_join_to_the_closed_form_with_the_fix, 1 mm³, unchanged from main) stays.
  • wr_450, fix = false (commit 21aa203, at review): without analytic_copy_keeps_parameterization the box-minus-rational-cylinder result is invalid by the test's own check (ValidatePointers fails, BREP 59 and 82; edge tolerances up to 0.78 cover trims pointing off their edges). Its volume is now held to the closed form within the body's tolerance volume, the same bound as wr_407 (volume_leak::tolerance_volume, moved into the shared support file; computed from the body's own faces, edges, vertices and stored tolerances): |8502.7837 − 8492.5793| = 10.20 ≤ 57.70 (MEASURED; premise ARGUED as for wr_407). The fix = true 1e-6 closed-form check, the invalidity, the worst edge tolerance and the exact check failures stay asserted.
  • Pre-existing failure: issue_1476 …with_solidcraft_fixes_and_edges_on_analytics_exact (ignored) fails on origin/main b0a5b08 too, with volume 1299.48231 vs its pin and 16 lines vs 18 asserted. On this branch only the volume pin is updated; the line count fails as on main. Nothing is filed yet.

Choices made, and their evidence

A maintainer is welcome to propose an alternative for any of these if one is warranted.

  • blend.fillet_executive_p3 stubs4-degenerate-brepForFillet2-e5-r0.5, mass_properties[0], the area (combined with main's solidcore: chamfers and rounds build at near-straight arc-to-spline corners again (#13911) #17022/solidcore: fillet removal failures carry typed causes: refusals classed 130 and 131, the rest StageFailed (#15019) #17163 fillet changes, merge 3b9503a). Choice: keep the blessed value, 1440.251651995584 (main: 1440.2516519941298; move 1.454e-9, 1.0e-12 relative, 1000x inside the goldens' 1e-9 check).
    • Evidence (cause class): the closure's strips and fans add volume flux only. The area is the faces' own area, so it can move only by the shadows of open uv gaps that the faces are now integrated across, plus the adaptive quadrature running on the closed loops' cells instead of the open ones. The shadows are sampled at 6.96e-14 for this row. The quadrature is the same adaptive rule at the record's requested accuracy, 1e-4 relative (0.144 here). The move is 1e-8 of that.
    • Measured-only: both parts. The shadow areas are sampled, and the quadrature error is the rule's own estimate, not an enclosure. issue_16735_golden_mass_moves gates the other 70 combined values. This one exceeds its allowance (6.96e-14 + 1.440e-9) by 1%, because that allowance's floor is a fixed NOISE = 1e-12 of the area: a stated quadrature share, not a bound derived for the body. Its exceedance by 1e-14 relative therefore indicates no defect. This is acceptable because the move is 1e-12 relative, the quadrature's own order, and no construction step of this PR touches face area.
    • Why no certificate: an area enclosure is not available in the crate. mass::enclosure certifies the volume flux, whose integrand is polynomial in the surface's partials, with Taylor models. The area integrand |S_u x S_v| is a square root and needs its own enclosure (a lower bound on the norm on each cell). That is a separate piece of work and is not attempted here. Separately, the harness notes a sampled gap 7.97 times its edge tolerance in main's new fillet body (face 7, edge 16); that comes from main's geometry, not from this PR.
  • blend_crossing, a_round_ending_at_a_crease_is_not_refused_over_rounds_it_never_reaches (Fillet: a round that stops at a crease is no longer refused as overlapping rounds it never reaches (#16729) #16856's pin; its own commit). Choice: re-pin at 4183.7694497031225 ± 1e-8 (the issue's 4183.769446 ± 2e-6 was measured with the leaking integrator; the new value is 3.70e-6 above it). Evidence: still gated here are the closed forms of before, A and C (1e-9), the sum A B C = A + B C − before (1e-9), origin independence (spread 5.2e-9 against 1.8e-4), and the topology and face-kind counts. Measured-only: the pin itself (B and C's corner patch has no closed form) and the old-leak figure (3.90e-5, gaps sampled, printed only), which the 3.7e-6 move lies inside. This is acceptable because the closed-form and origin gates fix everything but the corner patch, and no enclosure of the trim-to-edge width exists yet.
  • blend_overflow_first, the_fuzz_round_near_a_focal_distance_builds_within_its_budget (solidcore: a G^n section certificate has a work budget of halvings and refuses past it as not certified (#14846) #14832's pin; commit e5c03db). Choice: re-pin the input body b27's volume at 5,577.325341277863 (1e-9; was 5,577.325354466 with the leaking integrator). Evidence: origin independence (spread 9.5e-8 against 2.6e-4), and volume_leak::assert_moved_by_the_old_leak on the body: the 1.32e-5 move is inside the old-leak figure, 1.70e-4 + 3.6e-6. Measured-only: that figure (sampled gaps). This is acceptable because the pin only checks that the fuzz round receives the expected input body, and the round's own checks are unchanged.
Units: mass.integrator
In scope: brep_properties' volume and volume moments over tolerant edges (gap_closure: strips and corner fans onto the edge curves and vertices); tests on the cut cylinder (250 sqrt(5) pi), origin independence, the issue_880 half chamfers against #16726's values; the volume_leak harness and the moved pins
Expected edits: solidcore/crates/solidcore/src/mass/integrator/properties.rs, solidcore/crates/solidcore/tests/ (issue_880, issue_16735, support/volume_leak.rs, the moved pins), solidcore/crates/solidcore-ops/tests (kernel_cases, issue_3012, blend_overflow_first), solidcore-ops/src/split/tests.rs, goldens expected (final commit)
Evidence: sections above
Related PRs / dependencies: #16726 (reference volumes), #16653, #16725
Status / blockers / next step: merged origin/main. The two goldens files were regenerated on the merged tree: only mass values differ from main, and all 1298 fillet_executive_p3 values that differ pass issue_16735_golden_mass_moves with old = main. CodeRabbit's 10 comments are handled in one commit. issue_16735_golden_mass_moves was re-run with its stricter checks on the current tree: it passes, with all 1298 inventory rows gated and none left unchecked. blend_crossing's #16856 pin is re-pinned at the new value (MEASURED), with origin independence asserted; the choice is under "Choices made". Ready: catch-up merge eb43bd931, head e5c03db59; catch-up gate passed except blend_overflow_first, which passes 3/3 after the re-pin.

Merged main (#14102, #16931; merge eb43bd9, head e5c03db). Only the goldens of blend.fillet_executive_p3 and boolean.api_brep conflicted. This PR's 4 golden units were re-blessed on the merged tree from main's files. Against main, every row that moves (by the goldens' 1e-9 check) is this PR's own move, 181 rows, except one row where the two combine: issue_2176_tabbed_plate_tab_top_r0_5. There #14102 moved the product of inertia by −4.3e-12 (its tabbed-plate scalar), and the merged row is that plus this PR's mass move. 13 boolean.api_brep rows that this PR re-blessed below the 1e-9 check keep main's lines. Main's other 32 golden units pass unchanged. One combined test: main's #14832 added the_fuzz_round_near_a_focal_distance_builds_within_its_budget, which pins the input body at 5,577.325354466 (old integrator). With the gaps closed it reads 5,577.325341277863. It is re-pinned at the same 1e-9 tolerance and gated by volume_leak::assert_moved_by_the_old_leak on the body. The move is 1.32e-5, within the old leak bound of 1.70e-4 + 3.6e-6, with origin spread 9.5e-8 (allowance 2.6e-4).

Gate (catch-up, server2, merge eb43bd9): core fmt, clippy, panic sites, wasm; craft fmt, clippy, wasm; intersection tests (solidcraft-kernel, ui-egui, goldens, 44 solidcore targets); and 34 golden units all pass. solidcore-ops failed one test, the fuzz round's input pin above. After e5c03db the whole blend_overflow_first passes (3/3) and clippy -p solidcore-ops --all-targets -D warnings is clean.

Merged main again (c7b230a: #17099, #17101, #16653, #16954, #17061, #16997; 3b9503a: #17205, #17163, #16443, #17022, #17136 and others; ae5610c: #16964, #16445, #17483, #17045; 0003798: #16963, #17326, #17013, #16290, #16908 and others). Main's retired flags stay retired; none is referenced here. c7b230a: the only conflict was issue_880_half_arc_rim_chamfer.rs, where both sides appended tests, and both are kept. 3b9503a: the only conflict was blend.fillet_executive_p3.jsonl. All 283 golden units were re-blessed on the merged tree and committed as produced. Against main, every moved row in this PR's 4 units is this PR's own row, unchanged (boolean.api_brep 12, corpus.parity 50, offset.offset_executive_p2 1, fillet_executive_p3 114), except 5 fillet_executive_p3 rows that combine with main. The two law-box10x20x30-e0-deg2-edge-map-{reversed,sub-range} rows are separable: main moved result_geometry, this PR mass_properties, which equal this PR's pre-merge values exactly. The three stubs4-degenerate-brepForFillet2-e{5,7,9}-r0.5 rows had their mass moved by main and are moved again by the closure. issue_16735_golden_mass_moves, run with main's values as old, gates the 60 combined values. All pass except e5's area (see "Choices made"). Merge ae5610c (#16964, #16445, #17483, #17045): the conflicts were in the goldens of blend.fillet_executive_p3 and boolean.api_brep, re-blessed on the merged tree and committed as produced. 4 more rows combine with main: big-radius-box_diff_cyl_big_rad-r28-edge12 (main now builds it), issue_2020_mitred_put_back_d9_full, real-box-high-corner-setback-zero-control and issue2177_crescent_on_top_of_rim_measured. The same harness, with main's values as old, gates all 36 of their moved values, and all pass. Merge 0003798 (#16963, #17326, #17013, #16290, #16908 and others) had two conflicts. In wr512_singular_start_inside_direction.rs, #17326 retired ssi_singular_start_inside_direction: main's flag-free tests are kept with this PR's closed-volume assertion, and the flag-off refusal test goes with the flag. blend.fillet_executive_p3 was re-blessed in full and committed as produced. 6 law rows that main moved (#17013) are moved again by the closure, and the harness gates all 71 of their moved values (all pass). Two of them, law-cube20-e0-deg2-smooth-{4-2-4,g2}, also differ from main's golden in result_geometry, by 2.6e-10 relative. A build of main at 2225309 gives the merged tree's geometry bit for bit, so main's committed rows are stale (within the 1e-9 check) and this PR does not move that geometry.

Gate (catch-up): at c7b230a, all 13 steps pass (core fmt, clippy, panic sites, wasm; craft fmt, clippy, wasm; intersection tests solidcraft-cli, solidcraft-engine, goldens, solidcore, solidcore-ops; 34 golden units). At 3b9503a, all 13 steps pass (core fmt, clippy, panic sites, wasm; craft fmt, clippy, wasm; intersection tests solidcraft-io, goldens, solidcore, solidcore-convert, solidcore-ops; golden units). At ae5610c, all 11 steps pass (core fmt, clippy, panic sites, wasm; craft fmt, clippy, wasm; intersection tests goldens, solidcore, solidcore-ops; 34 golden units). At 0003798 (the pushed head), all 12 steps pass (core fmt, clippy, panic sites, wasm; craft fmt, clippy, wasm; intersection tests solidcraft-engine, goldens, solidcore, solidcore-ops; golden units). wr512_singular_start_inside_direction passes on the merged tree (2/2). Main has since gained #16998 and others, which merge cleanly.

Review fix (head 21aa203, test-only): wr_450_box_minus_rational_cylinder and wr_407_swept_arc_walls_join_without_fold pass (goldens profile); cargo fmt --check and clippy -p solidcore --all-targets -D warnings are clean. No library code changed, so no goldens or rig re-run.

Merged main again (311397f: #17429 and others; goldens 7f52f37). The only conflict was the issue1517_tube_ends_union_measured row in boolean.api_brep.jsonl, which #17429 also moves; the file was re-blessed on the merged tree and committed as blessed. This PR's other rows are unchanged. Against main: issue1517_tube_ends_union_measured and issue2177_crescent_on_top_of_rim_measured no longer move (the merged tree gives main's values). issue383_seed4_box_intersection_tangent_torus keeps this PR's volume, and issue_16735_golden_mass_moves with main as old passes it (leak ratio 0.24, origin spread 7.0e-13). Its measures[7], one face's area, moves 2.57e-12 (112.49071884178262 to 112.49071884178005, 2.3e-14 relative). That is MEASURED only, as for the area rows above: it is the area quadrature running on the closed loops' cells after #17429's trims, and it is eight orders inside the unit's AREA_ACCURACY (1e-4) and the goldens' 1e-9 check. The harness does not gate face-area measures.

Merged main again (f4f4d88: #17362, #17522 and others). issue_865_whole_offset_of_holed_plate's clear-hole test (#17522) keeps main's 8 volumes as its reference and gates each move with assert_moved_by_the_old_leak, as this PR's other re-pinned volume tests do (af84742). All pass: the largest move is 3.04 against an old leak bound of 13.4, with an origin spread of at most 1.0e-6.

Merged main again (22f4b7c, main 707d066: #17453, #17507 and others), with #17362's exact box in the harness (101dfe9) and the combined bless (fbec9a8). #17362 makes brep_mass_properties integrate about the exact box's middle, so the harness's old path now takes the box each measure takes (exact for mass, loose for brep_volume). Before this change its "old" was the loose-box value, not main's, which is where the 906 failures came from (big-radius-box r28 volume: harness 1496769.2382982, main 1496769.2514803, PR 1496769.2515786). With main's goldens as old, all 1068 combined mass_properties rows in 101 fillet_executive_p3 cases reproduce, and each one moves within its certified old leak bound (inventory_gated 1068, stale 0). The only failure in the run is the e5 area point above. wr_407: #17453 retired cover_refuses_folded_continuation, which leaves nothing to compare the default join against. Its trims-in-domain check stays as wr_407_default_join_keeps_its_trims_in_their_domains.

Changes a default: no
No UX default changes. The kernel result does: the volume, mass and volume moments of every solid with tolerant edges move toward the closed region (and 6 area rows move where open uv loops are now closed).

Test change: yes, moved mass expectations re-pinned to closed forms or harness-checked values, wr_450's invalid-body volume assertion moved from 1e-6 of the closed form to the body's tolerance volume (as wr_407), wr_407's witness replaced with a direct one, blend_overflow_first's fuzz-round input pin (from #14832) moved from 5,577.325354466 to 5,577.325341277863 (MEASURED; see "Choices made"), and blend_crossing's #16856 pin moved from the issue's 4183.769446 ± 2e-6 to the new 4183.7694497031225 ± 1e-8 (MEASURED; still gated there: closed forms 1e-9, sum 1e-9, origin independence, counts; the choice is under "Choices made"), plus 15 golden rows that combine with main after merging main (14 in fillet_executive_p3, 1 in boolean.api_brep; e5's area: see "Choices made"), and wr512's tests follow #17326's flag retirement.

🤖 Generated with Claude Code

https://claude.ai/code/session_01MNXLXhx1aCDM9CwvrWhzzR

Summary by CodeRabbit

  • Improvements

    • Volume and mass-property measurements are more accurate for models with small gaps along edges or trims extending beyond surface boundaries.
    • Measurements are more consistent when calculated from different origins, improving reliability across a wider range of solid models.
  • New Features

    • The golden-test command-line tool can now export measured bodies as ASCII SMB files for inspection.

@coderabbitai

coderabbitai Bot commented Nov 14, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

Important

Review skipped

Auto incremental reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

Run configuration

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • Trigger review
Walkthrough

B-rep volume integration now closes tolerant-edge gaps with contributions from edge curves and vertices. The change adds controlled surface continuation, body-dump support in the goldens runner, regression tests for volume accuracy and origin sensitivity, and updated golden measurements.

Changes: B-rep volume integration and validation

Layer / File(s) Summary
Boundary provenance and surface continuation
solidcore/crates/solidcore/src/topology/face/p1.rs, solidcore/crates/solidcore/src/nurbs/b_spline_surface/..., solidcore/crates/solidcore/src/nurbs/b_spline_surface_n_lib/p1.rs, solidcore/crates/solidcore/src/intersect/topology_solver/projected_bound.rs
Oriented trim boundaries now map curves to their source edge uses. B-spline surfaces have a continuation flag that controls whether simple evaluation clamps parameters outside the natural domain.
Closed-boundary volume integration
solidcore/crates/solidcore/src/mass/integrator/properties.rs, solidcore/crates/solidcore/src/mass/enclosure.rs
B-rep integration closes face boundaries onto edge curves and vertices. It adds signed volume and moment contributions from closure strips and corner fans.
Measured-body dump and capture
solidcore/crates/goldens/src/dump.rs, solidcore/crates/goldens/src/{jobs.rs,lib.rs,main.rs,runner.rs}, solidcore/crates/goldens/src/units/...
The goldens CLI accepts --dump-smb. The runner scopes per-case output, and measurement units submit bodies before computing mass properties. The dump module supports ASCII SMB files and in-memory B-rep copies.
Leak diagnostics and targeted regressions
solidcore/crates/solidcore/tests/support/volume_leak.rs, solidcore/crates/goldens/tests/issue_16735_*.rs, solidcore/crates/solidcore/tests/issue_16735_*.rs, solidcore/crates/solidcore/tests/issue_880_half_arc_rim_chamfer.rs, solidcore/crates/solidcore/tests/wr_407_swept_arc_walls_join_without_fold.rs, solidcore/crates/solidcore/tests/wr_450_box_minus_rational_cylinder.rs
Test support measures volume, origin spread, and prior leak bounds. Added tests cover trims past surface domains, golden-body measurements, corpus B-reps, and half-arc chamfers.
Existing volume regression updates
solidcore/crates/solidcore/tests/*.rs, solidcore/crates/solidcore/tests/kernel_cases/*, solidcore/crates/solidcore-ops/src/split/tests.rs, solidcore/crates/solidcore-ops/tests/*.rs
Existing tests use revised volume expectations, closed-form calculations, and leak-bound comparisons. Operations tests add case-specific closed-gap volume references.
Golden measurement baselines
solidcore/crates/goldens/expected/*.jsonl
Blend fixtures are added. Blend, Boolean, corpus-parity, and offset expected measurements are updated.

Estimated code review effort: 5 (Critical) | ~120 minutes

Severity of issue fixed: Medium

Merge Risk: Moderate · previous review 7188e

This change makes volume measurement close tolerant-edge gaps, so measured volumes of many bodies shift slightly toward the correct values. The continuation guard can be skipped when out-of-bounds evaluation is already enabled, and the edge nearest-point solve can silently stall, so some bodies could still report origin-dependent volumes. Several moved test pins are justified only by sampled estimates. Address these before merging; the risk is limited to volume and mass measurement accuracy and is easy to roll back.

Security architecture risk: Low · up to 7188e

Temporary evaluation settings may affect other calculations using shared geometry. Normal cleanup is protected, but isolation during overlapping calculations remains unresolved. No expansion of privileges or remotely exposed access was established.

Retained concerns

  • Low · reliability · inferred: The new continuation guard saves and restores object-level flags without serializing overlapping scopes. Evaluation copies can share lazy analytic geometry, so separate Breps do not necessarily establish independent evaluation state. Overlap on a shared base could restore another calculation's settings prematurely or leave continuation enabled afterward. Reachability through the guard's analytic helper remains partially traced; this is an inferred ownership and restoration risk, not an established exploit.
Security review details

Security Blast Radius

  • inferred — The demonstrated effects concern measured geometry and files written by an explicitly enabled local harness. Any cross-calculation effect of continuation state would follow shared geometry identity; the inspected evidence does not establish tenant-wide, service-wide, or privileged exposure.

Trust Boundaries and Controls

  • observed — The dump directory comes from command-line input, while the runner supplies unit and case identities. Character filtering is not a general filesystem sandbox: dots remain allowed and body labels are interpolated directly. No inspected caller established an untrusted source crossing into this file-writing authority.

Resilience and Maintainability Implications

  • observed — The runner catches case errors and panics, clears the dump target, and only then invokes the result callback. The broad capture regression similarly takes captured state after catch_unwind. A separate test helper uses manual capture/take pairing without unwind cleanup; that limitation is confined to the inspected test path.

Hardening Proposals

  • proposed — Make continuation mode invocation-local, or isolate the evaluated base before toggling it, so restoration does not depend on calculations over shared geometry never overlapping.
Pre-merge checks: Passed 5

Check name Status Explanation
Title check Passed The title "solidcore: close tolerant edges' gaps in brep_volume (#16735)" names the main change: brep_properties now closes volume-bounding faces onto their edge curves and vertices to fix volume erro…
Linked Issues check Passed Linked issue #16735 asks for brep_volume on tolerant solids to reach O(tol²) accuracy, or to report an error bound. The PR changes gap_closure in mass/integrator/properties.rs. Each face closes onto i…
Out of Scope Changes check Passed Changes outside properties.rs fall into three groups. (1) Support for measurement and verification: tests/support/volume_leak.rs, goldens dump tooling and the golden mass-move harness. These support t…
Description check Passed The description is thorough and follows the template. It has a title-like opening, a Change section explaining the fix for #16735 (tolerant-edge gap closure in brep_volume), a 'Changes a default: no' …
Existing Defaults Unchanged Passed The check fails only for a changed UX default (settings, preferences, command default behaviour, UI layout or behaviour, shortcuts). It excludes kernel or geometry results, including anything under so…
Full details: Title check

Explanation

The title "solidcore: close tolerant edges' gaps in brep_volume (#16735)" names the main change: brep_properties now closes volume-bounding faces onto their edge curves and vertices to fix volume error from tolerant-edge gaps. It is specific and matches the changeset and linked issue #16735. The title is a single sentence, but it uses an internal crate prefix and an issue number, which is acceptable.

Full details: Linked Issues check

Explanation

Linked issue #16735 asks for brep_volume on tolerant solids to reach O(tol²) accuracy, or to report an error bound. The PR changes gap_closure in mass/integrator/properties.rs. Each face closes onto its edge curves and vertices through ruled strips and corner fans, so neighbouring faces share the same boundary. The issue_880 tests assert the cut cylinder against 250√5π within the tolerance-volume estimate plus 1e-10·V (PR measured -1.3e-11, previously -3.6e-4). They assert origin independence (volume ≤ 1.9e-8 across three origins). They assert the half chamfers against #16726's definition volumes (definition build +1.5e-7 and +1.2e-7; previously -3.8e-4 and -2.4e-4). The e9 case origin spread falls from 2.9e-4 to 9.7e-9 (MEASURED in the PR). Limits, stated in the PR and not fully closed: (a) B-spline surfaces in polynomial form whose trims leave the domain stay clamped, and no test covers this case; (b) the error bound for moved results is MEASURED (sampled), not certified; (c) the fillet1v shell volume move of 3.04e-5 sits at 91% of a sampled old-leak bound and is a maintainer decision. The core requirement is implemented and verified by the cited tests. I did not run or inspect the tests in this assessment; the verdict relies on the PR description and the summary of changes.

Full details: Out of Scope Changes check

Explanation

Changes outside properties.rs fall into three groups. (1) Support for measurement and verification: tests/support/volume_leak.rs, goldens dump tooling and the golden mass-move harness. These support the volume tests and are listed as expected edits. (2) Consequences of the new volume values: re-pinned volume expectations in issue_880, issue_16735, fork_, issue_1442, issue_1795, issue_2364, wr_, wr685, blend_overflow_first, issue_3012, the kernel_cases peg grading, and regenerated goldens (boolean.api_brep, corpus.parity, offset_executive_p2, blend fillet_executive_p3). These are linked to the volume change. (3) Supporting code for continuation and topology: BSplineSurface continues_past_domain flag, evaluate_simple_first_into change, partials_over visibility, OrientedTrimBoundary.edgeuses. These are needed for the face integral used by the closure, as the PR states. The wr_450 assertion removal and the blend_crossing pin widening weaken existing checks. The PR flags both as maintainer decisions, and each is tied to a measured volume change, so I do not treat them as unrelated changes. I found no demonstrated change unrelated to the volume integration. I did not inspect the diff; the verdict relies on the PR description and summary.

Full details: Description check

Explanation

The description is thorough and follows the template. It has a title-like opening, a Change section explaining the fix for #16735 (tolerant-edge gap closure in brep_volume), a 'Changes a default: no' line, a 'Test change:' line with reasons for each moved expectation, and a detailed Validation section with expected and measured values. It links the issue. The template's screenshot section is not applicable because the change is kernel geometry with no UI behavior, and the author gives measured evidence instead. The description is very long and includes a lot of internal merge history, but the required sections and information are present.

Full details: Existing Defaults Unchanged

Explanation

The check fails only for a changed UX default (settings, preferences, command default behaviour, UI layout or behaviour, shortcuts). It excludes kernel or geometry results, including anything under solidcore/. Evidence from the PR summary and description: - The main code change is in solidcore/crates/solidcore/src/mass/integrator/properties.rs. It changes brep_properties volume, mass and volume-moment results for tolerant-edge solids. This is a kernel result change, and the check excludes it. - The 6 area rows that move are golden kernel outputs. They are also excluded. - The goldens CLI change (--dump-smb <dir> in main.rs, jobs.rs, runner.rs, dump.rs) is additive. It is off unless the user passes the flag. The summary says dumping is off by default. - The dump::body calls in the golden units do nothing when no dump target is active. - The summary lists no changed default setting, preference, shortcut, UI layout, or default command behaviour. - The description states Changes a default: no. The description also says "No UX default changes." Nothing in the summary contradicts this. Limit: I did not run tool calls beyond the supplied summary and description. The summary gave no sign of a UX default change. The PR's analytic_copy_keeps_parameterization and retired-flag references concern test or kernel flags, not user-facing defaults.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

brett19 and others added 2 commits November 14, 2026 15:21
… on tolerant edges

Claim commit, no changes yet.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MNXLXhx1aCDM9CwvrWhzzR
brep_properties integrated each face over its own UV trims, whose images
run within the edge tolerance of the edge curve, so neighbouring faces left
gaps and the volume fields leaked through them: the volume was wrong to
first order in the tolerance and differently for every origin (the cut
cylinder read 3.6e-4 low, the issue_880 half chamfers up to 1.9e-3).

Each volume-bounding face is now closed onto its edges' curves and
vertices: a ruled strip from the trim's image to the edge curve along every
edge use (a piecewise-linear correspondence through the nearest points, so
the strip is continuous with an exact derivative and meets the edge curve
end to end), and a fan at every loop corner through the trims' ends, the
edge curves' ends and the vertex. The faces with their strips and corners
share the edge curves and vertices exactly and bound one closed surface,
so every volume integral is that region's whatever the origin; the region
differs from the solid only inside the tolerance tubes and balls, so the
error is at most sum(pi tol^2 L) + sum(4/3 pi tol^3).

Tests (fail without the fix): the cut cylinder is 250 sqrt(5) pi to that
bound plus the requested accuracy; volumes and first moments agree across
three origins; the half chamfers match tangency-labs#16726's volumes by their
definitions.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MNXLXhx1aCDM9CwvrWhzzR
@brett19
brett19 force-pushed the volume-strips-16735 branch from 1a08940 to ede2d26 Compare November 14, 2026 14:21
brett19 and others added 2 commits November 14, 2026 16:11
…-labs#16735)

The nearest-point search bounds t by max then min, and the corner loop
pairs each edge use with the next by a cycled iterator.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MNXLXhx1aCDM9CwvrWhzzR
…olume_leak.rs)

The checks that a volume moved by the tolerant-edge closure is the old
integrator's leak: SMB loading, the volume about the bounding box middle
and its spread over two other origins, the old leak bound from sampled
trim-to-edge gaps, the tolerance-tube bound, and the worst gap over its
stored tolerance. A first harness test checks them on an exact box.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MNXLXhx1aCDM9CwvrWhzzR
@bherbruck

Copy link
Copy Markdown
Collaborator

Heads-up on an overlap. #15946 (draft, opened 2026-11-13, part of #14170) closes the same gaps in the same place: it makes the faces' flux surface closed with strips from each trim image to its edge curve plus corner pieces, so brep_volume becomes origin-independent. It also adds a proved bound on the closure (mass::closure, with mass::enclosure refactored onto it). The two PRs will conflict in mass/integrator/properties.rs and tests/issue_880_half_arc_rim_chamfer.rs.

Measured on #15946's patch (solidcore swarm, current main a71e5e0): the issue_880 half-arc rim (setbacks 1-1) reads 1741.1794325 patched vs 1741.1776985 on main, against #16726's converged quadrature 1741.1795727. That is 1.4e-4 off, against main's 1.87e-3.

One of the two should give way rather than both landing. #15946 is being re-cut onto current main now (it conflicts after 112 commits). Could you compare the two? If #16737's construction is the one to keep, we'll fold #15946's bound and tests into it, or the other way round. I'm happy to go with whichever you and jyviko prefer.

brett19 and others added 6 commits November 14, 2026 17:09
…ncy-labs#16735)

The 116 corpus.parity files whose volume moved when brep_volume began
closing tolerant edges' gaps, read and round-tripped (232 rows), each
checked by volume_leak::moved_by_the_old_leak: the new value reproduces,
the move is within the old leak bound (sum of g L max|z - o_z| over edge
uses) plus the quadrature's own share, the volume is origin-independent,
and either the new error bound with the sampled gaps is below the old one
or the move lies inside the tolerance tube. Topology and status are
unchanged on every row (checked before the harness).

The tube clause covers 30 rows whose gaps are far inside their
tolerances (worst gap / tol 0.000): there the tube's width is the larger
bound and the moves (1e-14 to 1e-9) lie inside it.

Ignored by default (heavy, needs upstream/TestFiles); run with
  cargo test --profile goldens -p solidcore \
    --test issue_16735_volume_moves_are_the_old_leak -- --ignored

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MNXLXhx1aCDM9CwvrWhzzR
Each pin that held the old integrator's leak (tangency-labs#16735) now holds the
closed form where one exists, else the new value with the move checked
by volume_leak::assert_moved_by_the_old_leak on the body (within the old
leak bound, origin-independent). No tolerance is loosened; several are
tightened.

Closed forms (the leak was the whole difference):
- issue_2364_alpha1_ends, issue_2656, ops blend_overflow_first: plate
  1681.903758348 (1.2e-11) and notched block 10198.718038816 (5.8e-12),
  1e-9 -> 1e-10
- issue_453: round 6382.568731366 and chamfer 6316.944424728 (3e-10),
  1e-8 -> 1e-9 absolute
- fork_4a58f3d: removed volume 1.85e-7 from its closed form (fork 1.8e-6)
- issue_1453: 1.1e-12 from the closed form
- issue_1058 / issue_1061: union + intersection and the marched rim are
  now exact (1.8e-10, -2.7e-14); the asserted shortfall was the leak
- issue_3012 (ops): the sliver is 300 dx exactly (the outline less its
  translate); the "5 dx^2 missing" was the caps' trims. Volume held to
  the closed form within 0.02 dx^2 + 1e-8; the area check takes the
  caps' measured face areas instead of V / h.

New values, harness-checked on the body: fork_eb883ad (8),
fork_smlib104, issue_1442, issue_1795, issue_2176/2223 rim, issue_2364
round ending (in turn and together now agree to 2.8e-12), wr300 (2),
wr512 (both C++ figures within the leak bound of one closed-gap value),
wr579, wr603, wr685 (5), wr697 (3), wr_578, wr_593.

New values without a body in scope (ARGUED: same family, topology
unchanged): issue_1480 union, issue_1950 (4; wr_578's body is one of
them), issue_2358 (3), issue_2431 (2403's three-together, now 1e-11
apart), ops split cup (rig 1.3e-9 below).

Kernel rig references: the four round pegs' rig volumes and d2's
known_failing message take the new values (step 1 showed each move
within the old leak bound and origin-free).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MNXLXhx1aCDM9CwvrWhzzR
…16735)

gap_closure took the trim's knots with unwrap_or_default, so a trim
whose knots cannot be read (a B-spline without its NURB, Curve::knots'
only error) closed its strip on the grid alone. Such a trim is
malformed: its error is now the volume's, as every other evaluation
error in the closure is.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MNXLXhx1aCDM9CwvrWhzzR
…y-labs#16735)

Review of tangency-labs#16737: the tube bound assumed every strip segment and fan
point within tolerance without checking it.

- Strip widths are now measured along the closure's own correspondence
  t(tau) (properties::nearest_on_edge's grid of 64 nearest points,
  linear between, mirrored step for step), sampled at 8 points per grid
  segment with a stated 1.1x margin for peaks between samples.
- Corner fans: the trim end images and edge ends are measured against
  their vertices; the bound takes max(reach, tolerance).
- old_bound is documented as low (peaks between grid points and corner
  holes are not counted), so the gate it makes is strict.
- The origin spread shifts z (0, 0, 100) instead of x: the integrand is
  z n_z, so an x shift tested nothing.
- The gate is reproduces + within the old leak bound + origin-free. The
  tube clause is reported, not gated; the tube bound is labelled ARGUED.
- difference_moved_by_the_old_leak: the same gate for a removed volume
  (before - after), each body's own leak bound counted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MNXLXhx1aCDM9CwvrWhzzR
Review of tangency-labs#16737 (0d2ed6d's claim "none loosened" was wrong for two
sites; fixed here):

- fork_4a58f3d: the 5e-10 pin is back, on the new value, beside the
  closed-form check.
- issue_3012: the volume is the derived closed form, the sliver's
  section 30 dx less the two end pieces the body cuts off under the
  translated fillets (dx^3 / 12 each, ARGUED from the measured cut),
  held to the 1e-8 the volume is asked for (residuals -2.3e-9, -2.3e-9,
  -2.0e-9 MEASURED); the fitted 0.02 dx^2 is gone. The caps are that
  closed-form section, not face_area; the area routine's caps over
  their trims are dx^2 / 2 short each (MEASURED, not derived: the same
  class of defect the volume had), so the area is checked as the faces
  less 20 dx less dx^2 at the old tolerance.
- issue_2364 plate and notched block: the closed forms are computed in
  the test from SolidCraft's derivations (5158, 1080 expected.method),
  reproducing 1681.903758348255 and 10198.718038815705. The 3.1e-7
  discrepancy was the capped figure, a fork measurement with its leak,
  not a closed form. Held to 1e-10 relative.
- issue_453: the closed forms are computed in the test (the capi's
  exact integrals, Simpson at 800 spans, Richardson error ~4e-11 and
  8e-11); the bodies agree to 3e-10 and 1.5e-10, so the end rib's share
  is below that (MEASURED, not derived).
- Body checks for the ARGUED sites: issue_1950 (4, assert_moved on each
  shelled body), issue_2358 (4, the removed volume's move within both
  bodies' old leak bounds), issue_1480 (the union). issue_2176's rim
  and wr603 now check the difference the same way instead of assuming
  the part before the blend unmoved.
- Kernel rig: the four pegs' rig records are restored as measured. The
  rig grader takes CLOSED_GAP_VOLUMES per case instead, and checks each
  move from the rig's value on the result body with
  volume_leak::moved_by_the_old_leak. d2's known-failing line moved
  3.3e-6 (9383.373309486477 -> 9383.373306185718); 0.077 is its
  distance from the rig's value, unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MNXLXhx1aCDM9CwvrWhzzR
Maintainer decision. Without analytic_copy_keeps_parameterization the
box-minus-rational-cylinder result is invalid by this same test's own
check (ValidatePointers fails, BREP 59 and 82): the split faces' copies
are reparameterised, their trims point up to 0.78 off their edges, and
the edges carry tolerances up to that to cover it.

Such a body's volume is defined only up to its tolerance tubes, sum
pi tol^2 L + sum 4/3 pi tol^3, which measures 57.7 here (about 7e-3 of
V = 8492.58, the closed form). The old integrator took the trims and
landed on the closed form; the closure onto the edges gives 8502.78
(1.2e-3 over), inside the tube. Neither is derivable to the 1e-6 the
test asserted, so that one assertion is dropped for fix = false only.
The fix = true volume (closed form to 1e-6), the invalidity, the worst
edge tolerance and the exact check failures are all still asserted.
No flag changes (tangency-labs#15956 kept this flag back with evidence).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MNXLXhx1aCDM9CwvrWhzzR
brett19 and others added 4 commits November 14, 2026 18:42
- volume_leak: WIDTH_MARGIN is labelled ARGUED, no bound derived; it
  feeds only the informational tube figures.
- volume_leak: difference_moved_by_the_old_leak reproduces the removed
  volume to 1e-9 of itself (plus a 1e-14 rounding floor on the larger
  body), not to 1e-9 of the larger body.
- issue_453: the closed forms' Simpson rule at 10^4 spans (2000 for the
  round's inner integral), its error about 1e-12; the 1e-9 each body is
  held to is labelled MEASURED (the end rib's term), not a closed-form
  bound.
- issue_3012: the area check's trims shortfall links tangency-labs#16854.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MNXLXhx1aCDM9CwvrWhzzR
…bs#16735)

`goldens --dump-smb <dir>` writes every body a runner measures, just before the measure,
to `<dir>/<unit>/<case>.<label>.<n>.smb` (ASCII, as the kernel rig's KERNEL_CASES_SMB), so
a test can load the bodies the goldens measured. `goldens::dump::capture` keeps exact
in-memory copies (`clone_standing_for_self`) of the same bodies for a test that runs the
cases itself. Off by default: a run without either produces exactly what it did before.
`--jobs` forwards the flag to its children.

The hooks: blend.fillet_executive_p3's mass record (`mass`) and fillet-then-shell record
(`shell_mass`), boolean.api_brep's and offset.offset_executive_p2's `brep_volume`
(`volume`).

An .smb file is not always the measured body exactly (MEASURED on these units: 66 of 307
measured bodies read back to the bit-identical record, the rest within 1e-12 of the scale
but one, sweep5-letter_g-e1-r1.0, whose area reads back 2.2e-7 off), which `goldens::dump`'s docs say; the capture is exact.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MNXLXhx1aCDM9CwvrWhzzR
…tegrator's leak

goldens/tests/issue_16735_golden_mass_moves.rs runs blend.fillet_executive_p3,
boolean.api_brep and offset.offset_executive_p2 in process with goldens::dump's capture,
and for every measured body (exact copies):
- new: the runner's own call reproduces the case's output (to 1e-12 of the component's
  scale);
- old: the pre-tangency-labs#16735 brep_properties (the same face_properties calls, no gap_closure)
  through estimate's post-processing; the golden row (topology, statuses, every other value)
  matches the output with old or with new values;
- the leak bound per mass-record component: every volume integral is the flux of
  F_c = e_z int_{m_z}^z f_c dzeta (f_c: 1 for volume and mass, (x_a - c_a)/V' for the
  centroid, y^2+z^2 ... for the inertia and yz ... for the products about 0), so
  |new - old| <= sum over the closure's pieces (strips between sampled trim points and edge
  nearest points, corner polygons) of area * sup|F_c| (gaps sampled: MEASURED), plus a
  1e-12 noise floor;
- origin independence at accuracy 1e-10, per component within 1e-9 (1 + A |o - m| / V)
  of its scale, about m, 0 and m + diag (0.37, -0.21, 0.55);
- reported only: the gaps and corner points against the stored tolerances and the tube
  bound.
With ISSUE_16735_INVENTORY (the PR's [unit, case, field, old, new] diff) every row is gated
against its component's bound and checked against the recomputed values.

#[ignore]d (it re-runs three golden units, ~8 min optimised): run with
cargo test --profile goldens -p goldens --test issue_16735_golden_mass_moves -- --ignored

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MNXLXhx1aCDM9CwvrWhzzR
…ectations)

The single expectations commit of tangency-labs#16735: goldens/expected only, blessed on af2c260
(identical to an independent bless of the same head). Rows moved (cases / values; cases
beyond the goldens' 1e-9 in brackets):
- blend.fillet_executive_p3: 261 / 2,317 [106]: mass_properties [1..11] (volume, mass,
  centroid, inertia and products about 0; the area [0] does not move) and 4 cases'
  shell_mass_properties [1..2].
- boolean.api_brep: 25 / 27 [12]: measures[1] (brep_volume) and two cases' measures
  blocks (their sums carry the volume).
- offset.offset_executive_p2: 1 / 1 [1]: volumes[1].
- corpus.parity: 115 / 232 [50]: volume, rt_volume.

Proof (MEASURED gaps, bound derived per component):
- the first three units: goldens/tests/issue_16735_golden_mass_moves.rs. On exact copies of
  every measured body, each moved value is reproduced and within its component's old leak
  bound (the closure's flux, |new - old| <= sum area * sup|F_c|), and the golden rows
  otherwise match. 2,353 of the 2,356 diff rows are gated by key as well; the other 3 are
  the blocks sums of issue1059_grazing_bar_union_alpha-1.0_beta30 (its volume moved 4e-16
  relative, checked on its body) and issue1036's measures[3] (an area, stale as below).
- corpus.parity: solidcore/tests/issue_16735_volume_moves_are_the_old_leak.rs (piece A).

Not blessed: blend.fillet_executive_p3 stubs4-degenerate-brepForFillet2-e9-r0.5 keeps its
old line. Its moves are within the old leak bound (9% of it), but its new volume is not
origin-free: 4.1e-5 (1.5x the allowance) between origins at accuracy 1e-10 and 1e-12 alike,
so not quadrature; the old integrator's spread there is 1.0e-4 to 1.4e-4.

boolean.api_brep issue1036_coincident_skins_intersection_measured: its old golden is stale
(blessed before a change that moved it within the goldens' 1e-9); today's old integrator
gives the new value to 5e-12, so its move (and measures[3]'s, an area the closure never
touches) is the refresh of a stale golden, not the closure's.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MNXLXhx1aCDM9CwvrWhzzR
@brett19

brett19 commented Nov 14, 2026

Copy link
Copy Markdown
Collaborator Author

Thanks for pointing out #15946. We compared the two, read-only, and ran one small test. Here is what we found and what we're doing.

What each does

Where #15946 is ahead
On stubs4-degenerate-brepForFillet2-e9-r0.5, #16737 leaves all 12 mass values bit-identical to main and its volume is not origin-free (4.1e-5 spread). #15946 moves that row by +1.4e-4. That points at uv-loop gaps that create_oriented_trim_boundary leaves open (|d|² ≤ EFF_ZERO(1+|p|)), or at trims past the domain, rather than edge gaps.

Same result
On your half-arc rim case, #16737 reads 1741.1794288. You measured #15946 at 1741.1794325. The two agree within 4e-6, and both remaining errors are the chamfer's fit to its definition.

Plan
#16737 keeps its edge-strip construction and folds in from #15946, with credit in the commits:

  • close_loops/gap_segment;
  • the out-of-domain continuation, or a certified refusal where it can't continue;
  • your open_cube, past-the-domain, NURB-past-knots, 2907c hull and 1476 shell tests;
  • your proved bound on what remains open, reported beside ours. Ours is relabelled ARGUED, because its widths are sampled.

If that doesn't make e9 origin-free, #15946 is the better base, and we'll say so here and give way.

Written by Claude Code (Anthropic) on behalf of @brett19.

brett19 and others added 4 commits November 14, 2026 21:56
…omain (tangency-labs#16735)

stubs4-degenerate-brepForFillet2-e9-r0.5 was not origin-free: a shift of 100 in z
moved its volume by 2.9e-4. Measured per face, every face's integral matched its
trims' line integral, and every face's strips matched the edge path less the trims,
except face 4. That B-spline wall's trim runs 3.3e-6 past u = 1. With clamping, the
trim's image there is the domain edge's point but its derivative is the edge's
partials, so the face's Green integral and the strip along that trim integrate
different curves. The strips came out 2.9e-6 short in z.

Adapted from tangency-labs#15946 by @bherbruck:
- close_loops / gap_segment: brep_properties integrates each face it closes over
  its loops closed with uv lines where create_oriented_trim_boundary leaves a gap
  within its |d|^2 <= EFF_ZERO (1 + |p|) test. gap_closure closes those lines as
  cones onto the corner's vertex (the edge-use record of each boundary curve,
  OrientedTrimBoundary::edgeuses).
- Unclamped / trims_past / continuation_certified: brep_properties integrates the
  face, and gap_closure builds its strips, on the surface continued past the domain
  its evaluation clamps to. This applies where the trims' control points leave that
  domain and the continuation is certified (a plane or a non-rational NURB; a
  rational one whose weights enclosure::partials_over proves positive). Otherwise
  it stays clamped. BSplineSurface::continues_past_domain is the scope's flag.
- face_properties itself is unchanged (upstream's clamped, open-loop integral).

e9: the shift of 100 in z now moves the volume by 9.7e-9 (was 2.9e-4); the
origin_allowance is 1.48e-4. The volume moves 3616.232796 -> 3616.232732.
Tests: issue_16735_e9_wall_past_its_domain (goldens, the exact captured body);
issue_16735_trims_past_domain (tangency-labs#15946's open cube +/-1e-6, plane cut short of its
trims, NURB trimmed past its knots, 2907c hull about six origins);
issue_1476_volume_is_origin_independent. The tube figures are relabelled
diagnostic: their widths are sampled.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MNXLXhx1aCDM9CwvrWhzzR
…ectations)

blend.fillet_executive_p3: 43 of the 50 rows fadb9fa moves past the goldens'
tolerance are re-blessed, and the bless rewrites the sub-tolerance last bits of the
others. Proof per row (MEASURED, issue_16735_golden_mass_moves, --ignored, with
ISSUE_16735_INVENTORY = every value of this file that differs from main 9f4b446,
2230 values in 261 cases):
- reproduces: each captured body measures the case's output exactly (worst_reload 0);
- every inventory value is the old integrator's (main's) and the new one's, to the
  noise floor (worst_inventory 0);
- every moved component is within its old leak bound, sum over the strips and fans of
  area x sup|F_c| plus the 1e-12 floor of the component's scale (an absolute bound,
  so the near-zero moments are judged by it, not by their relative move: bottle
  m[9] -8.28e-8 -> -9.28e-8, e9 m[10]);
- every body is origin-free: worst 4.4e-12 of its scale about three origins.
Not blessed (their 063387b rows are kept, so goldens fails on them):
- 6 rows move the area (mass_properties[0] / shell_mass_properties[0]), whose leak
  bound is 0: stubs4-delete-edge-sphere_diff_3cylinders-e1/e4-r0.1/r0.5 (2.4e-4 /
  2.0e-4 of 3.8e4), source-file-corner_box-edge13 (1.1e-7 of 364),
  issue-880-half-arc-rim-0-setbacks-1-2 (2.2e-9 of 845),
  real-box-fillet1v-r3-shell-closed (3.7e-6 of 3516). brep_properties now integrates
  each face, area included, over its closed loops on its continued surface.
- real-box-fillet1v-r3-shell-closed's volume moves 4.14e-5, past its strips' old leak
  bound of 3.34e-5. The bound does not count the clamped integration's own error.
boolean.api_brep, offset.offset_executive_p2 and corpus.parity are unchanged.

Pins (moved by fadb9fa; none loosened):
- fork_eb883ad_keep_features: 8 bit-exact pins re-pinned bit-exact on the new values.
  Each move from its pre-tangency-labs#16735 figure passes assert_moved_by_the_old_leak on the
  body (cylinder boss r8 3.40e-5 vs bound 3.86e-4, hole r8 4.75e-5 vs 5.79e-4, cone
  boss 3.40e-5 vs 3.86e-4, pit 6.12e-5 vs 3.80e-4, lean 19 3.96e-5 vs 4.45e-4,
  origin spreads <= 2.3e-8 against allowances of 5.3e-4). The prism boss and pocket
  and the r 1.9 hole are back on their pre-tangency-labs#16735 figures exactly.
- wr685 2 -> 50: 4693.608885930817 -> 4693.608894404652 (1.8e-9 rel). There is no
  closed form; the test still checks the fork's figure against it within the old
  leak bound on the body.
- issue_1476 with SolidCraft's fixes: 1299.482314966473 -> 1299.4830955384534.
  Cross-validated by tangency-labs#15946's independent pin of the same case, 1299.4830955384505
  (2.2e-15 relative). Its edges_on_analytics_exact variant still fails on a line
  count (16 vs 18), which no changed code path reaches.

Test change: yes. 43 fillet golden rows re-blessed with the per-row proof above; 7 rows
not blessed (reported); 8 eb883ad pins, wr685's 2 -> 50 pin and the two issue_1476
pins re-pinned on proven moves (bit-exact stays bit-exact, no tolerance loosened).
wr_407_default_join_loses_the_folded_cover is not changed (see the PR).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MNXLXhx1aCDM9CwvrWhzzR
…ncy-labs#16735)

The loop's next curve is `get(i + 1)` or the first, not `(i + 1) % n`; the pending gap
lines are taken with `mem::take`, not `drain(..)` (check_panic_sites). The eb883ad
cylinder pins are formatted as rustfmt lays them out. No result changes.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MNXLXhx1aCDM9CwvrWhzzR
…ness (expectations)

The 7 fillet rows 1bd5b86 left unblessed are blessed here, each with proof.
- Cause: all their moves come from close_loops, not from the continued surface.
  Their faces' trim boundaries leave sub-1e-6 uv gaps open, 5 to 11 per face (the
  continuation acts there only at rounding level). The old integral ran iso-u lines
  from the base v0, so it lost each gap's region down to v0: a second leak of the old
  integrator, which the closure-strip bound did not count.
- Independent check per face (a probe, not committed): each inserted line's Green term
  int F(u, v(u)) du, with F = int_{v0}^{v} J dv by composite 8-point Gauss-Legendre
  (512 panels; the error is the 256 -> 512 change) and 8 points along the line, against
  brep_properties' new - old face integral at accuracy 1e-12:
    sphere_diff_3cylinders-e1-r0.1  area 2.382280876e-4 vs 2.382280884e-4 (err 7.0e-12)
    sphere_diff_3cylinders-e4-r0.1  area 1.979153266e-4 vs 1.979153220e-4 (err 1.6e-11)
    sphere_diff_3cylinders-e1-r0.5  area 2.382281032e-4 vs 2.382281043e-4 (err 7.0e-12)
    sphere_diff_3cylinders-e4-r0.5  area 1.979153172e-4 vs 1.979153149e-4 (err 1.6e-11)
    source-file-corner_box-edge13   area 1.145026971e-7 vs 1.145026911e-7
    issue-880-half-arc-rim-0-setbacks-1-2  area 2.16784235e-9 vs 2.16786593e-9
    real-box-fillet1v-r3-shell-closed  area 3.6670537682e-6 vs 3.6670537065e-6;
      volume shadow -1.1001040e-5 (Green -1.1001040e-5), leaving -3.04e-5 of its
      -4.14e-5 move to the strips, within their bound of 3.34e-5.
  The magnitudes agree within the Green quadrature error plus the faces' 1e-12
  accuracy (MEASURED).
- issue_16735_golden_mass_moves counts the shadows in every component's bound
  (`shadow_pieces`: area sum |F| |du|; box of the iso-u lines from v0, padded). For the
  area, a shadow's own area bounds its move. Re-run with ISSUE_16735_INVENTORY (2230
  values vs main 9f4b446, all gated):
  - blend.fillet_executive_p3: 294 bodies, worst_reload 0, worst_inventory 0, worst
    origin 4.4e-12 of scale, 0 failures;
  - boolean.api_brep: worst leak ratio now 0.52 (was 16.5);
  - offset.offset_executive_p2: unchanged.

wr_407_default_join_loses_the_folded_cover: the +7744 mm3 it asserted was the clamped
integration of wall A's top, whose trims run 1.7 in v past the B-spline's knot domain,
so it was never a valid witness. It now asserts:
- the defect directly: a fix = false trim lies more than 1.5 past its surface's domain
  (a sampled point proves the lower bound);
- the contrast: with the fix, no trim leaves its domain by more than 1e-9;
- the volume: within 1 mm3 of the closed form, the bound the fix's own test uses for the
  radial faces' approximation (MEASURED 1.6e-5).

Test change: yes. 7 more fillet golden rows are blessed (all 50 now), with the
independent per-face proof above. The goldens harness's bound gains the open gaps'
shadows, with a proof of the term. wr_407's fix = false test replaces its
clamped-volume witness with a direct assertion of the defect (trims past the domain,
contrasted with the fix) and a closed-form volume check. This strengthens it: the old
assertion measured an integration artifact.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MNXLXhx1aCDM9CwvrWhzzR
brett19 and others added 3 commits November 15, 2026 01:05
…; wr_407 derived witness (tangency-labs#16735)

Delta-review fixes:
- gap_closure takes each boundary curve's side by the edge use
  create_oriented_trim_boundary records for it, not by its position in the
  loop; a curve of no edge use of its loop is an error.
- continuation_certified polls cancellation once per box (at most 2^16).
- wr_407_default_join_loses_the_folded_cover: the underived 1 mm3 allowance
  becomes the two bodies' tolerance volumes (sum A_f tol_f + sum pi tol_e^2 L_e
  + sum 4/3 pi tol_v^3, from their stored tolerances): |V(fix=false) -
  V(fix=true)| = 1.67e-5 against 3.25e3 + 0.40. The fix = true domain check
  reads the trims' control points (homogeneous, w > 0, inside the domain
  +- 1e-9) instead of 257 samples per trim. The stale "7744 mm3 too large"
  header line is gone.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MNXLXhx1aCDM9CwvrWhzzR
…by partial_cmp (tangency-labs#16735)

gap_closure keeps each loop's sides as Option and takes the edge use's side
from its slot (a second curve of the same edge use finds it gone and is an
error), so no panic-prone Vec::swap_remove; a side left in its slot is an
edge use the boundary lost, as before. The wr_407 test's weight check uses
partial_cmp (clippy neg_cmp_op_on_partial_ord); NaN still fails it.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MNXLXhx1aCDM9CwvrWhzzR
Conflicts in the goldens of blend.fillet_executive_p3 and corpus.parity were
resolved by regenerating both units on the merged tree (`goldens --bless` of the
two units, starting from main's files), not by picking either side.

Against main's files only mass values differ: no topology, status or error
entry moves, and no row goes to 1001.
- blend.fillet_executive_p3: 1298 values in 119 rows differ from main. 95 rows
  are this PR's moves exactly as on the branch. 2 (brepForFillet2 e5/e9) equal the
  branch's within 6e-16. 22 are rows main moved since the old base (tangency-labs#16961's
  corner3x2/stubs3 setbacks, the sphere_diff_3cylinders bodies), with this PR's
  closure acting on main's new bodies. All 1298 values pass
  issue_16735_golden_mass_moves with that inventory (old = main, new = merged):
  each within its component's old leak bound, the old integrator reproducing
  main's value and the new one the merged value (worst 3.8e-16).
- corpus.parity: 50 rows differ from main, all volume and rt_volume. Each equals
  the branch's value within 6.6e-10 relative (inside the goldens' 1e-9).
  sphere_diff_3cylinders is the one main also moved: merged 169499.15077 against
  the branch's 169499.15079.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01MNXLXhx1aCDM9CwvrWhzzR
@bherbruck bherbruck added the ready to merge reviewed, every ask addressed; merge once CI is green label Nov 15, 2026
@brett19

brett19 commented Nov 15, 2026

Copy link
Copy Markdown
Collaborator Author

The merge of main is done locally and its catch-up gate is running now. I'll comment again once it's pushed.

Written by Claude Code (Anthropic) on behalf of @brett19.

brett19 and others added 2 commits November 15, 2026 22:23
…-labs#17483, tangency-labs#17045) into volume-strips-16735

Conflicts only in the goldens of blend.fillet_executive_p3 and
boolean.api_brep. Main's retired flags are not referenced on this branch.
All 283 golden units were re-blessed on the merged tree and the result is
committed as produced. Against main, every moved row in this PR's 4 units is
this PR's own row, unchanged, except 4 rows that main moved and the closure
moves again: big-radius-box_diff_cyl_big_rad-r28-edge12 (main now builds
it), issue_2020_mitred_put_back_d9_full, real-box-high-corner-setback-zero-
control and issue2177_crescent_on_top_of_rim_measured. issue_16735_golden_
mass_moves, with main's values as old, gates all 36 moved values of these 4
rows, and all pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SdcgEtsWyH5fjgiavRsRdt
…-labs#17013, tangency-labs#16290, tangency-labs#16908 and others) into volume-strips-16735

Conflicts:
- wr512_singular_start_inside_direction.rs: tangency-labs#17326 retired
  ssi_singular_start_inside_direction. Main's flag-free tests are kept, with
  this PR's closed-volume assertion (BOTH_ROUNDS_CLOSED, C++ figures within
  the old leak bound). The flag-off refusal test and its helper go with the
  flag.
- blend.fillet_executive_p3.jsonl: all 283 golden units were re-blessed on
  the merged tree and committed as produced. Against main, every moved row
  in this PR's 4 units is this PR's own row, unchanged, except 6 law rows
  that main moved (tangency-labs#17013) and the closure moves again.
  issue_16735_golden_mass_moves, with main's values as old, gates all 71 of
  their moved values, and all pass. Two of them,
  law-cube20-e0-deg2-smooth-{4-2-4,g2}, also differ from main's golden in
  result_geometry by 2.6e-10 relative. A build of main (2225309) gives the
  merged tree's geometry bit for bit, so main's committed rows are stale
  (within the 1e-9 check) and this PR does not move the geometry.

Main's retired flags are not referenced on this branch.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SdcgEtsWyH5fjgiavRsRdt
@brett19

brett19 commented Nov 15, 2026

Copy link
Copy Markdown
Collaborator Author

Merged main and pushed 0003798 (plain merges; four catch-ups as main moved: c7b230a, 3b9503a, ae5610c, 0003798). Catch-up gates pass on each.

  • Goldens were re-blessed on each merged tree and committed exactly as the bless produced them. Against main, every moved row in this PR's 4 units is this PR's own row, unchanged, except 15 rows that combine with main's fillet and boolean changes (listed in the body). issue_16735_golden_mass_moves, run with main's values as old, gates their moved values: all pass except one.
  • That one is stubs4-degenerate-brepForFillet2-e5-r0.5 mass_properties[0] (the area). It moves 1.454e-9 (1e-12 relative) from main's value, just over the harness's fixed 1e-12 noise floor (1.440e-9). No certified area enclosure exists, so it is under "Needs maintainer decision" with both numbers and how the floor is set.
  • Two law-cube20 rows also differ from main's golden in geometry, by 2.6e-10 relative. A build of main gives the same geometry bit for bit, so main's committed rows are stale and this PR does not move them.
  • wr512: solidcore: retire dupin_bottom_hyperbola_axis, ssi_singular_start_inside_direction, drop_curve_v_domain_degeneracy #17326 retired its flag. Main's flag-free tests are kept, with this PR's closed-volume assertion.

Written by Claude Code (Anthropic) on behalf of @brett19.

@bherbruck
bherbruck added this pull request to the merge queue Nov 16, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Nov 16, 2026
@bherbruck bherbruck removed the ready to merge reviewed, every ask addressed; merge once CI is green label Nov 16, 2026
@bherbruck

Copy link
Copy Markdown
Collaborator

I've taken this out of the merge queue: merged with current main, it doesn't compile: crates/solidcore/tests/issue_1476_swept_bar_shell.rs: error[E0425]: cannot find function, tuple struct or tuple variant ObjectKey in this scope, and that failed the batches behind it (run). Please merge main and fix that; then it can go back in.

brett19 and others added 2 commits November 16, 2026 02:10
…opped from issue_1476_swept_bar_shell.rs

The origin-independence test this PR adds builds PropertyAttributes with
key_of returning ObjectKey(0); main's merge narrowed the file's import to
AttributeStore only, so the test target did not compile.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SdcgEtsWyH5fjgiavRsRdt
@brett19

brett19 commented Nov 16, 2026

Copy link
Copy Markdown
Collaborator Author

Merged current main (20bbdfb) and fixed the compile error in 7df5712. The cause: main's #17064 narrowed issue_1476_swept_bar_shell.rs's import to AttributeStore only, while this PR's new issue_1476_volume_is_origin_independent test still builds PropertyAttributes { key_of: &|_| ObjectKey(0), .. }. PropertyAttributes::key_of on main still returns ObjectKey, so restoring the import follows main's API. cargo fmt --check and cargo check -p solidcore -p goldens --tests pass on the merged tree. CI is verifying it now.

Written by Claude Code (Anthropic) on behalf of @brett19.

@bherbruck bherbruck added the ready to merge reviewed, every ask addressed; merge once CI is green label Nov 16, 2026
brett19 and others added 8 commits November 16, 2026 02:45
# Conflicts:
#	solidcore/crates/goldens/expected/blend.fillet_executive_p3.jsonl
#	solidcore/crates/solidcore/tests/wr_593_nx1_tangent_corner_edge.rs
…6735)

main's tangency-labs#16880 added fillets/16654-fillet-tube-joint-across-a-chamfer-crease-r1,
whose rig volume 112506.83949124035 was measured with the old integrator.
With tolerant edges' gaps closed the result body measures
112506.83897489308 (5.2e-4 below, 4.6e-9 relative). It joins
CLOSED_GAP_VOLUMES: the rig record stays as measured, the case is graded on
its volume now, and moved_from_the_rig checks the move within the old
leak's bound on the result body.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SdcgEtsWyH5fjgiavRsRdt
# Conflicts:
#	solidcore/crates/solidcore/tests/issue_1476_swept_bar_shell.rs
#	solidcore/crates/solidcore/tests/issue_1950_shell_analytic_edges_face_owned.rs
moved_from_the_rig wrote the result body to SMB and read it back with
Kernel::default(). Case 16654's round is kept as its definition
(fillet_round_as_definition, in the rig's fixes), so it writes a
procedural blend surface, which the default reader refuses, and the
unwrap in volume_leak::read_smb panicked. The check now builds its kernel
with session::fixes(), the case thread's own. 16654: moved 5.163e-4,
within the old leak bound 8.368e-3, origin-free. The four pegs still pass.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SdcgEtsWyH5fjgiavRsRdt
# Conflicts:
#	solidcore/crates/solidcore/tests/wr_407_swept_arc_walls_join_without_fold.rs
… past-domain claim

With main's queries passing their statuses on (tangency-labs#16957), the default join's
cover no longer leaves its B-spline's knot domain (the farthest sampled
trim point lies inside), so the PR's "trims run about 1.7 past the domain"
check no longer describes the body. main's level-2 "NonMonotonic CPts"
check stays as the fold's witness. The PR's other checks still hold: with
the fix every trim lies inside its domain, and the two joins' volumes agree
within their tolerance volumes (both 223932.7243484, 0.40 slack).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SdcgEtsWyH5fjgiavRsRdt
goldens --all --bless on the merged tree (main 5d3d908). The catch-up row
check against the PR's proven set: 189 rows moved vs main. Of those, 7 are
combined rows, where main also moved the row and the merged value differs:
corner3x2-union-overhang-corner-edges6-12/6-13-r1,
stubs3-union-overhang-corner-edges14-22/15-22-r1,
stubs3-union-overhang-front-edges14-22-r1,
law-box10x20x30-e0-deg1-edge-map-degenerate and
boolean.api_brep/issue1517_tube_ends_union_measured. Four of the PR's
earlier moves are absent: issue_2020_mitred_put_back_d9_full,
law-cube20-e0/e7-deg3-asymmetric and real-box-high-corner-setback-zero-control
keep main's values. Committed exactly as blessed. The combined rows' mass
moves are checked by issue_16735_golden_mass_moves (PR body).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SdcgEtsWyH5fjgiavRsRdt
@brett19

brett19 commented Nov 16, 2026

Copy link
Copy Markdown
Collaborator Author

Caught up with main again. The head is now dbd56e9, and CI is running.

  • Rig case 16654 (added by Fillet: a round along a tube's joint that crosses a chamfer's edge builds at small radii, instead of being refused as too large (#16654) #16880; its rig volume was measured with the old integrator). It now moves 5.163e-4 (4.6e-9 relative) because the gaps are closed. It joins CLOSED_GAP_VOLUMES (902b70a). The panic was moved_from_the_rig reading the SMB back with Kernel::default(): the round is kept as its definition (fillet_round_as_definition, in the rig's fixes), so it writes a procedural blend surface that the default reader refuses. The check now uses the case's session fixes (9136157). Result: moved 5.163e-4, within the old leak bound of 8.368e-3, origin spread 6.5e-8 against an allowance of 1.4e-3. The four peg cases still pass.

  • wr_407 conflicted with solidcore: retire query_statuses_pass_on (queries pass on the statuses SMLib drops) #16957 (99c04ef). With the queries' statuses passed on, the default join's cover no longer leaves its knot domain. I kept main's level-2 "NonMonotonic CPts" check as the fold's witness and dropped this PR's past-domain check. The PR's other checks hold: with the fix every trim lies inside its domain, and the two joins' volumes agree within their tolerance volumes.

  • Goldens (684b268) are committed exactly as goldens --all --bless wrote them on the merged tree. The catch-up row check found 7 combined rows that main had also moved:

    • fillet_executive_p3: corner3x2-union-overhang-corner-edges6-12/6-13-r1, stubs3-union-overhang-corner-edges14-22/15-22-r1, stubs3-union-overhang-front-edges14-22-r1, and law-box10x20x30-e0-deg1-edge-map-degenerate
    • boolean.api_brep: issue1517_tube_ends_union_measured

    issue_16735_golden_mass_moves with ISSUE_16735_INVENTORY, built from the 68 mass values these rows move against main, passes on all of them. Every moved value is within its component's old leak bound and origin-free, and the recomputed old and new values agree with the inventory to within 7.4e-11. Four earlier moves of this PR now keep main's values: issue_2020_mitred_put_back_d9_full, law-cube20-e0/e7-deg3-asymmetric and real-box-high-corner-setback-zero-control.

Written by Claude Code (Anthropic) on behalf of @brett19.

brett19 and others added 2 commits November 16, 2026 05:23
Conflict only in the issue1517_tube_ends_union_measured golden row, which
tangency-labs#17429 (now on main) and this PR both move; main's side is taken here and
the row is re-blessed on the merged tree in the following expectations
commit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SdcgEtsWyH5fjgiavRsRdt
The catch-up merge took main's whole boolean.api_brep.jsonl; the bless on
the merged tree restores this PR's 11 proven rows unchanged. Against main,
issue1517_tube_ends_union_measured and issue2177_crescent_on_top_of_rim_measured
no longer move (main's tangency-labs#17429 trim fix and this PR now give main's values).
issue383_seed4_box_intersection_tangent_torus keeps this PR's volume and
moves measures[7] by 2.3e-14 relative, checked with
issue_16735_golden_mass_moves against main.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SdcgEtsWyH5fjgiavRsRdt
@brett19

brett19 commented Nov 16, 2026

Copy link
Copy Markdown
Collaborator Author

Caught up with main (#17429) at 311397f, with goldens re-blessed in 7f52f37. The only conflict was the issue1517_tube_ends_union_measured golden row, which #17429 also moves. Of the rows that combine with main, two now give main's values, and issue383_seed4_box_intersection_tangent_torus passes issue_16735_golden_mass_moves, apart from a 2.3e-14 relative face-area move that is MEASURED only (details in the body). CI is running.

Written by Claude Code (Anthropic) on behalf of @brett19.

brett19 and others added 5 commits November 16, 2026 06:16
Conflicts: the properties.rs module docs (both paragraphs kept: tangency-labs#16735's
gap closure and tangency-labs#17362's exact-box origin; the closure runs inside
brep_properties_in_box, so every request takes it) and
blend.fillet_executive_p3.jsonl, re-blessed on the merged tree in the
following expectations commit.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BUqX4Moqx5bbkSocgEbsSV
… the old leak (tangency-labs#16735)

upstream_holes_clear_of_the_sides_still_offset_unmerged (from main's
tangency-labs#17522) pinned main's volumes at 1e-9; brep_volume's gap closure moves
them. Main's values stay the reference, and each move is now gated by
volume_leak::assert_moved_by_the_old_leak at the test's accuracy 1e-6,
the check this PR's other re-pinned volume tests use (wr697, wr_407,
blend_crossing). All 8 pass (move / old leak bound; origin spread):
  hole f0 9.446e-1 / 6.832e0; 1.4e-8   hole f1 3.043e0 / 1.337e1; 5.6e-9
  tan f0 3.418e-2 / 2.020e0; 4.8e-7    tan f1 9.729e-2 / 1.810e0; 4.2e-7
  tan f2 2.012e-2 / 2.048e0; 5.0e-7    tan2 f0 1.921e-1 / 6.018e0; 1.0e-6
  tan2 f1 4.681e-1 / 4.752e0; 1.0e-6   tan2 f2 6.596e-1 / 7.515e0; 9.2e-7
The leak bound uses sampled gaps (MEASURED), as for the PR's other leak
rows. The Level 2 check, the manifold check and the inputs are unchanged.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BUqX4Moqx5bbkSocgEbsSV
…sure's own box (tangency-labs#17362)

Since tangency-labs#17362, brep_mass_properties integrates about the middle of the body's
exact box and scales each face's error by that box; brep_volume keeps the
loose box. The mass-moves harness's old path (and its origin-independence
check) still took the loose box for every kind, so its "old" no longer
reproduced main's goldens (e.g. big-radius-box r28 volume 1496769.2382982
against main's 1496769.2514803). The old path, new_raw and about_origins now
take the box the kind's measure takes, through brep_properties_in_box, and a
non-finite box fails the test instead of passing every comparison silently.

With the combined inventory (1068 mass_properties rows in 101 cases of
blend.fillet_executive_p3, old = main's goldens), every row reproduces and
moves within its certified old leak bound (inventory_gated 1068, stale 0).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BUqX4Moqx5bbkSocgEbsSV
… with tangency-labs#16735's closure (expectations)

101 lines (1068 mass_properties rows in 101 cases) combine main's exact-box
mass properties (tangency-labs#17362) with the gap closure (tangency-labs#16735). Each row's old value
is main's golden; issue_16735_golden_mass_moves reproduces it and checks
every row's move within its component's certified old leak bound: 1068/1068
pass, 0 stale. No status, count, topology or validity value changed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BUqX4Moqx5bbkSocgEbsSV
wr_407: main (tangency-labs#17453) retired cover_refuses_folded_continuation and with it the
without-fix join; the PR's comparison of the two joins has nothing left to
compare. Its surviving check, every trim of the default join inside its
surface's natural domain (to 1e-9, on its control points), stays as
wr_407_default_join_keeps_its_trims_in_their_domains.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01BUqX4Moqx5bbkSocgEbsSV

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved-for-ci Reviewed: run the full PR CI (build, tests, goldens, Clippy) ready to merge reviewed, every ask addressed; merge once CI is green

Projects

None yet

Development

Successfully merging this pull request may close these issues.

solidcore: brep_volume's error is first order in edge tolerance (3.6e-4 on a cut cylinder, 1.7e-3 on its chamfer)

2 participants