41 Commits

Author SHA1 Message Date
rayx ec8a78ee08 refactor(diskann): decouple from libaio via dlopen (#532)
Co-authored-by: Zefeng Yin <yinzefeng.yzf@alibaba-inc.com>
2026-07-16 17:58:25 +08:00
egolearner 54340bb705 fix: IVF nprobe selected list scanning (#544) 2026-07-03 17:17:37 +08:00
Zhuanglin Zheng c54f5e16e9 rotate: add an optional random rotation feature in INT8/INT4 quantization method (#483)
Co-authored-by: rayx <rui.xing@alibaba-inc.com>
Co-authored-by: Jalin Wang <wangjianning.wjn@alibaba-inc.com>
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
2026-06-26 19:16:19 +08:00
Jalin Wang cdef8686c7 fix(diskann, hnsw sparse builder): lost-wakeup race in builder progress loops (#530) 2026-06-26 16:35:24 +08:00
Jalin Wang c72bcd1ce9 minor: typos in ivf searcher test(#526)
Co-authored-by: Copilot Autofix powered by AI <223894421+github-code-quality[bot]@users.noreply.github.com>
2026-06-25 19:25:10 +08:00
ZeFeng Yin cb0d3dbdb3 fix: some bugs in ivf index (#524) 2026-06-24 21:39:27 +08:00
feihongxu0824 faadf62bd5 fix: use project root for diskann cmake paths (#464) 2026-06-08 09:54:16 +08:00
rayx e720c1fd20 feat: add diskann index (#369) 2026-06-04 20:52:43 +08:00
luoxiaojian 45a11212d2 fix(vamana): medoid entry, concurrent build crash and prune quality. (#433)
* fix(vamana): medoid entry point, concurrent build crash and prune quality

- Add DiskANN-standard medoid (centroid-closest point) as the persisted
  entry point, computed at dump time, replacing the fixed node-0 start.
- Fix data races on node_chunks_ / dist_chunks_ / node_chunk_bases_ during
  concurrent build: add mutexes with double-checked locking and pre-reserve
  capacity so the lock-free read fast path never hits reallocation.
- Fix RobustPrune for metrics with signed internal distance (quantized int8
  cosine): introduce IndexMetric::build_distance_offset() to shift distances
  into a non-negative range, restoring a geometrically meaningful
  occlude_factor and improving graph quality / low-ef recall.
2026-06-02 16:15:57 +08:00
ihb2032 df447a54e2 Refactor CPU feature detection to use an explicit x86 whitelist (#258)
* fix(cpu_features): refactor architecture detection to explicit x86 whitelist

Currently, `cpu_features.cc` assumes any non-ARM architecture is x86/x64, which leads to a fatal missing `<cpuid.h>` error on architectures like RISC-V.
This commit refactors the preprocessor macros to explicitly whitelist x86 architectures (`__x86_64__`, `__i386__`, `_M_X64`, `_M_IX86`). All other architectures (RISC-V, ARM, etc.) will now safely fall back to the default zero-initialization, allowing cross-compilation to succeed.

Signed-off-by: ihb2032 <hebome@foxmail.com>

* ci: Add RISE RISC-V runner

Introduce the RISC-V CI runner provided by the RISE project.
This enables automated testing and building for the RISC-V architecture.

Signed-off-by: ihb2032 <hebome@foxmail.com>

* ci: use python 3.12 for RISC-V64

Signed-off-by: ihb2032 <hebome@foxmail.com>

* ci: add RISC-V numpy dependencies

Signed-off-by: ihb2032 <hebome@foxmail.com>

* ci: add RISC-V wheel cache

Signed-off-by: ihb2032 <hebome@foxmail.com>

* ci: use pre-built RISE numpy wheel to speed up riscv builds

Signed-off-by: ihb2032 <hebome@foxmail.com>

* ci: use pre-built RISE cmake wheel to speed up riscv builds

Signed-off-by: ihb2032 <hebome@foxmail.com>

* ci: split RISC-V build and test into separate jobs

Signed-off-by: ihb2032 <hebome@foxmail.com>

* ci: fix

Signed-off-by: ihb2032 <hebome@foxmail.com>

* ci: fix

Signed-off-by: ihb2032 <hebome@foxmail.com>

* Update hnsw_streamer_test.cc

* ci: add cache

Signed-off-by: ihb2032 <hebome@foxmail.com>

* Update hnsw_streamer_test.cc

* Update test_gil_release.py

* ci: schedule workflow to run overnight

---------

Signed-off-by: ihb2032 <hebome@foxmail.com>
Co-authored-by: ZeFeng Yin <yinzefeng.yzf@alibaba-inc.com>
2026-06-02 11:51:25 +08:00
egolearner 23a1ef815e fix: validate reformer/entity ex_bits consistency in HnswRabitqStreamer (#436)
When a RabitqReformer trained with one total_bits is reused for an entity
configured with a different total_bits, the quantized data layout (ex_code
size) silently mismatches. This causes get_full_est() to interpret binary
quantization codes as floating-point factors, producing garbage distances
that sporadically drop search results.

Add an ex_bits() accessor to RabitqReformer and validate it against the
entity's ex_bits in HnswRabitqStreamer::open(), returning IndexError_Mismatch
on inconsistency. Fix the HNSWRabitqGeneral test to re-create a converter
and reformer with matching total_bits=2 for the third invocation. Add
TestExBitsMismatch to verify the mismatch is correctly rejected.
2026-06-02 11:12:15 +08:00
ZeFeng Yin 8ce8e3e228 chore: rm buffer manager (#437) 2026-06-02 09:51:41 +08:00
ZeFeng Yin 74beb2a828 feat: buffer storage write (#414) 2026-06-01 10:40:49 +08:00
egolearner 9aae7494ad chore: enable modernize-use-override and fix existing violations (#419)
Add modernize-use-override to .clang-tidy and apply fixes across
src/ and tests/: replace redundant virtual with override, annotate
missing override on derived methods, and drop redundant virtual on
already-overridden methods.
2026-05-21 19:05:32 +08:00
rayx 3e02031eb8 refactor: remove hamming metric (#365)
* refactor: remove binary metric

* fix: fix windows
2026-05-18 19:31:20 +08:00
luoxiaojian efab064676 feat: refac entity and impl Vamana. (#371) 2026-04-30 10:22:25 +08:00
ZeFeng Yin 005680522b feat: merge vector arrow buffer (#320) 2026-04-29 19:24:50 +08:00
ZeFeng Yin 07e986d3d5 fix: hnsw chunk size init (#372) 2026-04-29 10:50:16 +08:00
ZeFeng Yin 06e2845069 fix hnsw_streamer_test (#375) 2026-04-28 19:12:32 +08:00
egolearner 2b16ed39cd chore: rm hnsw-rabitq searcher/streamer (#367)
* chore: rm hnsw-rabitq searcher/streamer

* fix clang-tidy

* fix
2026-04-23 10:20:46 +08:00
ZeFeng Yin 4a4c02c1a5 chore: rm hnsw builder/searcher (#356) 2026-04-21 10:44:06 +08:00
Zihao Wang d29bffca39 fix(quantizer): use rounded int8 values for SQ8 metadata to fix recall drop (#329)
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>
2026-04-16 10:07:14 +08:00
feihongxu0824 6737810190 ci: refact android ci (#330) 2026-04-15 15:37:51 +08:00
feihongxu0824 30a20e14b0 feat: add iOS build support (#321)
* 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
2026-04-09 16:14:26 +08:00
ZeFeng Yin e2b0903fa5 fix: hnsw_streamer_test ut (#299) 2026-04-02 11:40:10 +08:00
Jalin Wang 8182cfff93 feat: windows support (#216)
Preliminary support for Windows with remaining TODOs
2026-03-30 20:47:34 +08:00
rayx 31aaa2febb feat: add euclidean one2many (#188)
* add euclidean one2many implementation
2026-03-23 20:20:48 +08:00
egolearner cca16341c0 build: use PROJECT_ROOT_DIR to fix build as submodule (#250) 2026-03-23 14:49:17 +08:00
rayx b49833bf56 Refactor/add scalar dist function and setup cmake with detailed cpu flag (#238)
* fix: add scalar

* fix: add avx512fp16

* fix: cmake config
2026-03-20 09:53:48 +08:00
egolearner e5ba11b6fe feat: add hnsw-rabitq support (#69)
* feat: add hnsw-rabitq

* undefine transform

* support config rotator type

* support sample_count

* fix ut

* refactor: update interface

* refactor: update interface

* update rabitq index params

* fix interface update

* fix searcher test

* fix streamer test

* streamer support bf and add more ut

* rm env check

* add collection ut

* add schema check

* add rabitq query param binding

* add integration test

* fix local_builder

* cleanup dist calculator

* add RaBitQ-Library submodule

* cleanup rabitq converter/reformer

* add files

* disable build on mac

* disable Feature_Optimize_HNSW_RABITQ

* disable python/tests/test_collection_hnsw_rabitq.py:13

* check avx2/avx512

* fix refine

* fix mac ci

* add dimension check

* fix mac ci

* fix ci

* add missing lib

* fix centroids selection for Cosine/InnerProduct

* rename hnsw-rabitq to hnsw_rabitq

* address comments

* fix compile

* fix rabitqlib name

* fix mac compile

* check avx2/avx512 support

* runtime check again compile-time

* check AUTO_DETECT_ARCH

* rm debug log

* fix

* rabitq use avx2 by default

* add missing file

* fix search_bf/group_by dist

* address comments

* fix typo

* address comments

* rabitq support disable id_map

* address comments
2026-03-19 17:21:42 +08:00
ZeFeng Yin 432de52c5f [enhance] buffer storage (#83) 2026-03-19 15:24:46 +08:00
rayx f9a5ef9432 fix: fix ut for sparse builder dump time (#237)
* fix ut for sparse builder dump time
2026-03-17 19:59:27 +08:00
feihongxu0824 fb0b900a80 fix(build): replace CMAKE_SOURCE_DIR with PROJECT_ROOT_DIR for subproject builds (#195) 2026-03-04 20:01:52 +08:00
feihongxu0824 24d877da5e fix: Replace VLAs with std::vector for MSVC compatibility and stack safety (#190) 2026-03-03 10:07:21 +08:00
ZeFeng Yin 596d5795e9 test: fix ut random float (#182) 2026-02-28 16:11:13 +08:00
ZeFeng Yin ba6acbf48f fix: ivf optimize (#169) 2026-02-27 17:35:52 +08:00
lichen2015 e7ad7cc31e fix: combined indexer should use key instead of index (#87)
Co-authored-by: yinzefeng.yzf <yinzefeng.yzf@alibaba-inc.com>
2026-02-12 10:38:05 +08:00
ZeFeng Yin 44fd16511f test: rm useless expect (#82)
* rm useless expect

* Delete tests/core/algorithm/hnsw/hnsw_streamer_buffer_test.cc
2026-02-10 10:38:53 +08:00
feihongxu0824 0ebf5621a6 feat: support core cpp sdk (#30)
* support core cpp sdk

* fix

* fix

* fix

* fix cr
2026-01-26 20:01:44 +08:00
Jalin Wang bc90952a01 refactor: flat param string cleanup (#28)
* refactor: flat param string cleanup

* fix
2026-01-26 14:49:35 +08:00
sanyi 6524fabd80 Initial commit 2025-12-30 11:02:17 +08:00