sqlite-vec/tests/fuzz
Alex Garcia 6e2c4c6bab Add FTS5-style command column and runtime oversample for rescore
Replace the old INSERT INTO t(rowid) VALUES('command') hack with a
proper hidden command column named after the table (FTS5 pattern):

  INSERT INTO t(t) VALUES ('oversample=16')

The command column is the first hidden column (before distance and k)
to reserve ability for future table-valued function argument use.

Schema: CREATE TABLE x(rowid, <cols>, "<table>" hidden, distance hidden, k hidden)

For backwards compat, pre-v0.1.10 tables (detected via _info shadow
table version) skip the command column to avoid name conflicts with
user columns that may share the table's name. Verified with legacy
fixture DB generated by sqlite-vec v0.1.6.

Changes:
- Add hidden command column to sqlite3_declare_vtab for new tables
- Version-gate via _info shadow table for existing tables
- Validate at CREATE time that no column name matches table name
- Add rescore_handle_command() with oversample=N support
- rescore_knn() prefers runtime oversample_search over CREATE default
- Remove old rowid-based command dispatch
- Migrate all DiskANN/IVF/fuzz tests and benchmarks to new syntax
- Add legacy DB fixture (v0.1.6) and 9 backwards-compat tests

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-31 22:39:18 -07:00
..
corpus Add UBSAN findings TODO and improve vec-mismatch fuzzer 2026-03-02 21:19:33 -08:00
targets Add comprehensive fuzz testing infrastructure with 6 new targets 2026-03-02 20:33:05 -08:00
.gitignore Add rescore index for ANN queries 2026-03-29 19:45:54 -07:00
diskann-blob-truncate.c Add DiskANN index for vec0 virtual table 2026-03-31 01:21:54 -07:00
diskann-buffer-flush.c Add DiskANN index for vec0 virtual table 2026-03-31 01:21:54 -07:00
diskann-command-inject.c Add FTS5-style command column and runtime oversample for rescore 2026-03-31 22:39:18 -07:00
diskann-create.c Add DiskANN index for vec0 virtual table 2026-03-31 01:21:54 -07:00
diskann-deep-search.c Add DiskANN index for vec0 virtual table 2026-03-31 01:21:54 -07:00
diskann-delete-stress.c Add DiskANN index for vec0 virtual table 2026-03-31 01:21:54 -07:00
diskann-graph-corrupt.c Add DiskANN index for vec0 virtual table 2026-03-31 01:21:54 -07:00
diskann-int8-quant.c Add DiskANN index for vec0 virtual table 2026-03-31 01:21:54 -07:00
diskann-operations.c Add DiskANN index for vec0 virtual table 2026-03-31 01:21:54 -07:00
diskann-prune-direct.c Add DiskANN index for vec0 virtual table 2026-03-31 01:21:54 -07:00
diskann.dict Add DiskANN index for vec0 virtual table 2026-03-31 01:21:54 -07:00
exec.c fuzz work 2024-07-25 11:16:06 -07:00
exec.dict fuzz work 2024-07-25 11:16:06 -07:00
ivf-cell-overflow.c Add FTS5-style command column and runtime oversample for rescore 2026-03-31 22:39:18 -07:00
ivf-create.c Add IVF index for vec0 virtual table 2026-03-31 01:18:47 -07:00
ivf-create.dict Add IVF index for vec0 virtual table 2026-03-31 01:18:47 -07:00
ivf-kmeans.c Add FTS5-style command column and runtime oversample for rescore 2026-03-31 22:39:18 -07:00
ivf-knn-deep.c Add FTS5-style command column and runtime oversample for rescore 2026-03-31 22:39:18 -07:00
ivf-operations.c Add FTS5-style command column and runtime oversample for rescore 2026-03-31 22:39:18 -07:00
ivf-quantize.c Add FTS5-style command column and runtime oversample for rescore 2026-03-31 22:39:18 -07:00
ivf-rescore.c Add FTS5-style command column and runtime oversample for rescore 2026-03-31 22:39:18 -07:00
ivf-shadow-corrupt.c Add FTS5-style command column and runtime oversample for rescore 2026-03-31 22:39:18 -07:00
json.c fuzz work 2024-07-25 11:16:06 -07:00
Makefile Add DiskANN index for vec0 virtual table 2026-03-31 01:21:54 -07:00
metadata-columns.c Add comprehensive fuzz testing infrastructure with 6 new targets 2026-03-02 20:33:05 -08:00
numpy.dict fuzz work 2024-07-25 11:16:06 -07:00
README.md fmt 2024-07-31 12:55:46 -07:00
rescore-create.c Add rescore index for ANN queries 2026-03-29 19:45:54 -07:00
rescore-create.dict Add rescore index for ANN queries 2026-03-29 19:45:54 -07:00
rescore-interleave.c Add rescore index for ANN queries 2026-03-29 19:45:54 -07:00
rescore-knn-deep.c Add rescore index for ANN queries 2026-03-29 19:45:54 -07:00
rescore-operations.c Add rescore index for ANN queries 2026-03-29 19:45:54 -07:00
rescore-quantize-edge.c Add rescore index for ANN queries 2026-03-29 19:45:54 -07:00
rescore-quantize.c Add rescore index for ANN queries 2026-03-29 19:45:54 -07:00
rescore-shadow-corrupt.c Add rescore index for ANN queries 2026-03-29 19:45:54 -07:00
scalar-functions.c Add comprehensive fuzz testing infrastructure with 6 new targets 2026-03-02 20:33:05 -08:00
scalar-functions.dict Add comprehensive fuzz testing infrastructure with 6 new targets 2026-03-02 20:33:05 -08:00
shadow-corrupt.c Add comprehensive fuzz testing infrastructure with 6 new targets 2026-03-02 20:33:05 -08:00
TODO.md Add UBSAN findings TODO and improve vec-mismatch fuzzer 2026-03-02 21:19:33 -08:00
vec-each.c Add comprehensive fuzz testing infrastructure with 6 new targets 2026-03-02 20:33:05 -08:00
vec-mismatch.c Add UBSAN findings TODO and improve vec-mismatch fuzzer 2026-03-02 21:19:33 -08:00
vec0-create-full.c Add comprehensive fuzz testing infrastructure with 6 new targets 2026-03-02 20:33:05 -08:00
vec0-create.c fuzz work 2024-07-25 11:16:06 -07:00
vec0-create.dict fuzz work 2024-07-25 11:16:06 -07:00
vec0-delete-completeness.c Complete vec0 DELETE: zero data, reclaim empty chunks, fix metadata rc bug (#268) 2026-03-17 00:02:36 -07:00
vec0-operations.c Add comprehensive fuzz testing infrastructure with 6 new targets 2026-03-02 20:33:05 -08:00

ASAN_OPTIONS=detect_leaks=1 ./targets/vec0_create \
  -dict=./vec0-create.dict -max_total_time=5 \
  ./corpus/vec0-create
export PATH="/opt/homebrew/opt/llvm/bin:$PATH"
export LDFLAGS="-L/opt/homebrew/opt/llvm/lib"
export CPPFLAGS="-I/opt/homebrew/opt/llvm/include"


LDFLAGS="-L/opt/homebrew/opt/llvm/lib/c++ -Wl,-rpath,/opt/homebrew/opt/llvm/lib/c++"