File size: 1,187 Bytes
039998a
 
 
 
 
 
 
1
2
3
4
5
6
7
8
# Rust linked-entity sector index

`SpatialIndex` builds the depth-four tree from finite absolute world bounds. It uses the recovered X/Y extent rule, the binary32 midpoint and upper-child-first allocation. Its link operation assigns a slot to the deepest strict matching sector. A box that touches a split remains at its parent. Relink removes the previous membership before adding the slot in the new sector.

Area queries scan each local list in newest-first order before visiting the upper and lower children. Inclusive overlap admits touching bounds, while an exact split-plane query skips both children after scanning their parent. A capacity warning stops the current traversal branch. A later sibling can produce another warning. Input capacity bounds output length.

The [parity report](rust-spatial-index.json) compares all six recorded Linux trees and 128 recorded placement slices. Eleven composition fixtures check local and child order, exact touching, relink, unlink and capacity behavior. These fixtures supply absolute bounds. The runtime still needs entity generation ownership, map-derived visibility and the bound producer before this index can serve gameplay calls.