Add IVF index for vec0 virtual table

Add inverted file (IVF) index type: partitions vectors into clusters via
k-means, quantizes to int8, and scans only the nearest nprobe partitions at
query time. Includes shadow table management, insert/delete, KNN integration,
compile flag (SQLITE_VEC_ENABLE_IVF), fuzz targets, and tests. Removes
superseded ivf-benchmarks/ directory.
This commit is contained in:
Alex Garcia 2026-03-29 19:46:23 -07:00
parent 43982c144b
commit 3358e127f6
22 changed files with 5237 additions and 28 deletions

View file

@ -206,6 +206,21 @@ test-loadable-watch:
test-unit:
$(CC) -DSQLITE_CORE -DSQLITE_VEC_TEST -DSQLITE_VEC_ENABLE_RESCORE tests/test-unit.c sqlite-vec.c vendor/sqlite3.c -I./ -Ivendor -o $(prefix)/test-unit && $(prefix)/test-unit
# Standalone sqlite3 CLI with vec0 compiled in. Useful for benchmarking,
# profiling (has debug symbols), and scripting without .load_extension.
# make cli
# dist/sqlite3 :memory: "SELECT vec_version()"
# dist/sqlite3 < script.sql
cli: sqlite-vec.h $(prefix)
$(CC) -O2 -g \
-DSQLITE_CORE \
-DSQLITE_EXTRA_INIT=core_init \
-DSQLITE_THREADSAFE=0 \
-Ivendor/ -I./ \
$(CFLAGS) \
vendor/sqlite3.c vendor/shell.c sqlite-vec.c examples/sqlite3-cli/core_init.c \
-ldl -lm -o $(prefix)/sqlite3
fuzz-build:
$(MAKE) -C tests/fuzz all