boolean.merge_p4 green
- Layer
- 56
- Upstream lines
- 2,596
- Functions
- 1
- Rust module
boolean::merge::p4
Status history
- todo 2,590 lines
- partial 2,590 lines
- green 2,590 lines
Source: crates/solidcore/src/boolean/merge/p4.rs
Upstream: source/SMLib/src/SmMerge.cpp
Port-plan notes
These notes preserve historical port measurements and limitations, not current CI results.
GREEN (2026-10-25, PR #970): all 308 non-rejected cases pass (311 total, 308 with values, 3 rejected, 0 failed, 0 deferred, max_rel_err=0e0, --perturb SENSITIVE) now that surface cache face queries are wired on main. 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_p4 cases=311 passed=305 failed=0 deferred=3 rejected=3 blocked_by=query.face_p2(3) (was 242 passed, 66 deferred at m_bEditingEnabled); the 3 left stop at SmFace::PointClassify in surface::surface::p4's surface cache. 2026-10-24 (claude/vertex-point, Mac): after merging main with #759: PARTIAL boolean.merge_p4 cases=311 passed=242 failed=0 deferred=66 rejected=3 blocked_by=topology.brep_p1(66). Earlier: SmVertexDefinition::Imprint merges through ProtoBrep::merge_point_class_into_brep (ArenaPair: merge_into_object_mut), so the 82 SmVertex::GetPoint and 20 SmBrep mutable owning context deferrals compare; the 3 far-translation cases that then failed (joined curve left untranslated: post-process DeleteTopologicalVertex re-owned it under a kernel key, so the inverse Transform skipped it) pass after boolean.merge_p1 restores the survivor curve owner. PARTIAL boolean.merge_p4 cases=311 passed=242 failed=0 deferred=66 max_rel_err=0e0 with_values=242 no_values=0 vacuous=0 rejected=3 blocked_by=query.face_p2(66). FACE CLASSIFY (2026-10-24, claude/face-classify-tol): the 66 query.face_p2 SmFace::PointClassify deferrals (fast-drop trim test of ComputePointParameters) now classify on the mutable B-rep and stop later at topology.brep_p1 SmBrep mutable owning context. Mac difftest unchanged in counts: passed=140 deferred=168 (topology.brep_p1 86, topology.vertex 82). PR #201 integration extends the production adapter with borrowed caller topology/curve identities and reserved region source-list handles while preserving the existing namespace-backed API. Actual notification records are restored with partial edits on Result exits and unwind; attributes and live contexts remain caller-owned. The automatic-tolerance constructor still belongs to boolean.merge_p2 (#229); borrowed cache access stops at the genuine query.brep bounding-box call and awaits live-kernel cache plumbing. Late consumption before cache/transform errors follows native ordering; operand slots, not Result alone, determine retained Rust ownership. Existing 311-case report is byte-identical, and 30/30 perturbations are detected; latent caller-key tests do not certify successful constructive Booleans. Historical port evidence follows: 1 fn, SmMerge::ManifoldBoolean; PR #243 partial. Full control-flow tail and scoped inverse transform; explicit two-context marks/editing and shared caller AttributeStore. No success path compared yet: all valid pairs stop at merge_p1 CalculateBoundingBox / query.brep. Null errors compare status plus post-state, including surviving graphs. KernelManifoldIntersector implements all 16 methods: shared MergeState<Relations>, canonical mates, caller notification records/attributes, all four merge_p1 stages and the merge_p5 paired-kernel wire API. Common lists share the generic intersector helper; source-region keys resolve real arenas. Focused adapter tests are separate from Boolean success coverage. CloseIntersectionLoop is a live units.json/unused callgraph gap (SmMerge.cpp:2958), co-ported into boolean.topology_intersector_p2 by PR #281, which also wires it here: KernelManifoldIntersector::close_intersection_loop calls TopologyIntersector::close_intersection_loop over the ArenaPair (the trait method now takes the caller AttributeStore and has no default). The callback retains PR #201 caller notification keys and namespace-aware cache configuration. PointClassify caller logic stays outside its stub. CopyFaces is wired to brep_p7; no incoming UNPORTED(boolean.merge_p4), shared Relations face storage/map-access extensions only, no dependency algorithm co-ports, no absolute floors. Difftest: 311 cases, 30 null-error state matches, 278 query.brep deferrals, 3 native constructor rejections, 0 failed; with_values=30 no_values=0; real Boolean successes=0 (status-as-data makes cases_both_errored=0). Fuzz 2000: rejected=203 malformed=866 ran=931 differs=0 crashes=0 panics=0 timeouts=0. Perturb 30/30; fmt/include rustfmt, checks x2, clippy x2, 1414 tests (eight adapter regressions), wasm pass after main 154853c7 (progress-only). Three requested adapter mutants each fail their intended assertion and were restored byte-identically; production unchanged from CLEAN 0ceda887. Its coordinate/error-state regressions and 405-case full-leak Valgrind baseline comparison pass (0 errors/lost bytes). Its full green gate passed: 214 units, failed=0; every reported partial matches the plan and no plan-green unit deferred. Re-run in PR #149 (merge with main through 39ceb995, #283): 311 cases, 30 pass, 0 fail, 278 deferred (query.brep 278; unchanged): IsSheet / IsOrientedSheet (in the other B-rep's kernel) and DeleteStaleCaches call topology.brep_p2; ArenaPair implements brep_arena and BrepGlue (GlueVertices through p5::glue_with_notifications). UPDATE (PR #204, topology.brep_p3): new_component_brep's UNPORTED(topology.brep_p3) SmBrep::SmBrep is Brep::new_with_infinite_region (the kernel is held shared there: no context tolerance, sizes or SM_NO_CONSTRUCTION notification, the deviation of blend.fillet_geom_p1 / primitive.api_primitives). UPDATE (PR #204, topology.brep_p3, Opus review of 255d52b7): KernelManifoldIntersector::new caps namespaces at 26 bits (0x03ff_ffff, was 27): a 27-bit namespace set bit 63, inside topology.brep_p3's reserved key range (KERNEL_KEY_BASE), so ArenaPair's p3 edits would refuse keys its p5 glue accepts; notification_key_blocks_never_alias_across_operands_or_classes tests the new bound and that the largest namespace's keys are not reserved. #282's DELETE_FACES_NAMESPACE 0x00f5e700 is within it (COORD #282 x #204). SweepStore wiring retains the intersector/Relations under scoped caller notification keys, preserves existing records and region source-list identities, and issues distinct identities for extracted components. Namespace-backed access remains supported. FaceIntersect wired (2026-10-23): 311 cases, 140 passes (was 118), 0 failed, 168 deferred (topology.face_p3 99 -> 0; topology.edge 157, topology.vertex 11).
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
- 311
- 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: boolean.merge_p1 green boolean.merge_p2 green boolean.merge_p5 green boolean.topology_intersector_p1 green boolean.topology_intersector_p2 green geom.a_object green geom.attribute green geom.context green geom.object green intersect.point_class green topology.brep_p1 green topology.brep_p2 green topology.edge green topology.edgeuse_p1 green topology.face_p2 partial topology.shell green
Soft dependencies: curve.curve_p2 green geom.extent1d green geom.tol green geom.vector3d green query.brep green topology.brep_cache green topology.brep_p3 partial topology.brep_p4 green topology.brep_p5 green topology.brep_p7 green topology.brep_p9 green topology.face_p4 green topology.topology green topology.topology_traverser green topology.vertex green
Dependents: blend.feature_executive blocked boolean.merge_p3 green
Soft dependents: boolean.api_brep partial offset.offset_executive_p2 partial primitive.primitive_creation_p2 green
Upstream functions
| Upstream function | Defined at | Lines | Rust (from the file header) |
|---|---|---|---|
SmMerge::ManifoldBoolean | SmMerge.cpp:2510 | 2596 | [manifold_boolean] |
Module file-header table (3 rows)
| Rust | Upstream |
|---|---|
[manifold_boolean] | SmMerge::ManifoldBoolean |
[ManifoldState] | the intersection and extracted-component members of SmMerge |
[ManifoldIntersector] | calls through SmMerge::m_vTI and shared merge stages |
Upstream tests reaching this unit
prog_test:my_test_bbu, SM_API_test:TestSmMaterialCensus, SM_API_test:TestSmPiecewiseMerge, SM_API_test:TestSmBooleanLists, SM_API_test:TestKernelMergeBrepsInvalidInput, SM_API_test:TestApiMergeBrepsInvalidOperation