solidcore

Units / sweep

sweep.topology_sweep green

Layer
51
Upstream lines
2,456
Functions
51
Rust module
sweep::topology_sweep

Status history

Oct 12Nov 25
  1. todo 2,456 lines
  2. partial 2,456 lines
  3. green 2,456 lines
  4. partial 2,456 lines
  5. green 2,456 lines

Source: crates/solidcore/src/sweep/topology_sweep.rs

Upstream: source/SMLib/inc/SmSweepGeometryCreation.h, source/SMLib/inc/SmTopologySweep.h, source/SMLib/src/SmSweepGeometryCreation.cpp, source/SMLib/src/SmTopologySweep.cpp

Port-plan notes

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

GREEN 2026-10-27 (HCR silhouette order): Hcr::silhouette_edges hands back newest first, as libstdc++'s unordered_map does, so SetHigher's first image matches C++; nm_box_linear_z_stitch passes (264 values) and nm_test_rotation_neg_y_36 now returns the same SM_ERR as C++; both known mismatches removed (7 cpp_defect cases stay parked). explicit_lists.json (52 cases, all pass with values, from the explicit target lists PR): DoSweep with explicit faces/edges/vertices higher and same lists. local 2026-10-27 (non-manifold mismatch root causes): PARTIAL sweep.topology_sweep cases=688 passed=677 failed=0 deferred=0 rejected=2 known_mismatch=1 parked=8; partial because nm_test_rotation_neg_y_36 is deliberately kept a visible known mismatch (cause is the C++ pointer-keyed silhouette order shown by forced-order probes, ND-492 is evidence, no cpp_defect). Both former known mismatches are the C++ silhouette visiting order (std::unordered_map, ND-2), not a Rust divergence; Rust visits in the C++ HCR insertion order, and C++ forced into that order agrees in every value. nm_box_linear_z_stitch parked ND-491 (C++ SM_ERR 7/1000 heap-varied, 44/1000 shuffled free lists); nm_test_rotation_neg_y_36 known mismatch, not parked, see ND-492 (libstdc++ always visits the first-inserted silhouette last, 5450/5450 SM_ERR in the wire union MakeFaceuse; insertion order succeeds). See plan/findings/sweep.topology_sweep--addendum-2026-10-27-nonmanifold-mismatches-root-cause.md. Earlier: local 2026-10-27 (non-manifold body PR): PARTIAL sweep.topology_sweep cases=636 passed=625 failed=0 deferred=0 rejected=2 known_mismatch=2 parked=7. nonmanifold_body.json (43 cases): whole-B-rep DoSweep of the prog_test my_create_test_brep face, box+wire+shell vertex, lone wire/shell vertex, empty, box alone, face alone, plus faces-higher sweeps of the same bodies, with stitch/merge/repetitions/tagging; record adds wire-edge/shell-vertex counts and face/edge tags. Fixed: SweepAccess::copy_edges default lent the context twice (wire B-rep stayed empty); now p6::copy_edges_with_context. 2 rejected by the FFI guard (UB-269 stale pWireBrep, UB-270 TagProfile on deleted wire edges); 1 parked ND-491 (box alone, stitch); 2 known mismatches keep the unit partial: nm_box_linear_z_stitch (Rust SM_ERR in the box stitch, C++ succeeds 400/400) and nm_test_rotation_neg_y_36 (C++ SM_ERR in the final wire union, Rust succeeds); see plan/findings/sweep.topology_sweep--nonmanifold-body-whole-sweep.md. Earlier: local 2026-10-27: PASS sweep.topology_sweep cases=593 passed=587 failed=0 deferred=0 parked=6 (whole-B-rep DoSweep with stitching/merging: 6 compared, 6 parked as ND-491 heap-layout dependent C++). 51 fns; largest: SmTopologySweep::DoSweep, SmTopologySweep::SweepEdgeHigh, SmTopologySweep::SweepFaceSame, SmSweepStitchCallback::SelectTopologyToKeep; cycle back-edges (call into later units; stub or co-port): blend.hcr(5), boolean.merge_p1(1), boolean.merge_p2(1), boolean.merge_p3(1), boolean.merge_p4(1), boolean.topology_intersector_p1(1), sweep.rotational_sweep_geometry(1), sweep.trans_sweep_geometry(1); unit-SCC #22 (220 units); 317 upstream test entry points reach this unit; CO-PORTED in sweep.rotational_sweep_geometry (PR #126): SmSweepGeometryCreation members m_bMakeAnalytics, m_dEps, constructor, SetMakeAnalytics, SmSweepCheckType -> solidcore::sweep::topology_sweep::{SweepGeometryCreation, SweepCheckType}; PR #222: full sweep control flow, map/callback and base/concrete geometry dispatch ported with statically dispatched SweepAccess service boundary. Difftest 568 cases: 558 passes (exact integer state; emitted f64 values max_rel_err=0), 10 deferred (topology.brep_p3=10), 0 failed/rejected. Compared: four maps including nulls/stale inverses, callback choices, options and edge-profile tags; closure flags, callback f64 distances and successful frame origin/X/Y/Z coordinates are compared. Construction/HCR/copy/merge/stitch tails are present but not C++-compared behind missing dependencies; no production SweepAccess adapter yet (tracked in issue #255). Recursion depth at most 2 (explicit-target wire child); execution limited to 4096 repetitions, no-progress back-face traversal errors, wire ownership cleared after consuming union and cleaned on errors. See plan/findings.md for coverage and safety limitations. Review wiring: available B-rep/shell queries, CopyEdges, MakeFaceWithCurves, CopyFaces and EvaluateBinormal now call their ports. The second review wires MakeShellVertex, MakeVertexLoop (default Opposite), polymorphic-UV MakeEdgeInFace, RemoveFaces, Transform, HasLaminaEdge, Hcr construction/visibility/silhouettes and Stitch::do_stitching with the sweep callback. Merge p3/p4 calls stay behind new_merge (SmMerge::SmMerge, boolean.merge_p2, todo); their canonical engine/storage integration is coordinated with merge_p2, as permitted in review 5589823426. Other SweepAccess stubs do not target green/partial units. Face/edge/vertex tolerance helpers apply the owning kernel zone_tol3d conversion. Explicit borrow-splitting resolvers preserve the actual destination context, persistent notification records/attributes and face identities; adapters retain the complete Hcr session for scene lifetime. Current-main compatibility (e4dd81c4): HCR global visibility receives the owning mutable Kernel; GetShellVertices calls p2 with the actual B-rep and preserves vertex-list order. Four old topology deferrals now compare helper records/maps after shell allocation; new vertex coordinates/full B-rep topology are not exported by the native record. Eight native-feature Rust service regressions separately verify distinct-owner lists, created shell/vertex owner and point, real empty cleanup success, open-loop rejection, downstream blockers and stitch context restoration. Fresh native gates for sweep, p5, p7, p9, p2 and HCR have zero failures; kernel1535/nativeFFI4/wasm/plain+CPP Clippy pass. Full gate and exact-head CI results are recorded in the PR discussion. Shared SweepStitchCallback remains crate-visible for primitive linear caps; PR #233 retains its owner-qualification, conflicting-map and state-restoration regressions. Both borrow callbacks pass caller NotifyEnv and mutable destination Kernel, as required by the primitive adapter. CO-PORTED in primitive.primitive_creation_p1 (PR #213): EntityMaps used by CopyEntityMaps. Transform/delete notifications and retained Hcr sessions use the latest #222 service interface. PR #233 integration with current main e4dd81c4 and #222 compatibility: 568 cases, 558 exact passes, 0 failed, 10 deferred (topology.brep_p3), 0 rejected. Four old construction deferrals now compare helper status/maps after shell allocation; the native record does not certify newly created vertex coordinates or complete B-rep topology. All eight native-feature Rust service regressions pass and separately check created shell/vertex owners and point, the real p2 shell-vertex getter with distinct owners/list order, empty cleanup success, open-loop validation, downstream dependency attribution and stitch flag restoration. All 13 affected native gates pass after this final getter wiring, including topology.brep_p2 (1709/1437 pass/272 deferred). PR #424 adds a caller-borrowed SweepStore with stable identity resolution, persistent attributes/records, mark ownership, partial-output preservation and retained HCR scenes. No additional native geometry coverage is claimed; merge registration and wire construction remain unavailable in this dependency adapter. SweepStore implements SweepAccess and PrimitiveAccess over borrowed or owned resources, with retained MergeState/Relations, caller-qualified notifications and scoped temporary cleanup. The native sweep corpus compares 568/568 cases without deferrals; full solid sweeps remain unqualified. See plan/production-sweep-store.md. PR #1271: whole-B-rep DoSweep (all targets null) compared on real SmApiCreateBox solids in the production SweepStore: 13 whole_* fixtures (stitch/merge off) pass exactly (HCR silhouettes, scene copy, silhouette edge sweep, back-face move; order-canonical record because GetSilhouetteEdges is pointer-hash ordered, ND-2); store RemoveFaces/RemoveAllTopology/stitch no longer lend the context twice. Stitched and merged whole sweeps remain uncompared (plan/findings/sweep.topology_sweep--whole-brep-sweep-store-stitch-and-merge.md). sm_CreateEdgeForBase/make_edge_in_face are dead upstream (pStrutC always NULL).

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
703
Stored error outcomes
0
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.axis2_placement green geom.context green geom.extent1d green geom.object green geom.vector3d green heal.stitch_p1 green topology.brep_p1 green topology.brep_p3 partial topology.brep_p5 green topology.edge green topology.edgeuse_p1 green topology.face_p4 green topology.loopuse green topology.shell green topology.topology green topology.vertex green

Soft dependencies: geom.a_object green geom.attribute green geom.extent3d green geom.tol green heal.stitch_p2 green query.brep green surface.surface_p1 green surface.surface_p2 partial topology.brep_p10 green topology.brep_p2 green topology.brep_p6 green topology.brep_p7 green topology.brep_p9 green topology.edgeuse_p3 green topology.face_p2 partial topology.face_p3 green topology.topology_traverser green topology.vertexuse green

Dependents: primitive.primitive_creation_p3 green sweep.rotational_sweep_geometry green sweep.trans_sweep_geometry green

Soft dependents: none

Upstream functions

Upstream functionDefined atLinesRust (from the file header)
SmSweepGeometryCreation::SmSweepGeometryCreationSmSweepGeometryCreation.h:524[SweepGeometryCreation]
SmSweepGeometryCreation::CopySmSweepGeometryCreation.h:591
SmSweepGeometryCreation::SetMakeAnalyticsSmSweepGeometryCreation.h:614[SweepGeometryCreation::set_make_analytics]
SmSweepGeometryCreation::VertexSweepHigherSmSweepGeometryCreation.h:6710
SmSweepGeometryCreation::VertexSweepSameSmSweepGeometryCreation.h:799
SmSweepGeometryCreation::EdgeSweepHigherSmSweepGeometryCreation.h:9022
SmSweepGeometryCreation::EdgeSweepSameSmSweepGeometryCreation.h:11410
SmSweepGeometryCreation::FaceSweepSameSmSweepGeometryCreation.h:12610
SmSweepGeometryCreation::IsSweepClosedSmSweepGeometryCreation.h:1598
SmSweepGeometryCreation::GetStartCoordSystemSmSweepGeometryCreation.h:1688
SmSweepGeometryCreation::GetSweepTransformSmSweepGeometryCreation.h:1864
SmTopologySweep::~SmTopologySweepSmTopologySweep.h:961
SmTopologySweep::SetDoStitchingSmTopologySweep.h:1421
SmTopologySweep::SetTaggingSmTopologySweep.h:1465
SmTopologySweep::GetMapToSameSmTopologySweep.h:2521
SmTopologySweep::GetMapToHigherSmTopologySweep.h:2531
SmTopologySweep::GetMapFromSameSmTopologySweep.h:2541
SmTopologySweep::GetMapFromLowerSmTopologySweep.h:2551
SmTopologySweep::GetToSamePrivSmTopologySweep.h:2571
SmTopologySweep::GetFromSamePrivSmTopologySweep.h:2581
SmTopologySweep::GetToHigherPrivSmTopologySweep.h:2591
SmTopologySweep::GetFromLowerPrivSmTopologySweep.h:2601
SmTopologySweep::RemoveFromToSamePrivSmTopologySweep.h:2621
SmTopologySweep::RemoveFromFromSamePrivSmTopologySweep.h:2631
SmTopologySweep::GetToSameSmTopologySweep.h:2661
SmTopologySweep::GetToSameSmTopologySweep.h:2671
SmTopologySweep::GetToSameSmTopologySweep.h:2681
SmTopologySweep::GetToHigherSmTopologySweep.h:2761
SmTopologySweep::GetToHigherSmTopologySweep.h:2771
SmSweepStitchCallback::SmSweepStitchCallbackSmTopologySweep.h:2992
SmSweepStitchCallback::~SmSweepStitchCallbackSmTopologySweep.h:3011
SmSweepGeometryCreation::~SmSweepGeometryCreationSmSweepGeometryCreation.cpp:191
SmTopologySweep::SmTopologySweepSmTopologySweep.cpp:3420[TopologySweep]
SmTopologySweep::SetRepetitionsSmTopologySweep.cpp:609
SmTopologySweep::SetHigherSmTopologySweep.cpp:7528[TopologySweep::set_higher]
SmTopologySweep::SetSameSmTopologySweep.cpp:11033[TopologySweep::set_same]
SmSweepStitchCallback::SelectTopologyToKeepSmTopologySweep.cpp:151195[TopologySweep::select_topology_to_keep]
SmTopologySweep::TagProfileSmTopologySweep.cpp:47674
SmTopologySweep::DoSweepSmTopologySweep.cpp:601848
SmTopologySweep::DoSweepVerticesSameSmTopologySweep.cpp:151324
SmTopologySweep::DoSweepVerticesHigherSmTopologySweep.cpp:1545100
SmTopologySweep::SweepVertexSameSmTopologySweep.cpp:165126
SmTopologySweep::SweepEdgeSameSmTopologySweep.cpp:168699
SmTopologySweep::DoSweepEdgesSameSmTopologySweep.cpp:179237
sm_CreateEdgeForBaseSmTopologySweep.cpp:184096
SmTopologySweep::SweepEdgeHighSmTopologySweep.cpp:1943399
SmTopologySweep::DoSweepEdgesHigherSmTopologySweep.cpp:234859
SmTopologySweep::DoSweepFacesSameSmTopologySweep.cpp:241416
sm_MapVertexLoopsSmTopologySweep.cpp:243658
SmTopologySweep::SweepFaceSameSmTopologySweep.cpp:2500210
SmTopologySweep::DoSweepFacesHigherSmTopologySweep.cpp:27169
Module file-header table (8 rows)
RustUpstream
[SweepGeometryCreation]SmSweepGeometryCreation (data members)
[SweepGeometryCreation::new]SmSweepGeometryCreation(dEps)
[SweepGeometryCreation::set_make_analytics]SetMakeAnalytics
[TopologySweep]SmTopologySweep
[TopologySweep::set_same]SetSame
[TopologySweep::set_higher]SetHigher
[TopologySweep::select_topology_to_keep]SmSweepStitchCallback::SelectTopologyToKeep
[SweepCheckType]SmSweepCheckType

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