whitetree: dynamic exact kNN without rebuilds, 40-300x faster than sklearn BallTree

monononon34 · reddit · 2026-09-14

The author open-sourced whitetree, a library for exact Mahalanobis nearest-neighbour search on streaming low-dimensional data: whiten with the Cholesky factor of covariance, then keep multiple scipy cKDTrees with a geometric size ratio of 32 so inserts/deletes never force full rebuilds.

Key measured findings:

Pure numpy/scipy, single-writer multi-reader, tombstone deletes, results exactly match a static cKDTree. Code and design notes on GitHub.

Original post →

More from Research

Research channel →