Native Shell
Native Shell:AI 生成的 UI,在你的應用中原生呈現,涵蓋每個平台。iOS、Android、macOS、Windows 與 Linux 上的應用、GPUI 應用與網頁在執行時載入已簽名、沙箱隔離的 TSX 模組並繪製 th
AI 翻譯
尚未偵測到更新。GitHub 發布版本後會顯示在這裡。
個人 GitHub 帳號下公開儲存庫的擁有者可以登入並驗證所有權,自行管理介紹,無需管理員核准。
登入並產生驗證檔案,在 30 分鐘內將其提交至此儲存庫的預設分支。其他分支或分叉儲存庫中的檔案無效。然後在下方檢查檔案,即可無需管理員核准直接管理專案。請保留檔案以維持管理權限。
如需登入,將前往登入頁面。登入後請回到此處,再次點擊所選的驗證按鈕。
在專案資料夾中執行 /nomorevibe verify,即可驗證所有權並自行管理介紹。
一分鐘完成驗證製作者的介紹僅有上面的一句話。 更多詳情請閱讀儲存庫 README。 儲存庫 README ↗
正在載入完整 README。
檢視完整 README ↗Results site: 18abhinav07.github.io/A-Game-Of-Vectors, with the 1B latency budget and the DiskANN head-to-head as interactive charts.
A vector search engine written from scratch in Rust, inspired by the architecture Exa described in How we built a web-scale vector database. It serves 113.5M passages (the TREC-RAG 2024 MS MARCO v2.1 corpus, Arctic-Embed-M v1.5) on one 24 GB laptop: R@10 0.909 at 4.8 ms p50 and 460 QPS with the codes in RAM, or R@10 0.902 at 13 ms in 225 MB of RAM with everything on SSD. On 1 billion vectors (MS SPACEV-1B) the same laptop builds an index in about 22 minutes and serves R@10 0.906 at 420 QPS (2.7 ms p50) or 0.960 at 127 QPS with 12 GiB of RAM and everything else read cold from SSD, or R@10 0.911 at 7.3 ms in 298 MB of RAM.
The implementation, tuning and every number here are this repo's own: it measures the design against exact search and NIST relevance labels, finds where it loses recall, and fixes that.
vqtbl1q_u8, 32-doc blocks, about 950M
codes/s/core) → IVF → rerank.pread. This is lossless versus
reranking all 1000, so 87 GB of rerank vectors never have to fit in RAM.pread per probe, a CLOCK cluster cache, a blocking I/O pool. Same recall as RAM
mode at 468 MB peak RSS for 18.4M vectors; RAM grows with the cluster count, not N.sdot (int8 query × int8 row) and centroid routing on AMX via
Accelerate.| R@10 | nDCG@10 dl21 / dl22 / dl23 | p50 (cold) | QPS | RAM | |
|---|---|---|---|---|---|
| exact flat 768-d | 1.000 | 0.694 / 0.552 / 0.470 | |||
| 64 probes, 2-bit tier → 200 rows from SSD | 0.909 | 0.686 / 0.547 / 0.457 | 4.8 ms | 460 | 14 GB |
| 128 probes, 1000 cand | 0.937 | 0.693 / 0.551 / 0.460 | 9.3 ms | 308 | 15 GB |
| SSD mode, 64 probes, top 300 from SSD | 0.902 | 0.684 / 0.546 / 0.454 | 13 ms | 90 | 225 MB |
| SSD mode + 1 GB cluster cache, margin probing | 0.907 | 0.690 / 0.545 / 0.460 | 7.2 ms | 117 | 3.3 GB |
At 128 probes (1.6% of the corpus scanned) nDCG@10 is within 0.011 of exact search on every query set; at 256 probes, within 0.006.
| R@10 | p50 | QPS (12 threads) | |
|---|---|---|---|
| plain IVF, 32 probes | 0.815 | ||
| + SOAR | 0.883 | 0.76 ms | 12.8k |
| + RaBitQ residual codes | 0.894 | 0.78 ms | 13.5k (at 500 cand) |
| + 2-bit tier, 200 rows from SSD | 0.893 | ||
| ceiling of the codes (exhaustive scan + rerank): Exa's sign codes → RaBitQ | 0.949 → 0.981 |
Against FAISS on the same slice, with the same 32 B budget and the same int8 rerank: for
R@10 ≈ 0.885, FAISS's fastest IVF index (IVF4096,PQ64x4fs) needs 128 probes and 1.54 ms just
to scan the codes. sieve needs 32 probes and 0.63 ms end to end, so it is 2.4× faster, mostly
because of SOAR. FAISS's IVF,RaBitQ reaches 0.903 at 128 probes; sieve reaches 0.919 at 64.
Full tables, ablations and kernel numbers: BENCHMARKS.md. Every design decision and the evidence for it: DESIGN.md.
The M2 corpus stops at 113.5M because that is all of it, so the 1B claim is tested on the big-ann-benchmarks SPACEV-1B set instead, on the same 24 GB laptop with no cloud.
| nprobe:cand | R@10 (100M) | R@10 (1B) | p50 (1B) | p99 (1B) | QPS (1B) |
|---|---|---|---|---|---|
| 64:500 | 0.899 | 0.911 | 7.3 ms | 9.9 ms | 147 |
| 128:1000 | 0.938 | 0.942 | 14.6 ms | 24.2 ms | 69 |
| 256:2000 | 0.965 | 0.964 | 28.2 ms | 37.3 ms | 35 |
| 128:1000, cold | 0.938 | 0.944 | 18.2 ms | 25.4 ms | 55 |
| 2-bit, 12 GiB pinned, rest cold | R@10 | p50 | p99 | QPS |
|---|---|---|---|---|
| 128:100:1000:m0.3 | 0.871 | 2.2 ms | 9.1 ms | 599 |
| 128:100:1000:m0.4 | 0.906 | 2.7 ms | 11.2 ms | 420 |
| 96:100:1000:m0.45 | 0.911 | 3.0 ms | 10.3 ms | 413 |
| 96:100:1000:m0.6 | 0.927 | 3.8 ms | 11.2 ms | 314 |
| 192:200:2000:m1.0 | 0.960 | 8.7 ms | 21.6 ms | 127 |
| fixed 40:100:1000 (no margin) | 0.906 | 3.5 ms | 7.2 ms | 372 |
What a real service would still need, roughly in order:
pread. On Linux,
io_uring with registered buffers would remove the thread pool.vqtbl1q_u8 and sdot kernels, Accelerate (AMX) sgemm, and F_NOCACHE for cold reads. The
crate also builds elsewhere with scalar and rayon fallbacks, but only macOS on Apple Silicon
has been measured.rustup update stable.| Experiment | Download | Disk at peak | Time |
|---|---|---|---|
| Tests and kernels | none | none | 1 min |
| DiskANN head-to-head, sieve side (10M SPACEV) | 10 GB | 11 GB | ~5 min download, 1 min run |
| M1 (18.4M passages) | 58 GB (10 parquet shards) | ~85 GB | download, then 79 s ingest and ~2 min per index |
| M2 (113.5M passages) | all 60 shards, streamed and deleted | 87 GB of int8 rows plus codes and index | 3 h 19 min download and ingest, 13 min index |
| SPACEV-1B | 100 GB | ~200 GB (chunks, postings, run files) | ~55 min download, build overlapped |
git clone https://github.com/18Abhinav07/A-Game-Of-Vectors.git && cd A-Game-Of-Vectors
cargo test --release # 31 tests: NEON kernels against scalar references,
# the RaBitQ error bound, SOAR, cache, BM25, sharding wire format
cargo run --release --example kernel # 1-bit LUT scan throughput on this machine (~950M codes/s per core)
./scripts/spacev.sh 0 # SPACEV queries, ground truth and chunk 0 (10 GB, resumable)
./scripts/spacev-10m.sh # build the 10M index (~10 s), search in RAM, then cold from SSD
It prints one line per config (R@10, strict R@10, p50, p99, stage times, QPS) and appends JSON to
results/diskann-h2h.jsonl. A clean rebuild reproduced the published strict recall exactly
(0.907 / 0.945 / 0.974 in RAM, 0.894 / 0.930 / 0.970 cold) and QPS within 2%. DiskANN's own
side, with the macOS reader patch, is in BENCHMARKS.md.
./scripts/download.sh 0 9 # M1 corpus: topics, qrels and the first 10 shards (58 GB, resumable)
./scripts/m1.sh # 10 shards: ingest, index (plain, SOAR, RaBitQ), eval, bench
./scripts/m2.sh # all 60 shards, streamed and deleted as they are ingested
./scripts/ac-bench.sh # M1 latency re-runs on AC power (refuses on battery or Low Power Mode)
./scripts/spacev.sh 0 1 2 3 4 5 6 7 8 9 # SPACEV-1B: the ten 10 GB base chunks
./scripts/spacev-1b.sh # run alongside: train, add each chunk as it lands, pack, search
M1 and M2 read the corpus that scripts/download.sh fetches (the Snowflake Arctic-Embed-M v1.5 MS MARCO
v2.1 embeddings on Hugging Face). Every run appends JSON lines to results/. The committed
files there are the logs behind every table, and scripts/bench-summary.py condenses bench
output to one line per run. Latency depends on power state: on battery in Low Power Mode the M1 scan took
1.6× as long and 12-thread QPS fell 3×, which is why ac-bench.sh refuses to run on battery.
FAISS baseline (optional): python3 -m venv .venv-bench && .venv-bench/bin/pip install faiss-cpu numpy, then .venv-bench/bin/python -I scripts/faiss_baseline.py --ingest data/ingest --out results/faiss-m1.jsonl after M1.
ingest (parquet → codes, int8 rows, ground truth), index (k-means, SOAR, tiers),
search [--ssd --cache-mb N] [--shards host:port,... [--two-phase]] eval | routing | bench [--cold],
search live (delete, reinsert, replay, compact), bm25 (inverted index from the passage text),
search hybrid | filter, shard --shard i --of n --listen host:port [--ssd], spacev train [--bits 2] | add | pack | search [--cold] [--hot-gb N]
(SPACEV-1B). Every binary takes --help. Config strings are
nprobe:cand:rerank[:bM[xW]][:pΔ][:sN[k]], with rerank one of none | prefix | full | tieredN | ssdN;
for spacev search they are nprobe:exact_reads:refined_shortlist[:mMARGIN].
site/ is the results page, plain HTML with no build step. Preview it with
python3 -m http.server -d site 8000 and open http://localhost:8000. Pushes to main that
touch site/ deploy it to GitHub Pages
through .github/workflows/pages.yml.
src/quant.rs normalisation, sign codes, int8 quantiser, sdot kernels
src/lut.rs asymmetric LUT scan (NEON + scalar reference, property-tested)
src/rabitq.rs RaBitQ rotation, residual codes, estimator and error bound
src/tier2.rs 2-bit Lloyd-Max middle tier with per-byte score tables
src/ivf.rs k-means, SOAR assignment, index build, search, SSD row reader
src/postings.rs SSD posting lists, CLOCK cluster cache
src/live.rs tombstones, delta lists, write-ahead log, compaction
src/bm25.rs tokenizer, inverted index build, TAAT BM25, weighted RRF
src/filter.rs allowlist filters: post, expanding probe, brute force, planner
src/shard.rs cluster→shard assignment, wire protocol, shard server, coordinator client
src/store.rs mmap, page eviction/residency, blocking I/O pool
src/blas.rs Accelerate sgemm (AMX)
src/data.rs parquet streaming, topics, qrels
src/eval.rs recall, nDCG@10 (MaxP)
src/bigann.rs SPACEV-1B: L2 RaBitQ, two-level leaves, out-of-core add/pack, chunk rerank
src/bin/spacev.rs train | add | pack | search for the 1B track
scripts/ download, end-to-end runs, FAISS and DiskANN baselines
bench/diskann/ DiskANN job configs and its macOS SSD reader patch
results/ the JSON logs behind every table
site/ the results site (GitHub Pages)
examples/ kernel, SSD, middle-tier and pread/mmap experiments