solidcore

Units / boolean

boolean.topology_intersector_p1 green

Layer
50
Upstream lines
2,491
Functions
38
Rust module
boolean::topology_intersector::p1

Status history

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

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

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

Port-plan notes

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

2026-10-25 (GlueVertices of vertices of two B-reps, PR #991, GREEN; plan/findings/boolean.topology_intersector_p1--glue-vertices-of-two-breps.md): the runner adapter Two no longer stops at UNPORTED(topology.brep_p5); upstream deletes this B-rep cache, then NER(pSurvVShell) returns SM_ERR_NULL_POINTER because a region belongs to one B-rep. On the tree merged with main after #890: PASS boolean.topology_intersector_p1 cases=830 passed=830 failed=0 deferred=0 max_rel_err=0e0 with_values=827 no_values=3 vacuous=0 (was passed=829 deferred=1 blocked_by=topology.brep_p5(1)); SENSITIVE perturbed=830 detected=830 unperturbed=0; --seeds 6000: cases=6030 passed=6030 deferred=0 with_values=6000 no_values=30. 2026-10-25 (PR #890, edge tolerance in sm_ClassifyCurveSurfaceXSectPoint and the face cache in line/drop solves, on top of the SolveOperands wiring below): PARTIAL boolean.topology_intersector_p1 cases=830 passed=829 failed=0 deferred=1 blocked_by=topology.brep_p5(1) (was 826 / 4: topology.edge(2), topology.face_p2(1) pass). 2026-10-25 (wire: SolveOperands natural domains in CsiGlobalSolver / LsiGlobalSolver / SpGlobalSolver): PARTIAL boolean.topology_intersector_p1 cases=830 passed=826 failed=0 deferred=4 blocked_by=topology.brep_p5(1),topology.edge(2),topology.face_p2(1) (the 3 surface.surface_p2 GetNaturalUVDomain deferrals pass). 2026-10-25 (intersector solves reach their faces' surface caches): PARTIAL boolean.topology_intersector_p1 cases=830 passed=823 failed=0 deferred=7 blocked_by=surface.surface_p2(3),topology.brep_p5(1),topology.edge(2),topology.face_p2(1) (was 814 / 16 with topology.face_p2(15); the remaining face handle case drops a curve to a face surface inside SmSurface::DropCurve, not yet given the face's cache). 2026-10-24 (topology solver SmFace::CurveOnClassify wired): PARTIAL boolean.topology_intersector_p1 cases=830 passed=814 failed=0 deferred=16 blocked_by=topology.brep_p5(1),topology.face_p2(15) (was 811 / 19; the 3 query.face_p2 CurveOnClassify deferrals pass). main CI e33985411 (2026-10-23): PARTIAL boolean.topology_intersector_p1 cases=830 passed=810 failed=0 deferred=20 blocked_by=query.face_p2(3),topology.brep_p5(1),topology.face_p2(16). CO-PORTED in boolean.merge_p4 (PR #243): SmTopologyIntersector::m_pBToO/m_pOToB face projection -> boolean::topology_intersector::p1::Relations::faces; read-only MateMap projections plus GetMappedBrepObjects/GetCommonEdges/GetCommonVertices access are shared, as are the common-list and SetSubset implementations; no relationship algorithm duplicated. partial (PR #146, builds on #121 and #150): after the maintainer review and the swarm pre-review, difftest 827 cases (8 upstream-derived fixtures + 19 edge cases built in code + 800 generated two-B-rep scripts, each run up to its first unrunnable op), 653 pass bit-identical (max_rel_err 0), 0 fail, 174 deferred (topology.face_p2 82: SmFace::GetTolerance via SmSurface::DropPoint of a face-owned surface; topology.brep_p1 74: GetVertices/GetEdges/GetTolerance; topology.face_p4 11: SmFace::GetVertices/GetEdges; query.face_p1 7: SmFace::CalculateBoundingBox), 3 cases_both_errored (scripts cut at op 0), 32 passes compare one refused op's status only; --perturb SENSITIVE 653/653. Ops with zero passing cases: sm_IntersectShellVertices and sm_IntersectWireLaminaEdges (all reach topology.brep_p1). UNPORTED stubs: topology.brep_p1/p3/p5/p7, topology.face_p3/p4, query.face_p1; surface.surface_p8, intersect.curve_class_p4 (PR #137: the SmCurveClassification constructor, which defers on ReSet = intersect.curve_class_p2, reached by no compared case: counts unchanged), intersect.curve_class_p5 and _p6 are wired. Registered SSI curves of the script are plain B-splines (a line/conic registered there is never compared). CO-PORTED here: the two SmTopologyIntersector constructors (boolean.topology_intersector_p2) -> boolean::topology_intersector::p1::TopologyIntersector::{new, with_context}; SmTol::UpdateObjectTolerance (geom.tol) -> geom::tol::update_object_tolerance. 38 fns; largest: SmTopologyIntersector::EdgeFaceIntersect, SmTopologyIntersector::FaceFaceIntersect, SmTopologyIntersector::FixupMidPointClassMates, SmTopologyIntersector::FaceFaceCoincidence; unit-SCC #22 (220 units); hazards: ptr-hash,ptr-iter; 317 upstream test entry points reach this unit CO-PORTED in boolean.merge_p1 (PR #163): m_pBToO/m_pOToB edge/vertex storage and bidirectional lookups -> boolean::topology_intersector::p1::{MateMap,Relations}; record() checks conflicting established pairs atomically. Relate of a new merge vertex (SmMerge::MergeVertex, boolean.merge_p1) is wired to boolean::topology_intersector::p1::Relations::relate_vertices (Relate's vertex branch on Brep ids, including the SM_USE_OLDTOL tolerance propagation; merge_vertex and merge_p5's process_wires_and_shell_vertices now take the other B-rep mutably). Maintainer merge of main (PR #146): SmFace::CalculateUVDomainFromUVTrimCurves wired to topology.face_p1 (PR #148) through IntersectorBrep::face_uv_domain_from_uv_trim_curves (bLimitDomain TRUE, no gaps); every call site is still reached only after an UNPORTED query.face_p1 / topology.face_p4 call, and face_p1's CreateUVTrimCurves and Notify are wired to topology.face_p3 (PR #139). Wired face_p3 (PR #139): SmFace::FaceIntersect through the new IntersectorBrep::face_intersect (the runner's Two model implements it over topology::face::p3::face_intersect and gives the curves and classification objects its handles; CurveClassification/PointClassification::map_objects change the handle type). Upstream issue WR-102 renumbered WR-157. UPDATE (PR #145, topology.brep_p1): the UNPORTED(topology.brep_p1) SmBrep::GetEdges / GetVertices stubs are wired as IntersectorBrep::brep_edges / brep_vertices (topology::brep::p1::edges / vertices in the difftest adapter); the wire/lamina pass then reaches TopologySolver::brep_curve_solve, which reads the B-rep's cache: the difftest adapter now builds it on first use (as the C++ builds it on demand), and the build stops at SmBrep::CalculateBoundingBox (query.brep, 16; plan/findings.md): 827 cases, 690 pass, 0 failed, 137 deferred (topology.face_p2 82, topology.brep_p2 21, query.brep 16, topology.face_p4 11, query.face_p1 7; after PR #149 wired topology.brep_p2 and the face-box wiring follow-up PR #289 took the 7 query.face_p1 SmFace::CalculateBoundingBox deferrals through IntersectorBrep::face_calculate_bounding_box: 713 pass, 117 deferred, topology.face_p2 82, query.brep 18, topology.face_p4 17, the 7 deferring deeper at SmFace::GetUpwardLoopuses (6) and SmBrep::CalculateBoundingBox (1)). PR #183 back-edge wiring: mutable IntersectorBrep adapters call real p9 MakeVertexLoop and MakeVertexSplitEdge with notification state; scoped split context requires mutable Kernel. Follow-ups (PR #227): the runner and FFI refuse unknown SmPointClassificationType / SmTsectCurveType codes (no Unknown default; curve types 0..=6), and the three CalculateUVDomainFromUVTrimCurves call sites keep the face domain on SmExtent2d::Intersect's SM_ERR_INVALID_INPUT (Extent2d::intersect's InvalidInput) as upstream's == SM_SUCCESS test does, instead of reporting it as undefined behaviour (latent: unreached until topology.face_p3's CreateUVTrimCurves); the runner's new_classification passes the tolerance through SmZoneTol3d (fabs, USE_DEFAULT) like the C++ constructor, so sm_SetEdgeClass with tolerance -1e300 now agrees (main's fuzz had 3 differs); the surface encoder refuses an empty knot vector as a harness error instead of panicking (fuzz00058/00396); lesson-27 audit: stub signatures carry every upstream argument, default arguments are explicit, ignored statuses keep upstream's default outputs. --fuzz 2000: FUZZ-PASS (differs=0 crashes=0 panics=0 timeouts=0). Regression fixtures (follow-up to #227): fixtures/boolean.topology_intersector_p1/fuzz_regressions.json keeps main's 3 fuzz differs (fuzz01490/01531/01875, sm_SetEdgeClass with tolerance -1e300) as value-comparing cases: 830 cases, 693 pass, 0 failed, 137 deferred; --perturb SENSITIVE 693/693; the empty-knot-vector panics stay covered by the deterministic --fuzz seed (a runner refusal is a harness error in a normal run). UPDATE after topology.brep_p2 (PR #149): SmProtoTopologyManager's constructor fallback for an approximation tolerance below SM_EFF_ZERO (SmProtoTopology.cpp:3548-3556: GetTolerance and GetMinEdgeBBoxSize of both B-reps) is wired; the MgrNew op now passes both runner B-reps to ProtoTopologyManager::new and outputs the manager's GetTolerance (shim and runner, one value), so files_manager_zero_tol and the 9 generated approx-0 scripts that deferred at MgrNew compare the fallback value (with tol = 3*min(..) mutated in ProtoTopologyManager::new these 10 fail, and after the #145 merge so do 10 more that now reach MgrNew's output: 20 in all, gen0016/0064/0301/0412/0462/0652/0689/0702/0706/0774 besides the 10; review of d12f88e9): 827 cases, 663 pass, 0 fail, 164 deferred (topology.face_p2 82, topology.brep_p1 64, topology.face_p4 11, query.face_p1 7), with_values 660 no_values 3 (the 3 both-errored), --perturb SENSITIVE 663/663. difftest --fuzz 500 found 2 runner panics that predate this change: the B-spline surface serializer computes u.len() - 1 / v.len() - 1 on an empty knot vector (lines 402/403). Re-run after merging #145 5b1b28ae (main through e1ae2640) into #149: 827 cases, 710 pass, 0 fail, 117 deferred (topology.face_p2 82, query.brep 17, topology.face_p4 11, query.face_p1 7), with_values 707 no_values 3, --perturb SENSITIVE 710/710.; CO-PORTED in boolean.merge_p2 (PR #229): SmTopologyIntersector::Relate (edge and face branches on arena ids) -> Relations::relate_edges / relate_faces (crates/solidcore/src/boolean/topology_intersector/p1.rs) UPDATE (PR #204, topology.brep_p3): SmBrep::DeleteFace wired through the new hook IntersectorBrep::brep_delete_face (k: &mut Kernel; face_face_coincidence and imprint_body now take k: &mut Kernel; the difftest adapter Two calls topology::brep::p3::delete_face with its editing flag), still behind SmFace::GetBrep (face_p4), so no case reaches it (case-by-case identical to before): 827 cases, 663 pass, 0 failed, 164 deferred (topology.face_p2 82, topology.brep_p1 64, topology.face_p4 11, query.face_p1 7). UPDATE (PR #204, review of c7f6299b): the brep_delete_face / brep_squeeze_edge hooks' notification environment seeds every object's SmTopology record (topology::brep::p3::seed_topology_records); reached by no case, report unchanged. UPDATE (PR #204, Codex re-check of 4bcf870c): the brep_squeeze_edge hook passes a GeometryIds registry (curve keys of a kind of their own); reached by no case, report unchanged. CORRECTION (PR #204, Codex re-check of 98fec50f): the hook no longer passes a GeometryIds registry (removed): curves carry their notification identity (topology::brep::p3's curve identities, issued by the kernel context). UPDATE (PR #204, Codex re-check of d61f8d48): the brep_p3 edits name every object by its kernel-issued identity and seed its SmTopology record themselves (seed_topology_records is removed); the hooks' environment key_of is a label only. Report unchanged. UPDATE (PR #204, overseer ruling on the 9129d9f2 reviews): the brep_p3 edits notify topology under the caller's key_of again (the 2dc57273 label-only change is reverted): the hooks' environment names each entity by its arena kind and index; the edits still seed the SmTopology records the caller keeps none for. Report unchanged. Owner zone-tol cache (surface/owner-zone-tol): 830 cases, 784 pass, 0 fail, 46 deferred.

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
845
Stored error outcomes
3
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 geom.extent1d green geom.extent2d green geom.extent3d green geom.object green geom.solution_array green geom.tol green geom.vector2d green geom.vector3d green intersect.curve_class_p1 green intersect.point_class green topology.edge green topology.face_p2 partial topology.face_p4 green topology.proto_topology_p1 green topology.proto_topology_p2 green topology.proto_topology_p3 green topology.vertex green

Soft dependencies: curve.curve_p6 green curve.curve_p8 green geom.context green intersect.curve_class_p4 green intersect.curve_class_p5 green intersect.curve_class_p6 green intersect.topology_solver_p2 green nurbs.b_spline_curve_p1 green query.edge green query.face_p1 green query.face_p2 green surface.surface_p2 partial surface.surface_p5 green surface.surface_p7 green surface.surface_p8 green topology.brep_p1 green topology.brep_p3 partial topology.brep_p5 green topology.brep_p7 green topology.brep_p9 green topology.edgeuse_p1 green topology.face_p1 green topology.face_p3 green

Dependents: blend.fillet_executive_p3 partial boolean.merge_p1 green boolean.merge_p2 green boolean.merge_p3 green boolean.merge_p4 green boolean.merge_p5 green boolean.topology_intersector_p2 green boolean.topology_intersector_p3 green

Soft dependents: blend.fillet_executive_p1 green blend.fillet_executive_p2 green blend.fillet_geom_p6 green

Upstream functions

Upstream functionDefined atLinesRust (from the file header)
SmIntersectionResults::SmIntersectionResultsSmTopologyIntersector.h:666[IntersectionResults]
SmIntersectionTable::SmIntersectionTableSmTopologyIntersector.h:881[IntersectionTable]
SmTopologyIntersector::GetContextSmTopologyIntersector.h:3214[TopologyIntersector::context]
SmTopologyIntersector::GetPrimaryBrepSmTopologyIntersector.h:4191[TopologyIntersector::primary_brep], [TopologyIntersector::other_brep]
SmTopologyIntersector::GetOtherBrepSmTopologyIntersector.h:4211[TopologyIntersector::primary_brep], [TopologyIntersector::other_brep]
SmTopologyIntersector::GetThisApproxTol3dSmTopologyIntersector.h:4231[TopologyIntersector::this_approx_tol_3d]
SmTopologyIntersector::SetPrimaryBrepSmTopologyIntersector.h:4271[TopologyIntersector::set_primary_brep], [TopologyIntersector::set_other_brep]
SmTopologyIntersector::SetOtherBrepSmTopologyIntersector.h:4291[TopologyIntersector::set_primary_brep], [TopologyIntersector::set_other_brep]
SmTopologyIntersector::SetThisApproxTol3dSmTopologyIntersector.h:4311[TopologyIntersector::set_this_approx_tol_3d]
SmTopologyIntersector::~SmTopologyIntersectorSmTopologyIntersector.cpp:627[TopologyIntersector::destroy]
SmIntersectionTable::~SmIntersectionTableSmTopologyIntersector.cpp:13926[IntersectionTable::destroy]
SmTopologyIntersector::ClearExistingSSISmTopologyIntersector.cpp:1716[TopologyIntersector::clear_existing_ssi]
SmTopologyIntersector::CheckIfHaveExistingSSISmTopologyIntersector.cpp:18465[TopologyIntersector::check_if_have_existing_ssi]
SmTopologyIntersector::GetOtherMateSmTopologyIntersector.cpp:82311[TopologyIntersector::other_mate]
SmTopologyIntersector::GetThisMateSmTopologyIntersector.cpp:84111[TopologyIntersector::this_mate]
SmTopologyIntersector::IsMatedPairSmTopologyIntersector.cpp:85819[TopologyIntersector::is_mated_pair]
SmTopologyIntersector::GetBrepMateSmTopologyIntersector.cpp:88415[TopologyIntersector::brep_mate]
SmTopologyIntersector::GetMappedBrepObjectsSmTopologyIntersector.cpp:93322[TopologyIntersector::mapped_brep_objects]
SmTopologyIntersector::GetCommonEdgesSmTopologyIntersector.cpp:100931[TopologyIntersector::common_edges]
SmTopologyIntersector::GetCommonVerticesSmTopologyIntersector.cpp:104730[TopologyIntersector::common_vertices]
sm_CanImprintSmTopologyIntersector.cpp:12778can_imprint (private)
sm_FindFirstLowestDimensionSolSmTopologyIntersector.cpp:129353[find_first_lowest_dimension_sol]
sm_IntersectShellVerticesSmTopologyIntersector.cpp:135485[intersect_shell_vertices]
sm_IntersectWireLaminaEdgesSmTopologyIntersector.cpp:1447126[intersect_wire_lamina_edges]
SmTopologyIntersector::ResolveIntersectionsSmTopologyIntersector.cpp:225145[TopologyIntersector::resolve_intersections]
SmTopologyIntersector::ImprintIntersectionsSmTopologyIntersector.cpp:2302112[TopologyIntersector::imprint_intersections]
sm_SetEdgeClassSmTopologyIntersector.cpp:2693137[set_edge_class]
SmTopologyIntersector::RelateSmTopologyIntersector.cpp:527585[TopologyIntersector::relate]
SmTopologyIntersector::FixupEndPointClassMatesSmTopologyIntersector.cpp:556184[TopologyIntersector::fixup_end_point_class_mates]
SmTopologyIntersector::FixupMidPointClassMatesSmTopologyIntersector.cpp:5663200[TopologyIntersector::fixup_mid_point_class_mates]
SmTopologyIntersector::SetSubsetSmTopologyIntersector.cpp:646226[TopologyIntersector::set_subset]
sm_CheckInteriorEdgeSmTopologyIntersector.cpp:658550[check_interior_edge]
sm_TestAndSplitTwoEdgesSmTopologyIntersector.cpp:6655133[test_and_split_two_edges]
sm_TestAndImprintFaceSmTopologyIntersector.cpp:679779[test_and_imprint_face]
SmTopologyIntersector::VertexFaceIntersectSmTopologyIntersector.cpp:7043109[TopologyIntersector::vertex_face_intersect]
SmTopologyIntersector::EdgeFaceIntersectSmTopologyIntersector.cpp:7338404[TopologyIntersector::edge_face_intersect]
SmTopologyIntersector::FaceFaceIntersectSmTopologyIntersector.cpp:8023340[TopologyIntersector::face_face_intersect]
SmTopologyIntersector::FaceFaceCoincidenceSmTopologyIntersector.cpp:8388155[TopologyIntersector::face_face_coincidence]
Module file-header table (49 rows)
RustUpstream
[IntersectionResults]SmIntersectionResults, SmIntersectionResults()
[IntersectionTable]SmIntersectionTable, SmIntersectionTable()
[IntersectionTable::destroy]~SmIntersectionTable
[TopologyIntersector]SmTopologyIntersector
[TopologyIntersector::destroy]~SmTopologyIntersector
[TopologyIntersector::clear_existing_ssi]ClearExistingSSI
[TopologyIntersector::check_if_have_existing_ssi]CheckIfHaveExistingSSI
[TopologyIntersector::context]GetContext
[TopologyIntersector::other_mate]GetOtherMate
[TopologyIntersector::this_mate]GetThisMate
[TopologyIntersector::is_mated_pair]IsMatedPair
[TopologyIntersector::brep_mate]GetBrepMate
[TopologyIntersector::mapped_brep_objects]GetMappedBrepObjects
[TopologyIntersector::common_edges]GetCommonEdges
[TopologyIntersector::common_vertices]GetCommonVertices
can_imprint (private)sm_CanImprint
[find_first_lowest_dimension_sol]sm_FindFirstLowestDimensionSol
[intersect_shell_vertices]sm_IntersectShellVertices
[intersect_wire_lamina_edges]sm_IntersectWireLaminaEdges
[TopologyIntersector::resolve_intersections]ResolveIntersections
[TopologyIntersector::imprint_intersections]ImprintIntersections
[TopologyIntersector::imprint_intersections_reporting_edits]ImprintIntersections
[set_edge_class]sm_SetEdgeClass
[TopologyIntersector::relate]Relate
[TopologyIntersector::fixup_end_point_class_mates]FixupEndPointClassMates
[TopologyIntersector::fixup_mid_point_class_mates]FixupMidPointClassMates
[TopologyIntersector::clear_relationships]mate maps RemoveAll (inline call sites)
[TopologyIntersector::set_subset]SetSubset
[check_interior_edge]sm_CheckInteriorEdge
[test_and_split_two_edges]sm_TestAndSplitTwoEdges
[test_and_imprint_face]sm_TestAndImprintFace
[Reason]sReasonType
[TopologyIntersector::vertex_face_intersect]VertexFaceIntersect
[TopologyIntersector::edge_face_intersect]EdgeFaceIntersect
[TopologyIntersector::face_face_intersect]FaceFaceIntersect
[TopologyIntersector::face_face_coincidence]FaceFaceCoincidence
[TopologyIntersector::primary_brep], [TopologyIntersector::other_brep]GetPrimaryBrep, GetOtherBrep
[TopologyIntersector::this_approx_tol_3d]GetThisApproxTol3d
[TopologyIntersector::set_primary_brep], [TopologyIntersector::set_other_brep]SetPrimaryBrep, SetOtherBrep
[TopologyIntersector::set_this_approx_tol_3d]SetThisApproxTol3d
[TopologyIntersector::new], [TopologyIntersector::with_context]the two constructors (CO-PORTED from boolean.topology_intersector_p2)
[TopologyIntersector::subset]GetSubset
[TopologyIntersector::this_ang_tol_rad], [TopologyIntersector::set_this_ang_tol_rad]GetThisAngTolRad, SetThisAngTolRad
[IntersectorBrep]what the intersector reads from and writes to its two SmBreps
[MateMap], [Relations]m_pBToO, m_pOToB (face/edge/vertex subset over [Brep] ids; shared by boolean.merge_p1/p4/p5)
[MateMap::other], [MateMap::primary]GetOtherMate, GetBrepMate over [Brep] ids
MateMap::forget (crate)none (solidcore-native: coincident_edges moves a pair)
[Relations::relate_vertices]Relate of two vertices over [Brep] ids
[FaceCacheTarget], solve_with_face_caches (crate)smsurf_GetSurfaceCache of a face's surface inside the solves

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