-
-
Notifications
You must be signed in to change notification settings - Fork 0
Determinism Snapping and Pooling
DESKTOP-5KM6RA3\david edited this page Apr 25, 2026
·
2 revisions
This page covers the three invariants that shape most of GridForge's implementation choices:
- deterministic math and ordering
- snapped spatial boundaries
- aggressive object and collection reuse
GridForge is built around fixed-point math and explicit ordering.
In practice that means:
- core spatial math uses
Fixed64,Vector2d, andVector3d - grid creation and tracing logic work from snapped fixed-point bounds
- behavior must stay stable across both
netstandard2.1andnet8.0
GridConfiguration orders incoming bounds on construction, and GridWorld snaps them during registration.
That snapped result affects:
- grid dimensions
- duplicate grid detection
- world-space containment tests
- tracer coverage
- blocker coverage
- local voxel index resolution
GridWorld establishes voxel size for that world instance.
That means:
- all later grid configuration snapping in that world depends on that value
- all later voxel index math in that world depends on that value
- changing voxel size is a world-level choice, not a local tweak
When tests or tools need a different voxel size, create a separate world or reset and recreate the current one.
Pooling in GridForge is not an optimization sprinkled on top. It shapes the object lifecycle.
The internal pools cover types such as:
VoxelGridVoxelScanCell- scan-cell maps
- neighbor arrays
- temporary query lists and hash sets
Every new mutable field introduced into a pooled type needs a matching reset story.
- Was the current
GridWorldcreated with the voxel size you think it was? - What are the snapped bounds after normalization?
- Is the queried world-space position exactly on a boundary?
- Are you looking at a pooled object or temporary collection after its intended lifetime?
- Did a previous test, tool run, or benchmark leave world state active longer than intended?