solidcore

Units / boolean

boolean.merge_p1 green

Layer
53
Upstream lines
993
Functions
24
Rust module
boolean::merge::p1

Status history

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

Source: crates/solidcore/src/boolean/merge/p1.rs

Upstream: source/SMLib/inc/SmMerge.h, source/SMLib/src/SmMerge.cpp

Port-plan notes

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

2026-10-30 (PR #1775, WR-586, #1781; #483 temporary Boolean transforms): opt-in Kernel::fixes.boolean_temporary_transform_statuses returns failed forward/inverse transform statuses, undoes the successful primary shift if the other fails, and attempts restoration of every survivor before returning its first error. Default C++ behavior stays unchanged. Six Rust regressions cover error propagation, undo, cleanup after Boolean failures/deletions, legacy statuses and real box round trips; three new native far-wire/face fixtures exercise nonzero shifts. PASS boolean.merge_p1 cases=251 passed=251 failed=0 deferred=0 max_rel_err=0e0 with_values=239 no_values=12 vacuous=0. Caller PASS boolean.merge_p4 cases=311 passed=308 failed=0 deferred=0 max_rel_err=0e0 with_values=308 rejected=3. 2026-10-30 (operands: built under Conventions::EDGEUSE_GRAPH, whose faces and edges the build owns under the arena identities op 5's BrepQuery::default finds them by, instead of TOPOLOGY_FIXTURE followed by crate::util::own_arena_geometry, which gave every edge curve and face surface an owner from its holder, unowned ones included): the previous GREEN below rested on those forced owners; counts to be re-measured. 2026-10-24 (claude/vertex-point): boolean_post_process puts back the owner identity of the surviving edge curve after DeleteTopologicalVertex (which runs without the caller notification identities and re-owned the joined curve under a kernel key, so the temporary transform inverse skipped it: boolean.merge_p4 far-translation). PASS boolean.merge_p1 cases=248 passed=248 failed=0 deferred=0 (Mac). GREEN (wire/merge-coincident-surfaces, 2026-10-24): FixFoundFaceCoincidence runs SmTopologyIntersector::MergeCoincidentSurfaces (boolean.topology_intersector_p3) through the manifold adapter: p1::check_face_coincidence (the all-edges-mated return) and p1::finish_face_coincidence (rbModifiedTopology from the B-reps' edge counts) wrap the merge, which ManifoldKernelAdapter::fix_face_coincidence runs on an ArenaPair (new IntersectorBrepP3, MergeIntervalBrep and ClassGeometryMut impls, loop-use and face-use handle kinds) with the retained mate store. difftest 248 cases, 248 passed, 0 deferred (main: 244 passed, 4 deferred on MergeCoincidentSurfaces); 6000 seeds: 6152/6152. Op 2 now drives the adapter (SmMerge(context) tolerances SM_EFF_ZERO_SQ and 30 degrees) and compares both operands' graphs after the call, the returned faces and both directions of the edge mates (the shim appends them; before, the other B-rep's edits and the mates were not compared). Callers of the changed path (boolean.merge_p4, boolean.api_brep, ...): no unit's numbers changed in the all-units run. Generator: op 2 also takes same-plane rectangles that overlap, are contained, enclose, touch, share edges with or miss the face; with #718 and #721 on main all pass (the touching and disjoint ones compare the B-reps, the others end in an error status both sides agree on), see plan/findings.md. Earlier history: main CI e33985411 (2026-10-23): PARTIAL boolean.merge_p1 cases=248 passed=241 failed=0 deferred=7 blocked_by=boolean.topology_intersector_p3(4),topology.brep_p5(2),topology.face_p2(1). CO-PORTED in boolean.api_brep (PR #81): SmMergeOptions (fields, ctor, defaults, copy ctor, getters/setters) -> solidcore::boolean::merge::p1::MergeOptions (crates/solidcore/src/boolean/merge/p1.rs; extend it, keep boolean/merge.rs as the split root); 24 fns; largest: SmMerge::BooleanPostProcess, SmMerge::FixFoundFaceCoincidence, sm_FindBrepRegionOfOtherFace, SmMerge::PropagateOtherSrcRegionAttribs; cycle back-edges (call into later units; stub or co-port): blend.fillet_executive_p1(1); unit-SCC #22 (220 units); 317 upstream test entry points reach this unit; PR #163: merge control, face coincidence fast path, mapped vertex copy with topology/attribute notification, cleanup and region-attribute propagation; cross-B-rep radial classification keeps operand ids separate. Difftest 248 cases (152 fixtures + 96 generated), 175 passed, 73 deferred, 0 failed, max_rel_err=0, no absolute floors. Deferred: query.brep(14), topology.brep_p1(33), topology.brep_p9(3), topology.edgeuse_p2(20), topology.face_p2(3). DeleteEdge/DeleteVertex/DeleteTopologicalVertex remain tagged back-edges; scoped translation waits for query.brep bounding boxes; intersector construction is supplied by its owner. Wired to topology.shell (PR #154): SmRegion::IsVoid in sm_EdgeBordersSolid, SmShell::IsWireShell/IsFaceuseShell in BooleanPostProcess, region propagation takes a RegionLookup for the source regions' IsVoid. The wire/face shell combine block of BooleanPostProcess is wired end to end (GetCommonVertices = the B-rep vertices with an other mate in the shared mates, as TopologyIntersector::common_vertices after PR #146; then ignored-status shell::transfer_children and shell::region_remove_shell; boolean_post_process takes &mut Kernel for the mark lock) and is unreachable today because brep_shells / brep_vertices are UNPORTED(topology.brep_p1). No UNPORTED(boolean.merge_p1) callers on main. Review fixes: SM_USE_OLDTOL vertex tolerance growth restored; face tolerance growth calls a topology.face_p3 stub with old tolerance + dist_between. GetEdges/GetShells use topology.brep_p1 stubs (including count-only queries); no arena-order stand-ins. Reuses public topology_traverser::face_edges with per-loop uniqueness, stale-vertex sanity bound and unconditional merged-domain restore. Mapped/new vertex notification identities derive from ids; new MakeShellVertex path calls the intersector Relate (boolean::topology_intersector::p1::Relations::relate_vertices, wired in PR #146; the other operand is now mutable). merge_p5 now uses shared mutable bidirectional mates and the real MergeVertex adapter. 16 directed unequal-tolerance cases pass. Independent-operand radial queries and mated face-region cases are covered; full step-off numerics remain deferred, two cross-operand wire-sector cases compare real topology. Relate wired, not certified (PR #146): Relations::relate_vertices follows MakeShellVertex. PR #183 back-edge: MergeVertex calls topology::brep::p9::make_shell_vertex with its existing arena ids and source point; VertexCopy destination identities cover vertices and vertexuses, preserving caller-owned notification state. [topology.edgeuse_p3 merged (PR #117): the step-offs of RadialSectorClassify may create UV trim curves, so radial_sector_classify_between / find_radial_sector_between take &mut Brep and the other operand as Option<&mut Brep> (None = the same B-rep, replacing the pointer-equality test), and find_brep_region_of_other_face takes both operands &mut. 248 cases, 177 pass, 0 failed, 71 deferred (topology.brep_p1 33, intersect.surface_drop_lib_p3 18, query.brep 14, topology.brep_p9 3, topology.face_p2 3); the 20 topology.edgeuse_p2 step-off deferrals now run, 2 pass and 18 defer further on SmSurface::DropCurve] UPDATE (PR #145, topology.brep_p1): GetEdges/GetShells call topology::brep::p1 (brep_shells and boolean_post_process take &mut Kernel: upstream GetShells takes SmNewMarkAndLock on the context); GetShells returns the empty list on a B-rep without regions and still stops at SmRegion::GetShells otherwise, so the 33 topology.brep_p1 cases continue to the next stub (topology.shell 26, boolean.topology_intersector_p3 4, topology.face_p2 3): 248 cases, 153 pass, 0 failed, 95 deferred (topology.shell 48, topology.edgeuse_p2 20, query.brep 14, topology.face_p2 6, boolean.topology_intersector_p3 4, topology.brep_p9 3). After topology.shell (#154) merged and topology.brep_p1's GetShells is wired to it (SmRegion::GetShells under the mark lock): 248 cases, 201 pass, 0 failed, 47 deferred (topology.edgeuse_p2 20, query.brep 14, topology.face_p2 6, boolean.topology_intersector_p3 4, topology.brep_p9 3). Rerun with PR #183 (topology.brep_p9 wired, 7da151aa): 248 cases, 203 pass, 0 failed, 45 deferred (intersect.surface_drop_lib_p3 18, query.brep 14, topology.face_p2 6, boolean.topology_intersector_p3 4, topology.brep_p2 3); the 3 former topology.brep_p9 deferrals reach MakeShellVertexTopology (topology.brep_p2), and 2 earlier topology.edgeuse_p2 step-offs now pass. Re-run in PR #149 (review 5578349117 round, merged with main through fb58ea76; topology.brep_p2's UNPORTED stubs wired): 248 cases, 206 pass, 0 fail, 42 deferred (intersect.surface_drop_lib_p3 18, query.brep 14, topology.face_p2 6, boolean.topology_intersector_p3 4); the 3 MakeShellVertexTopology deferrals pass. graph() now numbers every record in the C++ shim's walk order (Canon::of: regions, then GetEdges, then the per-kind stages), and op 3 reports the copied vertex by that number and reads its flags and attribute through its own key (plan/findings.md, topology.brep_p2). UPDATE (PR #204, topology.brep_p3; overseer decision): the shared difftest graph() / Canon::of (this unit's runner, used by others) number, compare and count only the records the walk reaches from the B-rep's roots, as the C++ export walk emits; records upstream deletes stay in the Rust arenas unlinked (topology.brep_p2's deviation) and were compared before. The unreached count is a report diagnostic (Output::diagnostics, unreached_records, never compared). Unit test graph_compares_only_reachable_records (an unlinked record leaves graph() unchanged, a still-linked extra vertex use changes it). See plan/findings.md Owner zone-tol cache (surface/owner-zone-tol): 248 cases, 212 pass, 0 fail, 36 deferred. UPDATE (PR #679): the runner's SmTemporaryBrepTransform probe applies and restores the shift through topology::brep::p5::transform. difftest 248 cases, 243 pass, 0 failed, 5 deferred (MergeCoincidentSurfaces 4, topology.face_p2 1); the 2 SmBrep::Transform deferrals pass. 2026-10-31, PR #1775 / complete #483 audit: Box failures now propagate before the temporary shift under boolean_temporary_transform_statuses; existing transform/undo precedence retained. Inventory and regressions: plan/findings/general--status-audit-483.md. Default-off flags preserve the pinned C++ behavior; no tolerance or native case waived. Validation at d54dfd462: native difftest 251 cases, 251 pass, 0 failed/deferred, 0 existing rejected; perturb SENSITIVE on every accepted case. Full 280-unit exact-base gate passed.

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
251
Stored error outcomes
12
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: boolean.topology_intersector_p1 green geom.a_object green geom.attribute green geom.extent3d green geom.object green geom.tol green geom.vector3d green intersect.point_class green topology.brep_p1 green topology.edge green topology.edgeuse_p1 green topology.face_p2 partial topology.proto_topology_p1 green topology.shell green topology.vertex green

Soft dependencies: boolean.topology_intersector_p2 green boolean.topology_intersector_p3 green curve.curve_p2 green geom.axis2_placement green geom.extent1d green geom.extent2d green query.brep green surface.surface_p1 green surface.surface_p2 partial topology.brep_p4 green topology.brep_p5 green topology.brep_p9 green topology.face_p3 green topology.face_p4 green topology.topology green

Dependents: blend.fillet_executive_p1 green blend.fillet_executive_p2 green blend.fillet_executive_p3 partial boolean.merge_p2 green boolean.merge_p4 green boolean.merge_p5 green

Soft dependents: blend.fillet_corner_p1 green blend.fillet_geom_p4 partial blend.fillet_geom_p6 green boolean.api_brep partial

Upstream functions

Upstream functionDefined atLinesRust (from the file header)
SmMergeOptions::~SmMergeOptionsSmMerge.h:1581
SmMergeOptions::GetCookieCutterSmMerge.h:1611
SmMergeOptions::GetImprintingSmMerge.h:1621
SmMergeOptions::GetBooleanPostProcessSmMerge.h:1631
SmMergeOptions::GetImprintAndClassifyFacesSmMerge.h:1641
SmMergeOptions::GetKeepOtherBrepSmMerge.h:1651
SmMerge::~SmMergeSmMerge.h:3011
SmMerge::SetBooleanPostProcessSmMerge.h:4331
SmMerge::SetCookieCutterSmMerge.h:4341
SmMerge::SetImprintingSmMerge.h:4351
SmMerge::SetKeepOtherBrepSmMerge.h:4361
SmMerge::SetClassifyFacesSmMerge.h:4371
SmMerge::GetTopologyIntersectorSmMerge.h:4581[MergeState]
SmMergeOptions::SmMergeOptionsSmMerge.cpp:3312[MergeOptions::new]
SmMerge::SmMergeSmMerge.cpp:16711[MergeState]
sm_FindBrepRegionOfOtherFaceSmMerge.cpp:186129[find_brep_region_of_other_face]
SmMerge::SetMergeOptionsSmMerge.cpp:31911[MergeState]
SmMerge::BooleanPostProcessSmMerge.cpp:827491[boolean_post_process]
SmMerge::FixFoundFaceCoincidenceSmMerge.cpp:2129146[check_face_coincidence], [finish_face_coincidence]
sm_EdgeBordersSolidSmMerge.cpp:231019[edge_borders_solid]
SmTemporaryBrepTransform::SmTemporaryBrepTransformSmMerge.cpp:234723[temporary_brep_transform], [TemporaryBrepShift], [TemporaryBrepTransform]
SmTemporaryBrepTransform::~SmTemporaryBrepTransformSmMerge.cpp:237213
SmMerge::MergeVertexSmMerge.cpp:678344[merge_vertex]
SmMerge::PropagateOtherSrcRegionAttribsSmMerge.cpp:778881[propagate_other_src_region_attribs]
Module file-header table (12 rows)
RustUpstream
[MergeOptions]SmMergeOptions (fields, Get*, SetGet*)
[MergeOptions::new]SmMergeOptions::SmMergeOptions(...)
[MergeOptions::default]SmMergeOptions() (all default arguments)
CloneSmMergeOptions(const SmMergeOptions&)
[MergeState]SmMerge(context), SetMergeOptions, setters, GetTopologyIntersector
[check_face_coincidence], [finish_face_coincidence]SmMerge::FixFoundFaceCoincidence (the checks before and after MergeCoincidentSurfaces, which the caller runs between them)
[find_brep_region_of_other_face]sm_FindBrepRegionOfOtherFace
[edge_borders_solid]sm_EdgeBordersSolid
[merge_vertex]SmMerge::MergeVertex
[boolean_post_process]SmMerge::BooleanPostProcess
[propagate_other_src_region_attribs]SmMerge::PropagateOtherSrcRegionAttribs
[temporary_brep_transform], [TemporaryBrepShift], [TemporaryBrepTransform]SmTemporaryBrepTransform (constructor/destructor)

Upstream tests reaching this unit

prog_test:my_test_surface_closest_point, prog_test:my_test_drop_point, prog_test:my_test_matrix, prog_test:my_test_reversed_line_join, SM_API_test:TestSmCreateRectangle, SM_API_test:TestSmCreateRegularPolygon