solidcore

Units / topology

topology.brep_p4 green

Layer
46
Upstream lines
2,113
Functions
5
Rust module
topology::brep::p4

Status history

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

Source: crates/solidcore/src/topology/brep/p4.rs

Upstream: source/SMLib/src/SmBrep.cpp

Port-plan notes

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

2026-10-30 (the Rust side now builds its B-rep itself: crate::own_builder::build_as for wire, face and network sources and the Rust .smb reader, read_with, for files, renumbered into the shim's walk order under Conventions::EDGEUSE_GRAPH; it no longer imports the C++ export, no longer takes the vertex use lists in the C++ order, no longer seeds the C++ read's face-surface cache states (its last caller: the shared helper topology_edgeuse_p1::seed_cache_tree_states is deleted) and no longer gives every edge curve an owner): the previous GREEN below rested on Rust-side inputs imported from the C++ build for every case, so its counts compared the C++ B-rep with itself; counts to be re-measured. FACE TOLERANCE (2026-10-24, claude/face-classify-tol): the runner records each face tolerance on its surface after renaming the surface owner (Brep::sync_face_surface_tolerance), so the 10 SmFace::GetTolerance deferrals pass. Mac difftest: PASS topology.brep_p4 cases=327 passed=312 failed=0 deferred=0 rejected=15 (Linux CI is the verdict). PR #637 (2026-10-23): face ChangeGeometry notification wired. difftest 327 cases, 297 pass, 0 failed, 15 deferred (topology.face_p2 9, surface.trim_srf_cache 3, topology.edgeuse_p3 3), 15 rejected; the 7 former topology.face_p3 deferrals pass. UV-TRIM OWNER (PR #586, 2026-10-23): bridge_edge4 and bridge_edge4_keep0 move from deferred (topology.face_p2) to pass: difftest 327 cases, 290 pass, 0 failed, 22 deferred. difftest (PR #441, merged with main 903ff58): 327 cases, 239 passed, 0 failed, 73 deferred (intersect.surface_drop_lib_p3 55, topology.face_p2 9, geom.tol 8, topology.edge 1: opaque-handle stubs of other units), 15 rejected (FFI guards on damaged B-reps: NULL GetSurface/GetRegion, odd vertex-use pairs). StitchAndOrient stitches outside its edit (55b9202, nested notify lend); GlueVertices/GlueEdgesGeneral list removals wired (findings.md "topology.brep_p4: the last stubs (PR #441)"); wired StitchFaces/ShrinkGeometry/DeleteFace in primitive.primitive_creation_p1/p2, StitchFaces in blend.fillet_executive_p2/p3 (ExecutiveAccess), DeleteEdge/DeleteVertex hooks in boolean.topology_intersector_p2/p3 (IntersectorBrep) and topology.proto_topology_p3 (BrepGlue); brep_p4 deferrals across --green: 856 on main -> 5 (offset.offset_executive_p2 ShrinkGeometry 3, justified; topology.brep_p5 runner record-erasure check 2). Remaining UNPORTED(topology.brep_p4), justified: blend.fillet_corner_p1 DeleteEdge (pseudo B-rep, no Kernel), offset.offset_executive_p2 ShrinkGeometry (marks the unported DoSolidOffset continuation). PARTIAL (PR #173): DeleteEdge (manifold, lamina, wire branches), DeleteVertex, StitchFaces, ShrinkGeometry, ~SmBrep ported (topology::brep::p4) with arena record removal (topology::Arena::remove, Brep::remove_*_record, which also take the id off the brep_p1 face/edge/vertex lists); difftest 322 cases (160 generated + 162 hand-built in fixtures/topology.brep_p4, of which 68 are adversarial/branching-wire additions: damaged B-reps (a face without a surface, a shell without a region) with the FFI guard, and a wire network with a branching vertex and a cycle; the earlier 94:a face with a strut edge, a loop split by a bridge edge, two holes sharing an edge, faces inside holes with a surface to keep (swap, flip), a wire path with an isolated vertex and a vertex loop): 53 pass, 0 fail, 255 deferred, 14 rejected (the FFI guard: damaged inputs upstream dereferences NULL on, see the Deviations of the shim header): topology.brep_p2 212 =SmBrep::Notify at the start of DeleteEdge/DeleteVertex/~SmBrep, topology.face_p4 30 = SmFace::GetUpwardLoopuses under face_p3's CreateUVTrimCurves in ShrinkGeometry's CalculateUVDomainFromUVTrimCurves, query.brep 13 = SmBrep::LockBoundingBox in StitchFaces; all 53 passes compare 16-269 values (status, the ten walked record counts and every record field by field, also after a failed status of an edit: the shim walks the B-rep after a failure of DeleteEdge/DeleteVertex/ShrinkGeometry as well), none is status-only; no deletion body is compared yet on this branch (every one stops at SmBrep::Notify, #149); --perturb 53/53 detected. With topology.brep_p2 (#149) merged into a scratch copy and SmBrep::Notify wired: 155 pass, 0 fail, 99 deferred (SmSurface::DropCurve 26 = intersect.surface_drop_lib_p3, query.brep Lock/UnLockBoundingBox 29, SmFace::GetUpwardLoopuses 29 and GetUpwardEdgeuses 6 = face_p4, SmFace::GetTolerance 9 = face_p2), perturb 155/155; the deletion bodies run (lamina, manifold merges, wire branches, vertex loops, shell vertices, both-inner SM_ERR after the edge is gone). Generated ShrinkGeometry faces lie inside, across and wholly outside (disjoint: Intersect Init()s the face domain) the natural domain. Wired: topology.brep_p1 (GetFaces/GetEdges/GetVertices/GetRegions/GetSurfaces/GetCurves, SmLockBrepBox RAII guard), topology.shell (GetRegion, IsWireShell, m_pList/m_tShellType writes, region PostInsert/Remove, face-use Remove/PostInsert), topology.edgeuse_p3 (NormalizedEvaluate), heal.stitch_p1 (SmStitch constructor and options), topology.face_p1 (SetSurface take-and-swap, RemoveUVTrimCurves, FlipFaceOrientation, RemoveLoop, InsertLoop, CalculateUVDomainFromUVTrimCurves), topology.face_p3 (SmFace::Notify with (pFace, this, NULL) through the caller's DeleteEnv, ComputeLoopOrientation), the co-ported face queries (query::face::p2::face_vertices, topology_traverser::face_edges for SmFace::GetVertices/GetEdges), heal.stitch_p2 (SmStitch::DoStitching). Remaining stubs: SmBrep::Notify (topology.brep_p2; carries upstream's data arguments), SmBrep::UnLockBoundingBox (query.brep). Back-edges: 18 of the 21 UNPORTED(topology.brep_p4) sites on main wired (boolean.merge_p3 ShrinkGeometry and its runner's ~SmBrep, topology.brep_p7 GlueEdgesGeneral, topology.brep_p5 combine/glue/remove-topological/remove-faces/make-manifold/StitchAndOrient and its record erasure, boolean.merge_p1, boolean.merge_p5, heal.heal_data_p3, topology.brep_p10 RemoveAllTopology, offset.offset_executive_p1 ShrinkGeometry x2); 3 justified per site in findings.md (opaque O handles: boolean.topology_intersector_p2 x2, topology.proto_topology_p3). The topology.brep_p5 integration gap (stable shell/vertex/vertex-use record erasure) is closed with Brep::remove_*_record. UB-210 (unreachable on well-formed topology; defensive InvalidInput). cycle back-edges (call into later units; stub or co-port): topology.brep_p2(3), heal.stitch_p1(2), heal.stitch_p2(1), query.brep(1); unit-SCC #22 (220 units); hazards: tbb PROMOTES boolean.merge_p5 to green (140/140, 0 deferred). Edge destruction (#556, 2026-10-23): DeleteEdge (manifold, lamina, wire) deletes its edge through topology::edge::destroy (~SmEdge's SM_NO_DESTRUCTION under the DoingBoolean toggle, then ~SmAObject's ClearAttributes) instead of the bare arena removal; GlueEdgesGeneral (topology.brep_p7) uses the same. Face, edge use and shell destructors stay unmodelled. Edge use, face and shell destruction (#556, PR #631): DeleteEdge's edge uses and merged-away face and DeleteVertex's vertex shell go through edgeuse::p2::destroy, face::p3::destroy and shell::destroy (their destructors' SM_NO_DESTRUCTION, then ~SmAObject's ClearAttributes). Records without a notifying destructor (face uses, loops, loop uses, vertices, vertex uses, regions) and the whole-B-rep destroy stay without attribute cleanup.

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
327
Stored error outcomes
15
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: geom.context green geom.extent2d green geom.object green geom.vector2d green topology.brep_p1 green topology.edge green topology.edgeuse_p1 green topology.face_p1 green topology.face_p2 partial topology.loopuse green topology.proto_topology_p1 green topology.shell green topology.topology green topology.vertex green topology.vertexuse green

Soft dependencies: curve.curve_p2 green geom.vector3d green surface.surface_p1 green surface.surface_p2 partial surface.surface_p7 green topology.edgeuse_p2 green topology.edgeuse_p3 green topology.face_p3 green topology.face_p4 green topology.topology_traverser green

Dependents: blend.feature_executive blocked blend.fillet_executive_p1 green blend.fillet_removal green offset.offset_executive_p2 partial primitive.primitive_creation_p2 green topology.brep_cutting partial topology.brep_p3 partial topology.brep_p5 green

Soft dependents: blend.fillet_corner_p1 green blend.fillet_executive_p2 green blend.fillet_executive_p3 partial blend.hcr green boolean.merge_p1 green boolean.merge_p3 green boolean.merge_p4 green boolean.merge_p5 green boolean.topology_intersector_p2 green boolean.topology_intersector_p3 green heal.heal_data_p3 green offset.offset_executive_p1 partial primitive.api_primitives green primitive.primitive_creation_p1 green sweep.api_brep partial sweep.api_surfaces green topology.proto_topology_p3 green

Upstream functions

Upstream functionDefined atLinesRust (from the file header)
SmBrep::~SmBrepSmBrep.cpp:695169[destroy]
SmBrep::DeleteEdgeSmBrep.cpp:57521303[delete_edge]
SmBrep::DeleteVertexSmBrep.cpp:7895108[delete_vertex]
SmBrep::StitchFacesSmBrep.cpp:2682891[stitch_faces]
SmBrep::ShrinkGeometrySmBrep.cpp:32491442[shrink_geometry]
Module file-header table (7 rows)
RustUpstream
[delete_edge]SmBrep::DeleteEdge
[delete_vertex]SmBrep::DeleteVertex
[stitch_faces]SmBrep::StitchFaces
[StitchOutcome]its rlStitchedEdges .. rdMaxEdgeFaceTrimCurveGap outputs
[shrink_geometry]SmBrep::ShrinkGeometry
[destroy]SmBrep::~SmBrep
[DeleteEnv]the objects' addresses and SmTopology members the notifications use

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