solidcore

Units / offset

offset.offset_executive_p2 partial

Layer
60
Upstream lines
1,847
Functions
6
Rust module
offset::offset_executive::p2

Status history

Oct 12Nov 25
  1. todo 1,846 lines
  2. partial 1,846 lines
  3. green 1,846 lines
  4. partial 1,847 lines

Source: crates/solidcore/src/offset/offset_executive/p2.rs

Upstream: source/SMLib/src/SmOffsetExecutive.cpp, source/SM_API/src/SmApiBrep.cpp

Port-plan notes

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

[2026-11-05 (#1435, #1556): +1 known mismatch, issue1528_box_cylinder_api_shell_2_volume_first: the volume moves within the requested 1e-6 (plan/findings/mass.integrator--split-at-surface-knots-default-moves-cases-2026-11-05.md)] [2026-11-05 (#1556): 2 more known mismatches: precise properties start each iso-u integral at the trims' lowest v, so volumes move (plan/findings/mass.integrator--trim-base-v-default-moves-cases-2026-11-05.md)] 2026-10-30 (FillGapEdgeuses past its empty check: 4 cases in fixtures/offset.offset_executive_p2/fill_gap_edgeuses.json, upstream Boolean/extrudeHoles1.smb and Fillet/open_shell.smb shell sources at distances that trim the offset faces back, so offset edge uses on one side of an edge are left uncovered by the other side; the gaps reach the candidate-vertex search with 1 candidate (rounded corners) or 0 (extended corners) and return before CreateCornerBlend, which stays unreached; MateEdges with several intersection curves and the TrimExtendedEdge marked-neighbour skip are already reached by shell_files.json and curved_primitives.json): 2026-10-27 (upstream .smb shell sources: a file fixture read by SmBrep::ReadFromFile in the shim and imported through the topology.brep_p1 export; 34 cases in fixtures/offset.offset_executive_p2/shell_files.json: the smOffsetTest.cpp ShellBrep set with extend and rounded corners, MateEdges with two intersection curves, PiecewiseMerge empty-SSI pairs naming a deleted face's surface, the BuildOffsetOfFaceuse 2D domain Boolean; problemShell6/7 are left out, the brep_p1 import rejects them; FillGapEdgeuses past its empty check stays unreached): GREEN offset.offset_executive_p2 cases=392 passed=388 failed=0 deferred=0 rejected=4. 2026-10-27 (cylinder and sphere primitive fixtures, SmApiCreateCylinder / SmApiCreateSphere and their ports; 36 fixture cases in fixtures/offset.offset_executive_p2/curved_primitives.json: rounded, extend-corner and direct extended offsets, API offset and shell, insets past the radius, tiny and huge scales, shell faces; the seams are tangent sectors, so DoExtendedOffset's extend-corner mapped-edge pass runs against C++; input face/edge kinds use the shim's IsKindOf classes on both sides): GREEN offset.offset_executive_p2 cases=358 passed=354 failed=0 deferred=0 rejected=4 known_mismatch=0. GREEN (2026-10-25, PR #1038): wired EdgeBrep::prepare_surface_solve_cache trimmed-tree construction for editing-enabled face-owned surfaces (resolving gen0121 on surface.trim_srf_cache) and ClassGeometry::{brep_id, owner_entity, owner_of} + FaceQueries::curve_edge_tolerance across EdgeBrep, ArenaPair/Objs, IntersectObjects/IntersectObjectsMut and LiveSurfaceContext/BrepFaceServices/SidedFaceServices/RaySurfaceContext (resolving all 11 remaining SmEdge::GetTolerance deferrals on topology.edge): PASS offset.offset_executive_p2 cases=322 passed=305 failed=0 deferred=0 max_rel_err=5.526424526698108e-15 with_values=305 no_values=0 vacuous=0 rejected=17; --perturb SENSITIVE 305/305. 2026-10-25 (RemoveExcessFaces' BrepPointSolve reaches the original's face caches): PARTIAL offset.offset_executive_p2 cases=322 passed=284 failed=0 deferred=20 known_mismatch=1 blocked_by=surface.trim_srf_cache(1),topology.edge(11),topology.edgeuse_p3(8) (was 254 / 51 with topology.face_p2(31) on the offset B-rep copy/merge stack; gen0235 is a known mismatch, plan/findings.md 'offset.offset_executive_p2 gen0235: imprint edge definition without its source topology'). 2026-10-25 (Issue #833 resolved): BrepQuery::of_brep(_with_id), ArenaPair::brep_cache and transform_with_notifications consult Brep::geometry_owner_key(entity) so constructed and imported topology with live owner records participates in FindAndSetInfiniteRegion, ManifoldBoolean classification and SmTemporaryBrepTransform while foreign/unowned geometry remains filtered; the p2 runner projects live topology (SmBrep::GetRegions/GetFaces/GetEdges/GetVertices and SmFace::GetLoops) and passes a null original when the operation consumed the source in place: PARTIAL offset.offset_executive_p2 cases=322 passed=196 failed=0 deferred=109 rejected=17 known_mismatch=0 (max_rel_err=5.53e-15, blocked_by=boolean.merge_p3(42),topology.brep_p3(40),topology.face_p2(27)). 2026-10-24 (NormalizedEvaluate wired, PR #830): RemoveExcessFaces and FillGapEdgeuses evaluate through topology::edgeuse::p3 and the point solve keys the original by its geometry owners; the 29 NormalizedEvaluate deferrals now reach SmSurfaceCache::GetFace for a face-owned surface (topology.face_p2, 27) or SmMerge::PiecewiseMerge (2): PARTIAL offset.offset_executive_p2 cases=322 passed=188 failed=0 deferred=114 rejected=17 known_mismatch=3. 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 offset.offset_executive_p2 cases=322 passed=188 failed=0 deferred=114 rejected=17 known_mismatch=3 (gen0166 added under the inset Difference reason). DoSolidOffset continuation and BuildOffsetOfEdgeuses cap faces (PR #737): local --unit run 322 cases, 188 passed, 0 failed, 115 deferred, 17 native constructor rejections, 2 known mismatches (gen0000/gen0003: the Rust ManifoldBoolean Difference drops a contained inset shell, plan/findings.md); max_rel_err=5.5e-15, no absolute floors. blocked_by=boolean.merge_p3(40),topology.brep_p3(40),topology.edgeuse_p3(29),surface.trim_srf_cache(4),query.face_p1(1),topology.edge(1). Box inputs use the real SmApiCreateBox port and sheets the real CreateFaceFromSurface, as the native fixtures do; returned B-reps and retained temporaries are compared by a count/kind/bounds projection (no harness result deferral remains). Earlier history: 6 fns; largest: SmOffsetExecutive::DoExtendedOffset, SmOffsetExecutive::DoSolidOffset, SmOffsetExecutive::ShellBrep, SmApiShellBrepFull; entry points SmApiOffsetBrepFull/SmApiShellBrepFull; 11 upstream test entry points. PR #201 with prerequisite #175 and main ca3bbd2b integrated: six dispatchers and executable prefixes, not completed constructive offset/shell assembly. Default native run: 322 cases (82 fixtures + 240 generated), 141 passed with values, 164 deferred, 17 native constructor rejections (8 box, 9 sheet), 0 failed; max_rel_err=0, rel_tol=1e-9, no absolute floors; sensitivity 141/141. The p2 report is byte-identical to c430024c. Certified parity remains null/selection/radius errors, executive flags/state, ordered provenance, ownership/presence and documented input geometry/purity projections; full box adjacency and returned-shape equivalence are not certified. Deferred: executive FaceuseOffset geometry/SSI bridge 100, query.brep 7, topology.brep_p3 47 (copy constructor 32, MakeWireEdgeVertex 15), topology.brep_p4 10. Copy-face mapping now calls the shared p1 live-kernel wrapper with real original/result identities; external p1 APIs retain None/Some semantics. Boolean tolerance configuration delegates to the landed merge_p2 MergeState::with_breps, preserving adapter options/flags/relations, signed operand order and explicit angular arithmetic; no constructor is duplicated or falsely deferred. New wire/face-copy callbacks use caller-supplied NotificationKeys, including namespace-backed callers. The three-way extended-face trim continuation is ported: native owning-list order and active marks, temporary ReplaceSurface(Keep, false), unrestricted trim-domain calculation, original-before-extension containment with EFF_ZERO, and real restoration before SM_ERR; restoration errors win. Its initial SmFace::Notify dependency still prevents live swap/restoration parity, so pure decision/mark/callback tests are not constructive-shape certification. The 100 FaceuseOffset self-deferrals remain an explicit separate kernel OffsetBrep/SSI-store bridge; #288 owns only its narrow vertex backend, coordinated in that PR. Caller records/attributes/contexts are real, result/source keys remain disjoint, and Boolean records are restored on errors and unwind; late deferred ownership reflects actual Rust slots, not native flag parity. Native box/sheet/wire counts are verified before selectors without size cutoffs or unprojected shell restrictions; the box finding is WR-209. Shared native-call serialization protects the observer, including the newly merged handwritten boolean_merge_p3 entry point. Empty results reuse the real infinite-region constructor. No fabricated topology, default context, tolerance loosening, or successful empty construction bypass is introduced. See plan/findings.md and reports/difftest/offset.offset_executive_p2.json. PR #452 on main 1b7f638e6 supersedes the FaceuseOffset self-boundary above: the shared creator now feeds owned surface/SSI output to the existing p1 builder through a private adapter, with real inset mate assignment and separate source/result notification keys. Canonical x86-64 CI run 39738195736 retains 322/141 passed/164 deferred/17 rejected/0 failed; all 100 self-deferrals reach actual callees, 50 SmSurface::DropCurve and 50 the non-B-spline CrvOnSurf constructor. Current deferred totals: intersect.surface_drop_lib_p3 65, curve.crv_on_surf 50, topology.brep_p3 32 (copy constructor), topology.brep_p4 11, harness:offset-result-adapter 6. The full canonical differential gate has 252 units, 134 passed, 118 partial, zero failed. The two stale MakeWireEdgeVertex runner-test assertions are updated to the observed DropCurve boundary; no obsolete stub is restored. The unit stays partial; no complete offset shape or new whole-operation comparison pass is claimed. UPDATE (PR #796): the merging PiecewiseMerge runs SmMerge::PiecewiseMerge (UNPORTED(boolean.merge_p3) wired) in a SweepStore over the caller stores: the offset temporary keeps the result identities (adopt_brep), the merge B-rep and the face B-reps take OffsetNotifications::merge_identities; the no-SSI relation names surfaces by merge surface identity. Fixes found on the way: MakeEdgeTopology and GlueEdgesGeneral delete the merged shell (orphan vertex shells changed the result shell count), side walls are built under the result identities, the store registers RegisterExistingSSI pairs for the next Merge. difftest (main a98c7cc81, after #783) 322 cases: 205 passed (was 188), 0 failed, 97 deferred (was 114: topology.brep_p3 42, topology.edgeuse_p3 34, query.face_p2 16, surface.trim_srf_cache 4, topology.shell 1), 17 rejected, 3 known mismatches (gen0000/gen0003/gen0166, unchanged); all 40 former SmMerge::PiecewiseMerge deferrals either compare (17) or stop at a later dependency (SmFace::PointClassify / CurveOnClassify, SmBrep::MergeBrep, GetOrCreateUVTrimCurve). 2026-10-25 (stacked on PR #796, main merged): RemoveExcessFaces now leaves the original's editing enabled after each edge's point solve (cpp:2069-2072), as the native input snapshot records once the merged result reaches it: PARTIAL offset.offset_executive_p2 cases=322 passed=223 failed=0 deferred=82 rejected=17 (main 196/109) blocked_by=query.face_p2(8),topology.brep_p3(42),topology.edgeuse_p3(5),topology.face_p2(27); max_rel_err=5.5e-15, no absolute floors. 2026-10-25 (working copy, MergeBrep, ReplaceImplicitOffsets): SmApiShellBrepFull copies its source with the real copy constructor (topology::brep::p3::copy_brep, original-to-copy map, attributes copied, analytics added) under caller-supplied ShellCopyIdentities and shells the copy; ShellBrep's sheet-solid continuation runs SmBrep::MergeBrep and the four-step StitchFaces loop; ReplaceImplicitOffsets builds each B-spline-base approximation and swaps it in through SmBrep::ReplaceSurface with PRE/POST_EDIT notifications (no current case reaches an offset surface there): PARTIAL offset.offset_executive_p2 cases=322 passed=254 failed=0 deferred=51 rejected=17 (was 223/82) blocked_by=query.face_p2(11),surface.trim_srf_cache(1),topology.edgeuse_p3(8),topology.face_p2(31); max_rel_err=5.5e-15, no absolute floors.

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
567
Stored error outcomes
0
Stored deferrals
0
Stored harness rejections
2
Known-failure entries
27

Metadata counts describe fields in the stored records; they are not passes or live failures.

Known failures (not blessed)

Source at f9704ee3b: golden JSONL · known-failure list.

Dependencies

Depends on: geom.context green geom.object green offset.offset_executive_p1 partial offset.offset_geometry_creation partial surface.surface_p2 partial topology.brep_p1 green topology.brep_p2 green topology.brep_p3 partial topology.brep_p4 green topology.edgeuse_p1 green topology.face_p2 partial topology.shell green topology.topology green

Soft dependencies: boolean.merge_p2 green boolean.merge_p4 green geom.extent2d green geom.tol green heal.stitch_p2 green topology.brep_p5 green topology.brep_p7 green topology.brep_p8 green topology.edge green topology.edgeuse_p2 green topology.face_p1 green topology.face_p3 green topology.proto_topology_p1 green

Dependents: audit.recursion green topology.brep_local_operation partial

Soft dependents: none

Upstream functions

Upstream functionDefined atLinesRust (from the file header)
SmOffsetExecutive::OffsetBrepSmOffsetExecutive.cpp:10130[offset_brep]
SmOffsetExecutive::ShellBrepSmOffsetExecutive.cpp:191170[OffsetExecutive::shell_brep], [ShellOutcome]
SmOffsetExecutive::DoSolidOffsetSmOffsetExecutive.cpp:380675[OffsetExecutive::do_solid_offset]
SmOffsetExecutive::DoExtendedOffsetSmOffsetExecutive.cpp:1105864[OffsetExecutive::do_extended_offset]
SmApiShellBrepFullSmApiBrep.cpp:236482[api_shell_brep_full], [ShellCopyIdentities]
SmApiOffsetBrepFullSmApiBrep.cpp:245226[api_offset_brep_full]
Module file-header table (9 rows)
RustUpstream
[offset_brep]SmOffsetExecutive::OffsetBrep
[OffsetExecutive::shell_brep], [ShellOutcome]both SmOffsetExecutive::ShellBrep overloads, including input ownership
[OffsetExecutive::do_solid_offset]SmOffsetExecutive::DoSolidOffset
[OffsetExecutive::do_extended_offset]SmOffsetExecutive::DoExtendedOffset
order_edgeuses_by_brep (private)sm_OrderEdgeusesByBrep
[api_shell_brep_full], [ShellCopyIdentities]SmApiShellBrepFull (and its working copy's identities)
[api_offset_brep_full]SmApiOffsetBrepFull
[offset_brep_simple], [shell_brep_simple], [shell_brep_simple_reporting], [SimpleShell], [local_operation_simple](not upstream) the API calls with their own notification identities
[faceuse_offset]SmOffsetGeometryCreation::FaceuseOffset over the owned B-rep

Upstream tests reaching this unit

SM_API_test:TestSmOffsetBrepFull, SM_API_test:TestSmShellBrepFull, prog_test:airfoil_offset, prog_test:my_local_op, prog_test:my_local_op_regression, prog_test:my_test_offset, pt_TestFiles/Fillet/nurb_box.smb, pt_TestFiles/Solids/box.smb, pt_TestFiles/Solids/cylinder.smb, pt_TestFiles/offset_nurb.sms