You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
vec_distance_L2 returns Infinity (large) / 0 (tiny) for finite float32 inputs; vec_distance_L1 is exact on the same inputs #334
tiny: distinct vectors at 1e-25 separation → 0.0 (true 1e-25)
vec_distance_l1 with the identical inputs returns exact finite values
(2.0000000400817547e+20, 2e-25), which isolates the fault to the
squaring step. The tiny side silently corrupts KNN ranking and distance <= 0 comparisons; the large side propagates Infinity into
user expressions.
Environment
sqlite-vec 0.1.9 (pip wheel, loadable extension), Python 3.12, Windows x64
For anyone hitting this: the community fork vlasky/sqlite-vec fixes it in v0.2.9-alpha (changelog). The float32 kernels now return the sum of squared differences and the caller redoes a sum in double when it is Inf or below 2^24 * FLT_MIN, the bound under which subnormal terms can have mattered, so vec_distance_l2() returns 1e20 and 1e-25 for these inputs on the scalar, NEON and AVX paths. Ordinary vectors keep the same kernels and results.
Activity
Fix ghost rows, partition IN lists, UPDATEs on partition-keyed tables…
vlasky commentedon Nov 9, 2026
For anyone hitting this: the community fork vlasky/sqlite-vec fixes it in v0.2.9-alpha (changelog). The float32 kernels now return the sum of squared differences and the caller redoes a sum in double when it is Inf or below 2^24 * FLT_MIN, the bound under which subnormal terms can have mattered, so vec_distance_l2() returns 1e20 and 1e-25 for these inputs on the scalar, NEON and AVX paths. Ordinary vectors keep the same kernels and results.