solidcore

Units / surface

surface.surface_p3 green

Layer
30
Upstream lines
1,794
Functions
13
Rust module
surface::surface::p3

Status history

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

Source: crates/solidcore/src/surface/surface/p3.rs

Upstream: source/SMLib/inc/SmSurface.h, source/SMLib/src/SmSurface.cpp

Port-plan notes

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

2026-11-15: the WR-407 fold rule is the default and its flag is removed (plan/upstream-issues/WR-407--addendum-2026-11-15-flag-removed-cover-refuses-folded-continuation.md); 6 goldens rows refuse, gen2303 keeps its cover. Earlier: GREEN again (2026-10-26, WR-407 opt-in):the fold refusal runs only with Kernel::fixes.cover_refuses_folded_continuation (off by default = pinned SMLib), so surface.surface_p3 cases=2500 passed=2500 failed=0 deferred=0 known_mismatch=0 max_rel_err=0e0 with_values=2500; the 7 known mismatches and their ratchet waivers are removed (plan/findings/surface.surface_p3--cover-refuses-a-folded-continuation--addendum-2026-10-26-opt-in.md). Before that: PARTIAL (2026-10-26, #434: CoverCoincidentSurface refuses a folded continuation, SolidCraft change from tangency-labs/smlib 1b6f5fa): PASS->PARTIAL surface.surface_p3 cases=2500 passed=2493 failed=0 deferred=0 known_mismatch=7 max_rel_err=0e0 with_values=2493 no_values=0 vacuous=0 (was GREEN cases=2500 passed=2500). The 7 generated cases (gen0041, gen1448, gen1514, gen1567, gen2066, gen2303, gen2376) cover a domain whose continuation folds: C++ success=true, the port refuses (the surface's Du x Dv normal turns back between neighbouring samples of the 21 x 21 grid over the domain the merge would use). They are declared divergences (crates/difftest/known_mismatches/surface.surface_p3.toml, plan/findings/surface.surface_p3--cover-refuses-a-folded-continuation.md) and become deviation(#434) when difftest has that outcome (#989). The two swept-wall cases of tangency-labs/solidcore#434 merge onto the planar top's extension, which does not fold, so the rule changes no other reported case. 13 fns; largest: SmSurface::CoverCoincidentSurface, SmSurface::GetSingularities, SmSurface::LocalSurfaceSurfaceIntersect, SmFindPSNormalENFO::Evaluate; cycle back-edges (call into later units; stub or co-port): topology.face_p1(1); unit-SCC #22 (220 units); 317 upstream test entry points reach this unit; CO-PORTED in surface.surface_p4 (PR #49): smsurf_IsPointOnNormal -> surface::surface::p4::is_point_on_normal; SmSurfaceEval::EvalNormal -> surface::surface::p4::SurfaceEval::eval_normal; PORTED (PR #52): 11 fns in surface::surface::p3 (SmDropCurveFail::Copy is Clone; smsurf_IsPointOnNormal and SmSurfaceEval::EvalNormal were co-ported in surface.surface_p4), difftest 2500 cases: 2334 compared, 166 deferred (all SmSurface::CoverCoincidentSurface: the plane STEPInversion is wired through surface.surface_p4 (PR #49), but the point solve under it still reaches SmSurface::GlobalPointSolve_1 (UNPORTED(surface.surface_point_solve_p3) in surface::surface::p4); those cases are not yet compared), perturb mode detects all 2334; back-edges wired: SmSurface::EvaluateGeometric and LocalPlaneSurfaceIntersect into intersect.surface_intersector_p1, SmSurface::EvaluateNormalSection into nurbs.b_spline_surface_n_lib_p2 and surface.curve_bounded_surface (with EvaluateGeometric), SmSurface::GetSingularities into surface.trim_srf_cache; SmSurface::LocalSurfaceSolve wired into intersect.surface_intersector_p2; SmFindPSNormalENFO and SmSSSIntersectENFO implement EvalNFunctions on the structs of surface.surface_p1 (as does surface.surface_p4 for SmSSPIntersectENFO and SmSSNormalizeENFO); sm_CrossedSeamOrPole is surface.surface_p1's; FFI safety (review of PR #52): the surface-of-revolution block (kind 3) is accepted only by surface_p3's validators (p4/p7 shims have no such branch: kind index stays 0..=2 there, test kind_3_rejected); the p3 shim throws BadInput (SC_ERR_ARG) when SmSurfOfRevolution::CreateCanonical fails (generator on the axis) instead of dereferencing NULL (test generator_on_axis_is_an_error); report regenerated: 2500 cases, 2334 compared, 166 deferred, perturb 2334/2334 BACK-EDGES INTO surface.surface_p5 (PR #52, after merging surface_p4/#49 and surface_p5/#50): GetSingularities (IsSingularity; ignored() with SM_SS_NONE), the SmFindPSNormalENFO Newton solve of LocalPointSolve_0 (SER -> ?), LocalSurfaceSurfaceIntersect from UV guesses (status ignored), CoverCoincidentSurface (CoverOtherCoincidentSurface takes both surfaces &mut and a &Kernel; topology.edge is_topological takes &mut Brep + &Kernel) and EvaluateNormalSection (sm_FilterSolution, status ignored); IsSingularity/EvaluateNormalAtSingularity take &Kernel; no UNPORTED(surface.surface_p3) stubs remain. surface_p3 itself: 2500 cases, 2334 pass, 166 deferred (surface.surface_point_solve_p3 166). --green 169 units, 0 failed. Re-run after merging PR #106 (surface.surface_point_solve_p3 wired, 2026-10-15): 2500 cases, 2497 pass, 3 deferred (surface.surface_p8 3), 0 failed, max_rel_err 0. Re-run after wiring PR #118 (surface.surface_p8 and its back-edges, GlobalPointSolve_0 included): 2500 cases, 2500 pass, 0 deferred, 0 failed, max_rel_err 0; green. CoverCoincidentSurface's SmFace::RemoveUVTrimCurves (fix/surface-face-handles): Surface::cover_coincident_surface_deferring_trims returns the owner face in CoverCoincident::remove_uv_trim_curves_of for the caller holding the B-rep to run topology::face::p1::remove_uv_trim_curves right after; cover_coincident_surface still returns Unported(topology.face_p1) for a face-owned success. Callers to switch: primitive/primitive_creation/p1/primitives.rs (CreatePrimitive coincident covers).

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
2,507
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: geom.extent1d green geom.extent2d green geom.extent3d green geom.local_solve_nd green geom.matrix green geom.object green geom.vector2d green geom.vector3d green surface.surface_p1 green surface.surface_p2 partial surface.surface_p7 green

Soft dependencies: geom.geom_utility_p1 green geom.solution_array green geom.tol green nurbs.b_spline_surface_p1 green surface.plane_p1 partial

Dependents: blend.fillet_removal green intersect.surface_drop_lib_p1 partial intersect.surface_drop_lib_p3 green surface.offset_surface green surface.surface_assert_valid green surface.surface_p11 green surface.surface_p8 green

Soft dependents: blend.fillet_standard_solver_p1 green heal.face_props green heal.heal_data_p3 green intersect.curve_class_p2 green intersect.ray_tracer green intersect.surface_drop_lib_p2 green intersect.surface_intersector_p1 green intersect.surface_intersector_p2 partial intersect.surface_silhouette green primitive.primitive_creation_p1 green query.loop green topology.brep_p9 green topology.edgeuse_p3 green topology.face_p3 green topology.face_p4 green topology.vertexuse green

Upstream functions

Upstream functionDefined atLinesRust (from the file header)
SmDropCurveFail::CopySmSurface.h:1713DropCurveFail::copy ([Clone])
SmSurfaceEval::EvalNormalSmSurface.cpp:196574[is_point_on_normal](super::p4::is_point_on_normal), [SurfaceEval::eval_normal](super::p2::SurfaceEval) (co-ported in p4)
smsurf_IsPointOnNormalSmSurface.cpp:4308147[is_point_on_normal](super::p4::is_point_on_normal), [SurfaceEval::eval_normal](super::p2::SurfaceEval) (co-ported in p4)
SmSurface::CoverCoincidentSurfaceSmSurface.cpp:7964330[Surface::cover_coincident_surface_deferring_trims], [CoverCoincident], [ContinuationFold]
SmSurface::EvaluateGeometricSmSurface.cpp:1090836[Surface::evaluate_geometric], [evaluate_geometric_of]
SmSurface::EvaluateNormalSectionSmSurface.cpp:1148241[Surface::evaluate_normal_section], [evaluate_normal_section_of], [SurfaceNormalSection]
SmSurface::GetSingularitiesSmSurface.cpp:12384262[Surface::get_singularities], [Surface::get_singularities_of_face], [Singularities]
SmFindPSNormalENFO::EvaluateSmSurface.cpp:25849190[FindPsNormalEnfo] (EvalNFunctions)
SmSurface::LocalPlaneSurfaceIntersectSmSurface.cpp:27264123[Surface::local_plane_surface_intersect]
SmSurface::LocalSurfaceSolveSmSurface.cpp:28423184[Surface::local_surface_solve], [LocalSurfaceSolution]
SmSSSIntersectENFO::EvaluateSmSurface.cpp:28660147[SssIntersectEnfo] (EvalNFunctions)
SmSurface::LocalSurfaceSurfaceIntersectSmSurface.cpp:28814204[Surface::local_surface_surface_intersect], [LocalSssSolution]
smsurf_CheckShapeMatchSmSurface.cpp:3008453[check_shape_match]
Module file-header table (13 rows)
RustUpstream
[Surface::evaluate_geometric], [evaluate_geometric_of]SmSurface::EvaluateGeometric
[Surface::evaluate_normal_section], [evaluate_normal_section_of], [SurfaceNormalSection]SmSurface::EvaluateNormalSection
[Surface::get_singularities], [Surface::get_singularities_of_face], [Singularities]SmSurface::GetSingularities
[Surface::cover_coincident_surface_deferring_trims], [CoverCoincident], [ContinuationFold]SmSurface::CoverCoincidentSurface
[Surface::calculate_tight_bounding_box]SmSurface::CalculateTightBoundingBox
[check_shape_match]smsurf_CheckShapeMatch
[FindPsNormalEnfo] (EvalNFunctions)SmFindPSNormalENFO::Evaluate (struct: surface.surface_p1)
[SssIntersectEnfo] (EvalNFunctions)SmSSSIntersectENFO::Evaluate (struct: surface.surface_p1)
[Surface::local_plane_surface_intersect]SmSurface::LocalPlaneSurfaceIntersect
[Surface::local_surface_solve], [LocalSurfaceSolution]SmSurface::LocalSurfaceSolve
[Surface::local_surface_surface_intersect], [LocalSssSolution]SmSurface::LocalSurfaceSurfaceIntersect
DropCurveFail::copy ([Clone])SmDropCurveFail::Copy
[is_point_on_normal](super::p4::is_point_on_normal), [SurfaceEval::eval_normal](super::p2::SurfaceEval) (co-ported in p4)smsurf_IsPointOnNormal, SmSurfaceEval::EvalNormal

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