solidcore

Units / boolean

boolean.merge_p3 green

Layer
57
Upstream lines
1,152
Functions
5
Rust module
boolean::merge::p3

Status history

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

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

Upstream: source/SMLib/src/SmMerge.cpp

Port-plan notes

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

2026-10-25 (Issue #832: native operand construction + namespace owner adoption): PASS boolean.merge_p3 cases=423 passed=423 failed=0 deferred=0 max_rel_err=0e0 with_values=333 no_values=90 vacuous=0; SENSITIVE 423/423. Pool::load builds box/vertex operands natively (matching SmApiCreateBox / MakeShellVertex creation face_list order instead of R_inf->sh_inf DFS walk order) and relabels under Brep::use_arena_naming; MergeEngine::adopt_operand_owners runs after Pool::intersect_insert_relate and Pool::process_wires; Pool::set_operands resets cached primary/other traversal marks; topology::brep::p1::{surfaces,curves} and GeometryOwnerScope preserve NamingScheme::Notify. Resolves all 8 vertex-order known mismatches (Issue #832). 2026-10-25 (runner: imported edge curves owned by their edges): PARTIAL boolean.merge_p3 cases=423 passed=415 failed=0 deferred=0 known_mismatch=8 (was passed=413 known_mismatch=10): the runner's operand loader gives each edge's curve its edge as owner, as natively, so the B-rep cache's curve tree holds the box edges and the point solve of piecewise_box_other_shell_vertex_imprint_2/_3 finds the edge; both pass (plan/findings.md 'boolean.merge_p3: shell vertex on a box edge finds no edge solution', resolution). 2026-10-25 (intersector solves reach their faces' surface caches): PARTIAL boolean.merge_p3 cases=423 passed=413 failed=0 deferred=0 known_mismatch=10 (was deferred=2 known_mismatch=8: piecewise_box_other_shell_vertex_imprint_2/_3 now compare and are known mismatches, plan/findings.md 'boolean.merge_p3: shell vertex on a box edge finds no edge solution'). 2026-10-24 (MakeEdgeInFace through the owning B-rep): SmEdgeDefinition::Imprint runs SmBrep::MakeEdgeInFace on the owning B-rep (ProtoBrep::brep_make_edge_in_face, its own m_bEditingEnabled) and UpdateFaces evaluates edge use binormals on it (ProtoBrep::edgeuse_evaluate_binormal): PARTIAL boolean.merge_p3 cases=423 passed=412 failed=0 deferred=8 known_mismatch=3 (the 3 vertex-order cases, plan/findings.md; follow-up to trace). 2026-10-24 (claude/vertex-point, Mac): after merging main with #759: PARTIAL boolean.merge_p3 cases=423 passed=412 failed=0 deferred=11 blocked_by=topology.brep_p1(8),topology.face_p2(3). Earlier: vertex-definition imprint merges in the arena pair; the 9 SmVertex::GetPoint deferrals pass. after merging main (Mac): PARTIAL boolean.merge_p3 cases=423 passed=412 failed=0 deferred=11 blocked_by=query.face_p2(4),topology.brep_p1(4),topology.face_p2(3). FACE CLASSIFY (2026-10-24, claude/face-classify-tol): the 4 query.face_p2 SmFace::PointClassify deferrals now classify on the mutable B-rep and stop later at topology.brep_p1 SmBrep mutable owning context. Mac difftest: passed=395 deferred=28 (topology.brep_p1 8, topology.face_p2 3, topology.vertex 17). PR #738: the runner's PiecewiseMerge (family 4) constructs the merge and runs IntersectInsertRelate, ClearRelationships, SetSubset, the controls, RegisterExistingSSI/ClearExistingSSI and ProcessWiresAndShellVertices on that engine (merge p4 kernel adapter), the one ManifoldBoolean uses: PARTIAL cases=423 passed=395 failed=0 deferred=28 blocked_by=query.face_p2(4),topology.brep_p1(4),topology.face_p2(3),topology.vertex(17) on main 76f27c381 (was 361 passed, 62 deferred, 48 of them at IntersectInsertRelate). main CI e33985411 (2026-10-23): PARTIAL boolean.merge_p3 cases=423 passed=361 failed=0 deferred=62 blocked_by=boolean.topology_intersector_p2(48),topology.edge(5),topology.vertex(9). PARTIAL (PR #245): all 5 functions ported; PR #287 update: 387 cases (131 fixtures, 33 of them family-6 engine-probe cases of DependencyMerge::with_engine against a context-only native SmMerge, NER/controls only; + 256 generated), 215 matched / 0 failed / 172 deferred, with_values=159; perturb 215/215; fuzz 2000 PASS (668 ran, 1332 rejected, 0 differs/crashes/panics/timeouts); valgrind clean on 8 family-6 programs. Counts below are as of #245 except the deferral split. Opus-fix verification: 354 cases (98 fixtures + 256 generated), 182 matched / 0 failed / 172 deferred; with_values=126 (103 leaf identity/order/null + limited Rust B-rep digest cases, 23 empty forests), no_values=56 (54 native error statuses, 2 explicit UB-190 guard-only refusals; 180 operation comparisons + 2 guard self-checks). Rust digest compares face/edge/vertex counts and ordered vertex positions, not full graph/adjacency/curve/surface parity; earlier C++ payload echo coverage claim corrected. Zero geometric-success comparisons. Deferred: boolean.merge_p2 87 (40 of them NonManifoldBoolean cases: ManifoldBoolean is wired to boolean.merge_p4 through DependencyMerge's constructed engine, which SmMerge::SmMerge builds), boolean.topology_intersector_p2 48, topology.brep_p3 37. Perturb 182/182 detected; fuzz 2000 PASS (708 ran, 1292 rejected, 0 differs/crashes/panics/timeouts); Valgrind 50 programs/10 per family, baseline equal, 0 memory errors (leak checking disabled for retained unknown failed-call objects). All three boolean.api_brep back-edges wired. All family success results now serialized from Rust; PiecewiseMerge is generic over PiecewiseAccess with no kernel engine implementation yet (merge_p2/p4). Pool uses canonical intersector/attributes/marks, owner-tagged dependencies, and no silent subset stub. No surface-list or SSI skip-relation parity claimed. UB-188/WR-196 are source-only notes; UB-190 records piecewise imprinting lifetime defect, guarded only for multi-surface other operands. Empty B-rep constructor defaults are explicit topology.brep_p3 stubs (no Brep::new substitution), with full downstream tails. Opus fixes verified on main #130: fmt/own include rustfmt, workspace/CPP checks, clippy x2, 1402 kernel tests, 4 serializer/adapter tests, 2 merge_p3 FFI tests, wasm and native gates pass; 213-unit matrix passes (114 PASS/99 PARTIAL, zero failures, zero green units with deferred cases). Latest-main 154853c7 (includes 46ddc4ff) merged cleanly; post-merge fmt/own include rustfmt, workspace/CPP checks, clippy x2, 1410 kernel tests, 4 adapter tests, 2 merge_p3 FFI tests (+ 1 API test), wasm and default merge_p3/api_brep difftests pass; pulled reports unchanged. Full-matrix/perturb/fuzz/Valgrind evidence is from reviewed f0957fc5. Prior case outcomes unchanged; payload now reads actual Rust state. 5 fns; largest: SmMerge::PiecewiseMerge, SmMerge::BooleanLists, SmMerge::BooleanTrees, SmMerge::merge_breps; unit-SCC #22 (220 units); 102 upstream test entry points reach this unit Re-run in PR #149 (merge with main through 39ceb995, #283): 354 cases, 182 pass, 0 fail, 172 deferred (unchanged; no case reaches the wired SmBrep::Notify / SetTolerance sites, which follow merge_p2 / merge_p4 / topology_intersector_p2 / brep_p3 calls): the arena-only boolean_lists' component CopyFaces notifies through brep_p2's ArenaNotifyState (overseer ruling, reversing the module's 'defers at that boundary'), and the runner pool's SetTolerance / Notify adapters call topology.brep_p2. Re-run in PR #229 (boolean.merge_p2 wired, merge with main through 7b57d8de, after #287): 387 cases, 222 pass, 0 fail, 165 deferred (query.brep 80, boolean.topology_intersector_p2 48, topology.brep_p3 37). SmMerge::SmMerge now builds #287's engine: DependencyMerge::construct fills it through MergeEngine::from_merge (MergeState::with_breps: options, flags, the computed tolerances), and ManifoldBoolean before construct is InvalidInput. The runner's Pool constructs the same engine and runs ManifoldBoolean on it with its B-reps moved in and back; family 3 constructs first, as the shim's MergeAccess does. All 87 former boolean.merge_p2 deferrals now pass (7) or stop at SmBrep::CalculateBoundingBox (query.brep) inside merge_p4's ManifoldBoolean (80). UPDATE (PR #204, topology.brep_p3): the UNPORTED(topology.brep_p3) stubs are wired: SmBrep(size, ratio, stack) -> topology::brep::p3::new_brep (pOptContextForStack is the allocating kernel), the copy constructor -> brep::p3::copy_brep and MergeBrep -> brep::p3::merge_brep, the last two through an arena-only notification store (ArenaNotifyState: default records, no attributes, no context, as the arena entry's component copies) with the source in a key namespace of its own (source_ref: notify_ref | 1 << 40). Unit test renamed: surface_list_makes_the_native_empty_brep_then_stops_at_the_surface_copy (now stops at surface.surface_p1). UPDATE (PR #204, Opus review of 255d52b7): the difftest runner's empty_brep (its UNPORTED(topology.brep_p3) SmBrep::SmBrep) calls topology::brep::p3::new_brep. Gate on the wired tree (PR #204 4c7a444b): 354 cases, 182 pass, 0 fail, 172 deferred; case by case the 37 SmBrep::SmBrep(copy) (topology.brep_p3) deferrals relabel to topology.brep_p4 SmBrep::StitchFaces, no outcome change. UPDATE 2026-10-27 (PR #1357, BooleanLists surface operands): list_operand no longer defers a surface list to surface.surface_p1. Upstream copies each surface operand with the base copy constructor (WR-196: a geometry-less SmSurface), so CreateFaceFromSurface fails on the copy and the call returns SM_ERR; the port models that copy (BaseSlicedSurface: the zero natural domain, the SM_ERR of its face creation) and the opt-in Kernel::fixes.boolean_lists_virtual_surface_copies copies with the virtual Copy instead (faces are made, a plane list is planar). Shim / FFI / runner: family-2 operands of kinds 2 (SmPlane) and 3 (SmSphere) go into the call's surface lists; new fixture surface-operands.json (15 cases: 12 lists of surfaces without B-reps, both sides SM_ERR 1001 whichever kind, position, operation, options or scale; 3 lists mixing B-reps and surfaces, whose surfaces both sides ignore, compare real union / difference / xor results). PASS boolean.merge_p3 cases=438 passed=438 failed=0 deferred=0 max_rel_err=0e0 with_values=336 no_values=102 vacuous=0; --perturb SENSITIVE 438/438. WR-196 confirmed (addendum 2026-10-27); no UNPORTED stub left in boolean::merge::p3.

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
438
Stored error outcomes
97
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.merge_p2 green boolean.merge_p4 green boolean.merge_p5 green boolean.topology_intersector_p1 green geom.context green geom.object green topology.brep_p1 green topology.brep_p3 partial

Soft dependencies: boolean.topology_intersector_p2 green geom.a_object green geom.attribute green geom.tol green primitive.primitive_creation_p1 green surface.surface_p1 green surface.surface_p2 partial topology.brep_p2 green topology.brep_p4 green topology.brep_p5 green topology.brep_p7 green topology.brep_p8 green topology.shell green topology.topology_traverser green

Dependents: blend.feature_executive blocked blend.fillet_executive_p1 green boolean.api_brep partial

Soft dependents: offset.offset_executive_p1 partial primitive.primitive_creation_p2 green

Upstream functions

Upstream functionDefined atLinesRust (from the file header)
SmMerge::PiecewiseMergeSmMerge.cpp:341454[piecewise_merge]
SmMerge::merge_brepsSmMerge.cpp:134359[merge_breps]
SmMerge::BooleanListsSmMerge.cpp:1431326[boolean_lists]
SmMerge::BooleanTreesSmMerge.cpp:1820290[boolean_trees]
SmMerge::NonManifoldBooleanSmMerge.cpp:240123[non_manifold_boolean]
Module file-header table (6 rows)
RustUpstream
[piecewise_merge]SmMerge::PiecewiseMerge
[merge_breps]SmMerge::merge_breps
[boolean_lists]SmMerge::BooleanLists
[boolean_lists_with_notifications]SmMerge::BooleanLists with caller notification state
[boolean_trees]SmMerge::BooleanTrees
[non_manifold_boolean]SmMerge::NonManifoldBoolean

Upstream tests reaching this unit

SM_API_test:TestSmMaterialCensus, SM_API_test:TestSmPiecewiseMerge, SM_API_test:TestSmBooleanLists, SM_API_test:TestKernelMergeBrepsInvalidInput, SM_API_test:TestApiMergeBrepsInvalidOperation, SM_API_test:TestMergeBrepsOperation