10M particles, naive all-pairs collision detection: 100 trillion comparisons per frame. Sparse spatial hash grid: O(1) inserts, O(k) neighbor queries, 60,000x memory reduction over dense grids, real-time at 60 fps. Cells are addresses, not allocations: only occupied buckets exist. C++20 header-only, generalized to N dimensions.
https://metafunctor.com/post/2025-11-11-sparse-spatial-hash/








