surface.surface_cache_p3 green
- Layer
- 25
- Upstream lines
- 1,703
- Functions
- 7
- Rust module
surface::surface_cache::p3
Status history
- todo 1,703 lines
- partial 1,703 lines
- green 1,703 lines
Source: crates/solidcore/src/surface/surface_cache/p3.rs
Upstream: source/SMLib/src/SmSurfaceCache.cpp
Port-plan notes
These notes preserve historical port measurements and limitations, not current CI results.
BOUND (PR fix/km-binormal, 2026-10-22): MAX_SUBDIVISION_NODES is 2^22 on 64-bit targets (2^20 on 32-bit/wasm32): upstream fixtures reach 2 014 255 nodes (topology.edgeuse_p3 1e-4-scale faces, measured on the C++ build), above the old 2^20. GREEN (PR #140 second review, surface cache iso curves of planes and surfaces of revolution wired): all deferrals compared, 600/600 pass bit-identical, 0 deferred. query.tess wired (PR #83): 600 cases, 488 bit-identical, 0 failed, 112 deferred (surface.surface_cache_p1 8, surface.surface_p3 15, surface.surface_p5 32, surface.surface_p6 57); the 38 subdivision-surface split cases now compare. Review validation: 600 cases, 450 bit-identical, 0 failed, 150 deferred (query.tess 38, surface.surface_cache_p1 8, surface.surface_p3 15, surface.surface_p5 32, surface.surface_p6 57); --perturb detected 445/445; max_rel_err=0. surface_p9 FindTessellationSplits wired with the caller Kernel; remaining deferrals are recorded in the current report. Historical notes: PARTIAL: difftest 600 cases (600 generated), 445 pass bit-identical, 0 failed, 155 deferred (surface.surface_p6 57: SmSurface::CalculateContinuities in tree builds; surface.surface_p1 39: GetFace / SnapToKnots; surface.surface_p5 32: SmSurface::IsSingularity in Bezier approximations; surface.surface_p3 15: GetSingularities in pole search; surface.plane_p1 11; surface.surface_p9 1); --perturb 445/445 detected; every Build and Get case defers on CalculateContinuities, so the first-generation node loop of BuildTreeBase, the BuildTree cleanup and GetTree are not yet compared against C++ (only SubdivideNode, SubdivideToTolerances and FindUVNodes on hand-built start nodes are); start nodes over planes are generated too (an SmPlane is an SmBSplineSurface); wired UNPORTED(surface.surface_cache_p3) in surface.trim_srf_cache (BuildTree, FindUVNodes, SubdivideNode) and surface.surface_cache_p1 (GetTree); not wired: the bare-tree patch data reads in geom.tree (GetFirstBezierPatch), geom.grid (SmSurfaceGridElement::Init) and surface.surface_p2 (GetPolarBox) need a patch hand-over from the surface cache to the tree (DISPATCH GAP comments, Unported tagged with the owning units surface.surface_cache_p1 / nurbs.b_spline_surface_p1; see findings.md); after merging main: wired UNPORTED(surface.surface_cache_p3) GetTree in intersect.surface_tracer (FindInteriorCurves now takes &mut SurfaceCache and calls SurfaceCache::get_tree; its counts unchanged, 398 pass / 29 deferred), and re-tagged the three surface.surface_p7 sites to surface.surface_p1 (the SmSP/SmSSGlobalSolver constructors must hand the solvers the caches holding the node patches; GetTree via surface_tree waits on SmSurface::CacheMakeOrValidate for a cache store; surface_p7 unchanged, 3039 pass / 621 deferred); trim_srf_cache test updated: ImplantVertexuse away from poles now completes (FindUVNodes + Evaluate1stDerivatives both ported); 7 fns; largest: SmSurfaceCache::SubdivideNode, SmSurfaceCache::BuildTreeBase, SmSurfaceCache::SubdivideToTolerances, SmSurfaceCache::BuildTree; cycle back-edges (call into later units; stub or co-port): surface.surface_p1(2), query.tess(1), surface.surface_p6(1); unit-SCC #22 (220 units); 317 upstream test entry points reach this unit [surface.surface_p6 wired (PR #92), merged with query.tess: 600 cases, 545 pass, 0 failed, 55 deferred (surface.surface_cache_p1 8, surface.surface_p3 15, surface.surface_p5 32)] Re-run with surface.surface_p5's back-edges wired (PR #50): cases=600 passed=448 failed=0 deferred=152 max_rel_err=0e0 blocked_by=query.tess(38),surface.surface_cache_p1(8),surface.surface_p3(47),surface.surface_p6(57),surface.surface_p9(2). Re-run (PR #52, after merging surface_p4/#49 and surface_p5/#50): 600 cases, 582 pass, 18 deferred (curve.iso_curve 10, surface.surface_cache_p1 8). surface.surface_p11 (PR #120, after merging main with surface.surface_p3): SubdivideToTolerances stops past MAX_SUBDIVISION_NODES (2^20) tree nodes with InvalidInput (an extreme-scale surface was split into millions of patches; Rust aborted on a 3.5 GB allocation): cases=600 passed=592 failed=0 deferred=8 (surface.surface_cache_p1 8).
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
- 600
- 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.object green geom.tree green nurbs.b_spline_surface_p1 green nurbs.nurbs_srf green surface.surface_cache_p1 green surface.surface_cache_p2 green surface.surface_p2 partial
Soft dependencies: geom.extent3d green geom.pseudo_box green geom.vector2d green nurbs.b_spline_surface_p2 green surface.trim_srf_cache green
Dependents: query.tess green surface.surface_p1 green
Soft dependents: intersect.curve_class_p9 green intersect.ray_tracer green intersect.surface_intersector_p5 green intersect.surface_tracer green query.face_p2 green surface.surface_p7 green surface.surface_p8 green
Upstream functions
| Upstream function | Defined at | Lines | Rust (from the file header) |
|---|---|---|---|
SmSurfaceCache::FindUVNodes | SmSurfaceCache.cpp:1512 | 98 | [SurfaceCache::find_uv_nodes], [SurfaceCache::find_uv_nodes_built] |
SmSurfaceCache::SubdivideNode | SmSurfaceCache.cpp:2423 | 817 | [SurfaceCache::subdivide_node] |
SmSurfaceCache::SubdivideToTolerances | SmSurfaceCache.cpp:4502 | 239 | [SurfaceCache::subdivide_to_tolerances], [SurfaceCache::subdivide_to_tolerances_with] |
SmSurfaceCache::BuildTreeBase | SmSurfaceCache.cpp:5003 | 305 | [SurfaceCache::build_tree_base], [SurfaceCache::build_tree_base_with], [TreeBase] |
SmSurfaceCache::BuildTree | SmSurfaceCache.cpp:5322 | 130 | [SurfaceCache::build_tree], [SurfaceCache::build_tree_with] |
SmSurfaceCache::GetTree | SmSurfaceCache.cpp:5459 | 28 | [SurfaceCache::get_tree] |
SmSurfaceCache::SmSurfaceCache | SmSurfaceCache.cpp:5698 | 86 | [SurfaceCache::new] (in part 1) |
Module file-header table (7 rows)
| Rust | Upstream |
|---|---|
[SurfaceCache::find_uv_nodes], [SurfaceCache::find_uv_nodes_built] | SmSurfaceCache::FindUVNodes |
[SurfaceCache::subdivide_node] | SmSurfaceCache::SubdivideNode |
[SurfaceCache::subdivide_to_tolerances], [SurfaceCache::subdivide_to_tolerances_with] | SmSurfaceCache::SubdivideToTolerances |
[SurfaceCache::build_tree_base], [SurfaceCache::build_tree_base_with], [TreeBase] | SmSurfaceCache::BuildTreeBase |
[SurfaceCache::build_tree], [SurfaceCache::build_tree_with] | SmSurfaceCache::BuildTree |
[SurfaceCache::get_tree] | SmSurfaceCache::GetTree |
[SurfaceCache::new] (in part 1) | SmSurfaceCache::SmSurfaceCache |
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