solidcore

Units / geom

geom.grid green

Layer
4
Upstream lines
876
Functions
23
Rust module
geom::grid

Status history

Oct 12Nov 25
  1. todo 876 lines
  2. partial 876 lines
  3. 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 functionDefined atLinesRust (from the file header)
SmGridElement::GetTypeSmGrid.h:1301[GridElement::type_code]
SmPolygonGridElement::GetElementSmGrid.h:1961[GridItem]
SmPolygonGridElement::InitSmGrid.h:1974GridElement::polygon (private)
SmHierarchyGridElement::InitSmGrid.h:2314GridElement::hierarchy (private)
SmUserGridElement::InitSmGrid.h:2554GridElement::user (private)
SmHierarchyElement::SmHierarchyElementSmGrid.h:3003[HierarchyElement::new]
SmHierarchyElement::~SmHierarchyElementSmGrid.h:3041Drop (implicit)
SmSurfaceHierarchyElement::SmSurfaceHierarchyElementSmGrid.h:3335[HierarchyElement::new_surface]
SmSurfaceHierarchyElement::~SmSurfaceHierarchyElementSmGrid.h:3391Drop (implicit)
SmVoxel::InitSmGrid.h:3704[Voxel], Default
SmGrid::GetVoxelSmGrid.h:4804[Grid::voxel]
SmGrid::GetVoxelBBoxSmGrid.h:51311[Grid::voxel_bbox]
SmSurfaceHierarchyElement::ExpandHierarchySmGrid.cpp:4096[Grid::expand_hierarchy], [Grid::expand_hierarchy_fetched]
SmSurfaceGridElement::InitSmGrid.cpp:25243[SurfaceGridElement::init]
SmGrid::SmGridSmGrid.cpp:30360[Grid], [Grid::new]
SmGrid::~SmGridSmGrid.cpp:36931Drop (implicit)
SmGrid::FindVoxelsInBoxSmGrid.cpp:40737[Grid::find_voxels_in_box]
SmGrid::AddHierarchyElementSmGrid.cpp:46740[Grid::add_hierarchy_element]
SmGrid::AddElementSmGrid.cpp:52567[Grid::add_element], [ElementSource]
SmGrid::Setup3DDDASmGrid.cpp:610203[Grid::setup_3ddda]
sm_InsertionSortSmGrid.cpp:82025insertion_sort (private)
SmGrid::Step3DDDASmGrid.cpp:881170[Grid::step_3ddda], [StepHits]
SmGrid::GetVoxelAddressSmGrid.cpp:114361[Grid::voxel_address]
Module file-header table (29 rows)
RustUpstream
[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], DefaultSmVoxel, 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