solidcore

Units / heal

heal.stitch_p2 green

Layer
50
Upstream lines
1,906
Functions
5
Rust module
heal::stitch::p2

Status history

Oct 12Nov 25
  1. todo 1,906 lines
  2. partial 1,906 lines
  3. green 1,906 lines

Source: crates/solidcore/src/heal/stitch/p2.rs

Upstream: source/SMLib/src/SmStitch.cpp

Port-plan notes

These notes preserve historical port measurements and limitations, not current CI results.

5 fns; largest: SmStitch::DoStitching, SmStitch::StitchVertexPairs, SmStitch::SplitEdgesWithVertices, SmStitch::StitchIntoSolid; unit-SCC #22 (220 units); 179 upstream test entry points reach this unit; PARTIAL (PR #205, co-port with heal.stitch_p1 #196): difftest 556 cases (540 constructed fixtures on unstitched sheets and boxes + 16 generated), 316 pass bit-identical (max_rel_err 0), 0 failed, 1 both-errored (the HANG-33 guard case: -3 on both sides, no values), 240 deferred (topology.brep_p2 119: SmBrep::Notify, first call of DoStitching; topology.brep_p5 92: GlueVertices; query.brep 15: SmBrep::CalculateBoundingBox; topology.brep_p9 14: MakeVertexSplitEdge). Passes by success path: SplitEdgesWithVertices 124 (drops and far/close outcomes, no split), one-list StitchVertexPairs 112 (86 without coincident pair, 26 with pairs evaluated but not glued) + 13 empty/null lists + 13 SM_ERR (no B-rep), StitchIntoShell 53 (loop never runs, max_tol <= 0) + 1 HANG-33 guard case (both sides -3). No passing case for DoStitching or StitchIntoSolid. Wired p1's UNPORTED(heal.stitch_p2) API stubs and offset.offset_executive_p1's two in PiecewiseMerge (probe_piecewise_empty moves on to query.brep). fuzz 2000 FUZZ-PASS (crashes 0). Upstream issues: HANG-33, HANG-24, UB-178, UB-197, WR-186, WR-187 Re-run in PR #149 (review 5578349117 round, merged with main through fb58ea76; topology.brep_p2's UNPORTED stubs wired): 556 cases, 332 pass, 0 fail, 224 deferred (query.brep 121, topology.brep_p1 92, intersect.curve_class_p2 11); 2 Notify deferrals pass, the rest relabel. UPDATE (PR #204, topology.brep_p3): the UNPORTED(topology.brep_p3) SmBrep::DeleteFace stub is wired to topology::brep::p3::delete_face through brep::p3::with_kernel_callbacks (as stitch p1's squeeze_edge_to; pOptDeletedEdgesVertices reset first, as SmBrep.cpp:7088); squeeze_edge_to calls pass the kernel. Report unchanged (556 cases, 332 pass, 0 fail, 224 deferred). UPDATE (PR #526): find_and_set_infinite_region calls topology.brep_p5 (wired to FindInfiniteRegion). 556 cases, 368 pass, 0 fail, 188 deferred; the 10 FindInfiniteRegion deferrals now stop at geom.tol SmTol::GetZoneTol3d(const SmObject*). GREEN (2026-10-23, PR #600): difftest PASS heal.stitch_p2 cases=556 passed=556 failed=0 deferred=0 max_rel_err=0e0 with_values=555 no_values=1 vacuous=0; the former 188 heal.stitch_p2 deferrals (PR #526 count, incl. 10 at geom.tol SmTol::GetZoneTol3d(const SmObject*)) no longer occur on main 38b0745b3 (the GetZoneTol3d ones likely by #541, topology solver zone tol); 1 both-errored case (HANG-33 guard, no_values=1) counts as agreement; local rerun and CI run 39935703236 agree. PARTIAL (2026-10-27, PR #1297): the runner's digest now also carries the topology (shell count, per-edge end vertices/tolerance/interval/use count, per-face loops as edge/orientation sequences); fixtures/heal.stitch_p2/coverage.json adds 283 cases (T-junction sheets with slivers, SplitEdgesWithVertices on an editable B-rep (the Split op's new editing flag, as SmMerge/SqueezeFace call it), unstitched cubes with a split face, candidate lists, squeeze, the SmBrep::StitchFaces flags on 31 Solids/*.smb files; file B-reps run their C++ op in a fresh process; Solids/fillet_ts.smb excluded, its read heals through UB-255). difftest heal.stitch_p2 cases=839 passed=826 failed=0 deferred=0 known_mismatch=13: cov_cube2/4/5 DoStitching and cov_cube_gap_at_edge_tol_nest, whose region nesting raises different edge/vertex tolerances while the same B-reps agree with nesting off (plan/findings/heal.stitch_p2--region-nesting-ray-fire-raises-other-edge-tolerances.md). GREEN (2026-10-27, PR #1306, stacked on #1297): the runner records the import's arena naming on the B-rep (Brep::use_arena_naming), so the nested glue's region split (SplitClosed -> FindAndSetInfiniteRegion -> SmShell::RayFire), which names geometry under the stitch's notification identities, resolves the curve owners instead of failing every shell ray with an internal owner-lookup error; the former known mismatches now pass and are removed. difftest heal.stitch_p2 cases=839 passed=839 failed=0 deferred=0 (plan/findings/heal.stitch_p2--region-nesting-ray-fire-raises-other-edge-tolerances--addendum-2026-10-27-resolved.md).

Goldens

This is committed inventory, not a runtime result or a correctness proof. A golden records what solidcore produced when blessed. Current results require the canonical CI gate, not these counts.

Golden records
841
Stored error outcomes
1
Stored deferrals
0
Stored harness rejections
0
Known-failure entries
0

Metadata counts describe fields in the stored records; they are not passes or live failures.

Source at f9704ee3b: golden JSONL · known-failure list.

Dependencies

Depends on: curve.curve_p2 green curve.curve_p6 green geom.extent1d green geom.extent3d green geom.object green geom.tol green geom.tree green geom.vector3d green heal.stitch_p1 green topology.brep_p1 green topology.edge green topology.face_p3 green topology.vertex green

Soft dependencies: geom.context green query.brep green topology.brep_p2 green topology.brep_p3 partial topology.brep_p5 green topology.brep_p7 green

Dependents: topology.brep_constructor green

Soft dependents: blend.fillet_executive_p3 partial boolean.merge_p2 green offset.offset_executive_p1 partial offset.offset_executive_p2 partial primitive.primitive_creation_p3 green sweep.topology_sweep green

Upstream functions

Upstream functionDefined atLinesRust (from the file header)
SmStitch::DoStitchingSmStitch.cpp:10861264[Stitch::do_stitching], [Stitching], [MinGapRequest]
SmStitch::StitchIntoSolidSmStitch.cpp:265965[stitch_into_solid]
SmStitch::StitchIntoShellSmStitch.cpp:273462[stitch_into_shell]
SmStitch::StitchVertexPairsSmStitch.cpp:2827385[Stitch::stitch_vertex_list], [VertexList]
SmStitch::SplitEdgesWithVerticesSmStitch.cpp:3777130[Stitch::split_edges_with_vertices], [SplitEdges]
Module file-header table (6 rows)
RustUpstream
[Stitch::do_stitching], [Stitching], [MinGapRequest]SmStitch::DoStitching
[stitch_into_solid]SmStitch::StitchIntoSolid (static)
[solid_stitch_start]SmStitch::StitchIntoSolid (its first lines)
[stitch_into_shell]SmStitch::StitchIntoShell (static)
[Stitch::stitch_vertex_list], [VertexList]SmStitch::StitchVertexPairs (one-list overload)
[Stitch::split_edges_with_vertices], [SplitEdges]SmStitch::SplitEdgesWithVertices

Upstream tests reaching this unit

prog_test:my_test_single_periodic_vertexuse, SM_API_test:TestSmAdvancedStitch, SM_API_test:TestSmEdgeCurveOwnership, SM_API_test:TestSmGetClosestPoint, SM_API_test:TestSmGetEdges, SM_API_test:TestSmGetFaces