Files
Rolf Rando fb46e0bc4b Bug 2039101 - Turn on native coarse bit indexing, sqlite-vec to 0.1.10 r=mak,places-reviewers,ai-platform-reviewers,mzhang,thasan
For this patch we no longer manually do the bit quantization and instead rely on built in sqlite-vec features.

Running the performance tests with manual rowLimit set to 10,000 (a typical use case) on my MacM1 semantic searching latency was reduced 3x, from 6.5 to 2.2ms. I have added one additional performance test that uses multiple different queries, because I thought one query was insufficient.

In the original we were searching 100 entries for 2 results. That is a '50x' oversample, which is being set manually each time we do a query with a special function.

Note there is also a 're-vendor' to upgrade sqlite-vec because they fixed a bug we found in the integration of this patch.

Base revision's try run: https://treeherder.mozilla.org/jobs?repo=try&landoCommitID=193651
Local revision's try run: https://treeherder.mozilla.org/jobs?repo=try&landoCommitID=194008

Differential Revision: https://phabricator.services.mozilla.com/D300160
2026-05-29 03:03:01 +00:00

42 lines
840 B
C

#ifndef SQLITE_VEC_H
#define SQLITE_VEC_H
#ifndef SQLITE_CORE
#include "sqlite3ext.h"
#else
#include "sqlite3.h"
#endif
#ifdef SQLITE_VEC_STATIC
#define SQLITE_VEC_API
#else
#ifdef _WIN32
#define SQLITE_VEC_API __declspec(dllexport)
#else
#define SQLITE_VEC_API
#endif
#endif
#define SQLITE_VEC_VERSION "v0.1.10-alpha.4"
// TODO rm
#define SQLITE_VEC_DATE "2026-05-18T06:53:35Z+0000"
#define SQLITE_VEC_SOURCE "04d28bd21773981e2d266bbf6aa4efbd011eb4f6"
#define SQLITE_VEC_VERSION_MAJOR 0
#define SQLITE_VEC_VERSION_MINOR 1
#define SQLITE_VEC_VERSION_PATCH 10
#ifdef __cplusplus
extern "C" {
#endif
SQLITE_VEC_API int sqlite3_vec_init(sqlite3 *db, char **pzErrMsg,
const sqlite3_api_routines *pApi);
#ifdef __cplusplus
} /* end of the 'extern "C"' block */
#endif
#endif /* ifndef SQLITE_VEC_H */