geom.grid green
- Layer
- 4
- Upstream lines
- 876
- Functions
- 23
- Rust module
geom::grid
Status history
- todo 876 lines
- partial 876 lines
- green 876 lines
Source: crates/solidcore/src/geom/grid.rs
Upstream: source/SMLib/inc/SmGrid.h, source/SMLib/src/SmGrid.cpp
Port-plan notes
These notes preserve historical port measurements and limitations, not current CI results.
CO-PORTED in intersect.ray_tracer (PR #48): PARTIAL: difftest 615 cases (15 fixture + 600 generated), 613 pass bit-identical, 2 deferred (surface.surface_cache_p3 1: SmSurfaceGridElement::Init needs the patch data of a bare tree node; surface.surface_p2 1: ExpandHierarchy via smsurf_GetSurfaceCache, a DISPATCH GAP (the element holds a handle, no store turns it into the Surface); retagged by surface.surface_cache_p1, then by surface.surface_p1 in PR #43); 30k-seed run clean; no UNPORTED(geom.grid) stubs existed. 23 fns; largest: SmGrid::Setup3DDDA, SmGrid::Step3DDDA, SmSurfaceHierarchyElement::ExpandHierarchy, SmGrid::AddElement; cycle back-edges (call into later units; stub or co-port): geom.extent2d(2), surface.surface_cache_p1(2), surface.surface_p2(2), geom.polar_box(1), geom.pseudo_box(1), surface.surface_cache_p3(1), surface.surface_p7(1); unit-SCC #22 (220 units); 317 upstream test entry points reach this unit fix/geom-stale-stubs: Grid::expand_hierarchy_with ports SmSurfaceHierarchyElement::ExpandHierarchy over a caller-held surface cache tree with SmSurfaceGridElement::Init as a closure; GREEN (wire: grid surface elements): SmSurfaceGridElement::Init is SurfaceGridElement::init (+ from_leaf_data, moved from intersect::ray_tracer::surface_leaf); Grid::expand_hierarchy takes the surface's cache and Grid::add_surface_node is AddElement(SM_GE_SURFACE) from a tree node, so the two dispatch gaps are gone (ElementSource::Surface removed); RayTracer::add_surface_to_grid calls Grid::expand_hierarchy. The explicit-cache ops of the runner (define_surface .. observe_cached) run these on the real cache nodes of both sides, and the two fixtures that were deferred (raytracer_surface_hierarchy_expand, surface_leaf_element) are written with them; opaque add_hier surface labels stay dump-only. difftest 621 cases (21 fixture + 600 generated), 621 pass, 0 fail, 0 deferred, max_rel_err 0e0, all 621 compare values; 6000-seed run (6021 cases) clean.
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
- 621
- 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.extent3d green geom.object green geom.vector3d green
Soft dependencies: geom.tree green
Dependents: intersect.ray_tracer green
Soft dependents: blend.hcr green
Upstream functions
| Upstream function | Defined at | Lines | Rust (from the file header) |
|---|---|---|---|
SmGridElement::GetType | SmGrid.h:130 | 1 | [GridElement::type_code] |
SmPolygonGridElement::GetElement | SmGrid.h:196 | 1 | [GridItem] |
SmPolygonGridElement::Init | SmGrid.h:197 | 4 | GridElement::polygon (private) |
SmHierarchyGridElement::Init | SmGrid.h:231 | 4 | GridElement::hierarchy (private) |
SmUserGridElement::Init | SmGrid.h:255 | 4 | GridElement::user (private) |
SmHierarchyElement::SmHierarchyElement | SmGrid.h:300 | 3 | [HierarchyElement::new] |
SmHierarchyElement::~SmHierarchyElement | SmGrid.h:304 | 1 | Drop (implicit) |
SmSurfaceHierarchyElement::SmSurfaceHierarchyElement | SmGrid.h:333 | 5 | [HierarchyElement::new_surface] |
SmSurfaceHierarchyElement::~SmSurfaceHierarchyElement | SmGrid.h:339 | 1 | Drop (implicit) |
SmVoxel::Init | SmGrid.h:370 | 4 | [Voxel], Default |
SmGrid::GetVoxel | SmGrid.h:480 | 4 | [Grid::voxel] |
SmGrid::GetVoxelBBox | SmGrid.h:513 | 11 | [Grid::voxel_bbox] |
SmSurfaceHierarchyElement::ExpandHierarchy | SmGrid.cpp:40 | 96 | [Grid::expand_hierarchy], [Grid::expand_hierarchy_fetched] |
SmSurfaceGridElement::Init | SmGrid.cpp:252 | 43 | [SurfaceGridElement::init] |
SmGrid::SmGrid | SmGrid.cpp:303 | 60 | [Grid], [Grid::new] |
SmGrid::~SmGrid | SmGrid.cpp:369 | 31 | Drop (implicit) |
SmGrid::FindVoxelsInBox | SmGrid.cpp:407 | 37 | [Grid::find_voxels_in_box] |
SmGrid::AddHierarchyElement | SmGrid.cpp:467 | 40 | [Grid::add_hierarchy_element] |
SmGrid::AddElement | SmGrid.cpp:525 | 67 | [Grid::add_element], [ElementSource] |
SmGrid::Setup3DDDA | SmGrid.cpp:610 | 203 | [Grid::setup_3ddda] |
sm_InsertionSort | SmGrid.cpp:820 | 25 | insertion_sort (private) |
SmGrid::Step3DDDA | SmGrid.cpp:881 | 170 | [Grid::step_3ddda], [StepHits] |
SmGrid::GetVoxelAddress | SmGrid.cpp:1143 | 61 | [Grid::voxel_address] |
Module file-header table (29 rows)
| Rust | Upstream |
|---|---|
[Grid], [Grid::new] | SmGrid, SmGrid::SmGrid |
Drop (implicit) | SmGrid::~SmGrid |
[Grid::voxel] | SmGrid::GetVoxel |
[Grid::voxel_bbox] | SmGrid::GetVoxelBBox |
[Grid::voxel_address] | SmGrid::GetVoxelAddress |
[Grid::find_voxels_in_box] | SmGrid::FindVoxelsInBox |
[Grid::add_element], [ElementSource] | SmGrid::AddElement, SmGridElementType |
[Grid::add_surface_node], [Grid::add_surface_element] | SmGrid::AddElement(SM_GE_SURFACE) (from a tree node; from prepared leaf data) |
[Grid::add_hierarchy_element] | SmGrid::AddHierarchyElement |
[Grid::expand_hierarchy], [Grid::expand_hierarchy_fetched] | SmSurfaceHierarchyElement::ExpandHierarchy |
[Grid::expand_hierarchy_with] | SmSurfaceHierarchyElement::ExpandHierarchy over a caller-held surface cache tree |
[Grid::setup_3ddda] | SmGrid::Setup3DDDA |
AxisStep (private) | one axis of SmGrid::Setup3DDDA |
[Grid::step_3ddda], [StepHits] | SmGrid::Step3DDDA |
insertion_sort (private) | sm_InsertionSort |
[Dda] | the 3DDDA scratch members of SmGrid |
[Voxel], Default | SmVoxel, SmVoxel::Init |
[GridElement] | SmGridElement |
[GridElement::type_code] | SmGridElement::GetType |
[GridItem] | the derived SmGridElement classes and their GetElement |
GridElement::polygon (private) | SmPolygonGridElement::Init |
GridElement::hierarchy (private) | SmHierarchyGridElement::Init |
GridElement::user (private) | SmUserGridElement::Init |
[SurfaceGridElement] | SmSurfaceGridElement |
[SurfaceGridElement::init] | SmSurfaceGridElement::Init |
[SurfaceGridElement::from_leaf_data] | SmSurfaceGridElement::Init after the Bezier patch data (domain, boxes) is known |
[HierarchyElement::new] | SmHierarchyElement::SmHierarchyElement |
[HierarchyElement::new_surface] | SmSurfaceHierarchyElement::SmSurfaceHierarchyElement |
Drop (implicit) | ~SmHierarchyElement, ~SmSurfaceHierarchyElement |
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