Float32 rounding changes converted LanceDB dot range boundaries
Verified on Windows x64 with Python 3.11.7, lancedb 0.41.0, faiss-cpu 1.16.0, and NumPy 2.2.2. For one-dimensional query [1] and database scores immediately below, equal to, and above each float32 radius, FAISS IndexFlatIP.range_search returns only the just-above score. At radii 0.8 and 1.2, using Python double 1.0 - radius as LanceDB dot distance_range upper_bound also includes the exactly equal score; float32 subtraction float(np.float32(1)-np.float32(radius)) matches FAISS on those two fixtures. At radius 0.1, both double and float32 bounds omit the just-above score that FAISS returns. The mathematical mapping is 1-r, but float32 boundary rounding means neither the ordinary double conversion nor a float32 subtraction workaround guarantees exact parity for every threshold. Reproduce with dot_range_float32_boundary.py. This is specific to the tested versions and fixture.