fixes#328
Problem:
SQ8 metadata (squared_sum, sum) was computed from pre-rounded float
values, causing mismatch with actual stored int8 values. On asymmetric
datasets (e.g. OpenAI 1536D where |x_min| >> x_max), this leads to
severe recall drop.
Solution:
Move std::round before accumulating squared_sum and sum.
Co-authored-by: rayx <rui.xing@alibaba-inc.com>
* support ios build
* fix: ci
* fix: update build_ios.sh
* fix: pr
* fix: cmake minimum version
* fix: cmake minimum version
* fix: cmake minimum version in ci
* fix: add all test in ci
* fix: ci
* feat: add Python 3.13 and 3.14 support
- Add Python 3.13 and 3.14 classifiers to pyproject.toml
- Add cp313 and cp314 cibuildwheel build targets
- Add Python 3.13 and 3.14 to CI test matrix
- Enable allow-prereleases for setup-python (required for 3.14 alpha)
Signed-off-by: Maxime Grenu <maxime.grenu@gmail.com>
* ci: retrigger (flaky Int4SquaredEuclideanMetric tolerance on linux-x64)
Signed-off-by: Maxime Grenu <maxime.grenu@gmail.com>
* fix: widen Int4 distance matrix test tolerance from 1e-4 to 5e-4
Int4 quantization uses only 16 levels per dimension (vs 256 for Int8),
resulting in larger rounding errors in distance computations. The
previous 1e-4 absolute tolerance was too tight and caused flaky
failures (observed diff: 1.22e-4 on values ~523.77). The Int8 test
already has this EXPECT_NEAR commented out, relying solely on the
relative IsAlmostEqual check.
Signed-off-by: Maxime Grenu <maxime.grenu@gmail.com>
* fix: remove allow-prereleases flag for Python 3.14
Python 3.14 is now a stable release (v3.14.3, released Oct 2025),
so allow-prereleases: true is no longer needed in setup-python.
Signed-off-by: Maxime Kawawa-Beaudan <maxkb@meta.com>
Signed-off-by: Maxime Grenu <maxime.grenu@gmail.com>
---------
Signed-off-by: Maxime Grenu <maxime.grenu@gmail.com>
Signed-off-by: Maxime Kawawa-Beaudan <maxkb@meta.com>