solidcore

Units / surface

surface.trim_srf_cache green

Layer
23
Upstream lines
966
Functions
11
Rust module
surface::trim_srf_cache

Status history

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

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

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

Port-plan notes

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

2026-10-31 (nightly fuzz00295, run 41040730716: a surface with one rational control point timed out on the Rust side): the runner's Rust side applies solidcore_ffi surface_trim_srf_cache::validate to the same input as the C++ side, so an input the FFI refuses is a harness error on both sides; regression crates/difftest/tests/fuzz_corpus/surface.trim_srf_cache.json, plan/findings/surface.trim_srf_cache--mixed-rationality-rust-side-runs-past-fuzz-limit-fuzz00295.md. FACE-OWNED GetTree (wire: face-owned tree build, 2026-10-28): TrimSrfCache::get_tree_with_face is SmSurfaceCache::GetTree with the virtual BuildTree dispatched to build_tree_with_face; blend.hcr IsPointVisible uses it (its three deferrals compare again). 7 new direct native-face cases (build_mode 2..5 in the faces shim: GetTree after an editing-on build rebuilds standalone; editing turned off before GetTree implants the trims into the existing tree; trimmed tree is not rebuilt; GetTree builds a missing tree), all pass with values, max_rel_err=0. SurfaceCache::get_tree without a face keeps its Unported stub for a face-owned trimmed cache. Earlier: OWNED UV CURVE TOLERANCE (PR #1307, 2026-10-27): ARM64 native gate 772 cases, 772 value-bearing passes, 0 failed/deferred/rejected/vacuous, max_rel_err=0; all 762 baseline cases retained. Ten new nonlinear/control/reimplantation cases exercise the real owning-edge tolerance. EdgeuseInput transfers exact geometry and resolved optional tolerance into retention; BuildTree resolves edgeuse ownership, child subdivision reuses retained geometry without cloning, and handle mapping preserves its tolerance. Ownerless curves retain system tolerance. Native guards keep unrelated coordinate/scalar/z limits unchanged; the larger 1e11 coordinate envelope is isolated to ImplantEu. No core CurveCache or numerical tolerance change. Prior history: POLY-EDGE SUBDIVISION (PR #1016, 2026-10-25): 762 cases, 762 passed with values, 0 failed/deferred/rejected/vacuous, max_rel_err=0, rel_tol=1e-9, no absolute floors. All 630 prior cases retain their value coverage; 128 separate fixed-seed cases and 4 tolerance-boundary fixtures now exercise polygon implantation followed by repeated subdivision, including mixed edge-use lists, zero/negative native tolerances, different original/cache surfaces and handle mapping. SubdivideNode reimplants parent polygon edges head first into child 1 then child 2, preserving the parent lists. Endpoints, tolerance and an exact bounded evaluation copy of the original face surface are retained per handle; reimplant after edits to refresh the snapshot. GREEN (PR #594, 2026-10-23): canonical Linux CI run 39936710786 on 3eefd5fc8 (includes upstream/main 38b0745b3) compares 630 cases, 630 passed with values, 0 failed, 0 deferred, max_rel_err=0, rel_tol=1e-9, no absolute floors. The full differential gate passes all 260 units (177 passed, 83 partial, 0 failed); native runner tests pass (253 passed, 0 failed, 32 ignored), including direct C++/Rust equality for built/unbuilt nonplanar face interior/exterior/edge/vertex queries. That run's only failure was a test-only Clippy chunks_exact suggestion, corrected with this promotion; final-head all-seven CI remains the review gate. All 628 original cases and 568 original passes are retained: 60 former runner-only SmBrep::CreateFaceFromSurface deferrals (4 file fixtures, 56 generated) now compare, plus 2 new saddle boundary fixtures. OpIn::Face independently builds real topology through landed brep p8 and uses the existing BrepCacheFace; build=false stays lazy, statuses/object types/owner tolerances are preserved. No production kernel, shared native_face helper, C++/FFI, seeds, guards or tolerances changed; no primitive/sweep parity improvement is claimed. No local native tests, baseline repeats or C++ builds were run. Prior #533/#537 already supplied the shared trimmed-cache machinery and 568 baseline passes, including seven real holed/nonplanar face probes; those gains are not attributed to this follow-up. Earlier notes' construction/classifier gaps are superseded by the landed adapters and this measured evidence. 11 fns; largest: SmTrimSrfCache::ImplantEdgeuse, SmTrimSrfCache::BuildTree, SmTrimSrfCache::ImplantVertexuse, SmTrimSrfCache::ImplantPolyEdge; cycle back-edges: intersect.point_class(7), query.poly(5), surface.surface_cache_p3(5), query.face_p2(2), topology.face_p2(2), topology.face_p4(2), topology.loopuse(2), topology.vertexuse(2), query.tess(1), surface.surface_p1(1), surface.surface_p3(1), topology.edgeuse_p1(1), topology.face_p3(1), topology.vertex(1); unit-SCC #22 (220 units); 319 upstream test entry points reach this unit.

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
779
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_cache green geom.extent1d green geom.extent2d green geom.extent3d green geom.object green geom.tol green geom.vector2d green geom.vector3d green surface.surface_cache_p1 green

Soft dependencies: geom.tree green nurbs.b_spline_curve_p1 green nurbs.b_spline_curve_p2 green surface.surface_p2 partial

Dependents: query.tess green

Soft dependents: surface.surface_cache_p3 green surface.surface_p1 green

Upstream functions

Upstream functionDefined atLinesRust (from the file header)
SmTrimSrfCache::GetTypeSmTrimSrfCache.h:1491[TYPE], [TYPE_STRING], [TrimSrfCache::type_code], [TrimSrfCache::type_string]
SmTrimSrfCache::GetTypeStringSmTrimSrfCache.h:1491[TYPE], [TYPE_STRING], [TrimSrfCache::type_code], [TrimSrfCache::type_string]
SmTrimSrfCache::PointTestSmTrimSrfCache.cpp:5750[TrimSrfCache::point_test]
SmTrimSrfCache::BuildTreeSmTrimSrfCache.cpp:132289[TrimSrfCache::build_tree], [TrimSrfCache::build_tree_with_face]
SmTrimSrfCache::ImplantEdgeuseSmTrimSrfCache.cpp:438313[TrimSrfCache::implant_edgeuse]
SmTrimSrfCache::ImplantPolyEdgeSmTrimSrfCache.cpp:76472[TrimSrfCache::implant_poly_edge], [PolyEdgeInput]
SmTrimSrfCache::ImplantVertexuseSmTrimSrfCache.cpp:844124[TrimSrfCache::implant_vertexuse], [VertexuseInput]
SmTrimSrfCache::SmTrimSrfCacheSmTrimSrfCache.cpp:97845[TrimSrfCache::new]
SmTrimSrfCache::~SmTrimSrfCacheSmTrimSrfCache.cpp:102913Drop (implicit)
SmTrimSrfCache::PointClassifySmTrimSrfCache.cpp:104854[TrimSrfCache::point_classify]
SmTrimSrfCache::IsKindOfSmTrimSrfCache.cpp:11074[is_kind_of], [TrimSrfCache::is_kind_of]
Module file-header table (15 rows)
RustUpstream
[TrimSrfCache]SmTrimSrfCache
[TrimSrfCache::new]SmTrimSrfCache::SmTrimSrfCache
Drop (implicit)SmTrimSrfCache::~SmTrimSrfCache
[TYPE], [TYPE_STRING], [TrimSrfCache::type_code], [TrimSrfCache::type_string]GetType, GetTypeString (SM_COMMON)
[is_kind_of], [TrimSrfCache::is_kind_of]SmTrimSrfCache::IsKindOf
[TrimSrfCache::point_test]SmTrimSrfCache::PointTest
[TrimSrfCache::point_classify]SmTrimSrfCache::PointClassify
[TrimSrfCache::build_tree], [TrimSrfCache::build_tree_with_face]SmTrimSrfCache::BuildTree
[TrimSrfCache::get_tree_with_face]SmSurfaceCache::GetTree of a trimmed cache (virtual BuildTree)
[TrimSrfCache::point_test_in], [TrimSrfCache::point_classify_in]PointTest, PointClassify over the given face
[CacheFace]GetFace() and what the cache reads from the face and its B-rep
[TrimSrfCache::bind_face]GetFace() with an explicit caller-handle mapping
[TrimSrfCache::implant_edgeuse]SmTrimSrfCache::ImplantEdgeuse
[TrimSrfCache::implant_poly_edge], [PolyEdgeInput]SmTrimSrfCache::ImplantPolyEdge
[TrimSrfCache::implant_vertexuse], [VertexuseInput]SmTrimSrfCache::ImplantVertexuse

Upstream tests reaching this unit

prog_test:my_test_extent3d, prog_test:my_test_vector2d, 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