sqlite-vec/tests/fuzz
Alex Garcia cb147c8834
Complete vec0 DELETE: zero data, reclaim empty chunks, fix metadata rc bug (#268)
When a row is deleted from a vec0 virtual table, the rowid slot in
_chunks.rowids and vector data in _vector_chunksNN.vectors are now
zeroed out (previously left as stale data, tracked in #54). When all
rows in a chunk are deleted (validity bitmap all zeros), the chunk and
its associated vector/metadata shadow table rows are reclaimed.

- Add vec0Update_Delete_ClearRowid to zero the rowid blob slot
- Add vec0Update_Delete_ClearVectors to zero all vector blob slots
- Add vec0Update_Delete_DeleteChunkIfEmpty to detect and delete
  fully-empty chunks from _chunks, _vector_chunksNN, _metadatachunksNN
- Fix missing rc check in ClearMetadata loop (bug: errors were silently
  ignored)
- Fix vec0_new_chunk to explicitly set _rowid_ on shadow table INSERTs
  (SHADOW_TABLE_ROWID_QUIRK: "rowid PRIMARY KEY" without INTEGER type
  is not a true rowid alias, causing blob_open failures after chunk
  delete+recreate cycles)
- Add 13 new tests covering rowid/vector zeroing, chunk reclamation,
  metadata/auxiliary/partition/text-PK/int8/bit variants, and
  page_count shrinkage verification
- Add vec0-delete-completeness fuzz target
- Update snapshots for new delete zeroing behavior

Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-17 00:02:36 -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 fuzz work 2024-07-25 11:16:06 -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
json.c fuzz work 2024-07-25 11:16:06 -07:00
Makefile Complete vec0 DELETE: zero data, reclaim empty chunks, fix metadata rc bug (#268) 2026-03-17 00:02:36 -07:00
metadata-columns.c Add comprehensive fuzz testing infrastructure with 6 new targets 2026-03-02 20:33:05 -08:00
numpy.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
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++"