ruvector/package.json
rUv feb4ee2753
perf(hnsw): 4-acc AVX-512 + parallel-insert — +9.7% build throughput (query QPS unchanged: memory-bound at 1M scale) (#619)
* perf(hnsw): 4-accumulator AVX-512 kernels + SIMD wiring into search hot path

- Replace single-accumulator AVX-512 distance kernels with 4-accumulator
  versions in simd_intrinsics.rs (euclidean, cosine, dot, manhattan).
  On Zen 5 with 4-cycle FMA latency, single-accumulator was latency-bound
  (96 cycles for 384-dim); 4-accumulator hides this to ~24 cycles.
- Wire HNSW search hot path in DistanceFn::eval to call simd_intrinsics
  directly (inline, no Result wrapping, no simsimd FFI overhead).
- Enable parallel batch insert via hnsw_rs::parallel_insert_slice (rayon).

Measured: 6-10% QPS improvement on 128-dim/1K-vector bench; larger gains
expected on 1M-vector workloads where distance computation dominates.
228 unit tests pass.

Co-Authored-By: claude-flow <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_019rVRYrRDKyxYK18kuVrDSf

* perf(hnsw): gate parallel_insert_slice behind 10K-vector threshold

Rayon-based parallel insert (hnsw_rs::parallel_insert_slice) degrades
graph connectivity for small batches (<10K vectors) because worker
threads can't see each other's in-flight insertions, reducing optimal
neighbor links.  Add PARALLEL_THRESHOLD=10_000: use parallel insert only
when the batch is large enough that the graph quality converges.

Below threshold: sequential insert_data (same as before this PR).
Above threshold: parallel_insert_slice for build-time speedup.

228 unit tests pass.

Co-Authored-By: claude-flow <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_019rVRYrRDKyxYK18kuVrDSf

* bench(sift1m): add SIFT-1M fvecs benchmark + hnswlib comparison tooling

Adds two benchmark binaries driven by the real TEXMEX SIFT-1M dataset:

  * crates/ruvector-sota-bench/src/bin/sift1m_bench.rs
      Reads sift_base.fvecs / sift_query.fvecs / sift_groundtruth.ivecs
      directly (no HDF5 required).  Sweeps ef_search to produce a
      recall@10 vs QPS table used for before/after PR #619 comparison.

  * scripts/sift1m_hnswlib_bench.mjs
      Same sweep via hnswlib-node (C++ HNSW) to measure the competitive gap.

Cargo.toml: add simd-avx512 feature to sota-bench dependency so the
full optimised kernel path is exercised.

Measured on AMD Ryzen 9 9950X (Zen 5, AVX-512), M=16, efC=200, 1M vecs:

  Source         Build     ef=100 recall  ef=100 QPS  ef=200 recall  ef=200 QPS
  before PR       849 s      0.9585        1,849        0.9713         1,058
  after PR (#619)  774 s      0.9592        1,768        0.9722         1,024
  hnswlib-node     322 s      0.9828        5,339        0.9957         2,897

Build speedup: +9.7 %.  Query QPS at 1M-scale: within noise (memory-
bandwidth bound, not compute-bound).

Co-Authored-By: claude-flow <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_019rVRYrRDKyxYK18kuVrDSf

* style: cargo fmt for sift1m benchmark binary

Co-Authored-By: claude-flow <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_019rVRYrRDKyxYK18kuVrDSf

---------

Co-authored-by: ruvnet <ruvnet@gmail.com>
2026-06-28 20:45:35 -04:00

61 lines
2.1 KiB
JSON

{
"name": "ruvector",
"version": "0.1.2",
"description": "High-performance Rust-native vector database with AgenticDB compatibility",
"private": true,
"workspaces": [
"crates/ruvector-node",
"crates/ruvector-wasm",
"crates/ruvector-graph-node",
"crates/ruvector-graph-wasm"
],
"scripts": {
"build": "cargo build --release",
"build:node": "cd crates/ruvector-node && npm run build",
"build:wasm": "cd crates/ruvector-wasm && npm run build",
"build:graph": "npm run build:graph-node && npm run build:graph-wasm",
"build:graph-node": "cd crates/ruvector-graph-node && napi build --platform --release",
"build:graph-wasm": "cd crates/ruvector-graph-wasm && bash build.sh",
"build:all": "npm run build && npm run build:node && npm run build:wasm && npm run build:graph",
"test": "cargo test --workspace",
"test:graph": "cargo test -p ruvector-graph --all-features",
"test:integration": "cargo test --test graph_full_integration",
"bench": "cargo bench -p ruvector-bench",
"bench:graph": "cargo bench -p ruvector-graph",
"cli": "cargo run -p ruvector-cli --",
"mcp": "cargo run -p ruvector-cli --bin ruvector-mcp",
"example:graph": "cargo run --example simple_graph -p ruvector-graph",
"example:cypher": "cargo run --example cypher_queries -p ruvector-graph",
"example:hybrid": "cargo run --example hybrid_search -p ruvector-graph",
"example:distributed": "cargo run --example distributed_setup -p ruvector-graph --features distributed",
"lint": "cargo clippy --workspace -- -D warnings",
"format": "cargo fmt --all",
"check": "cargo check --workspace",
"check:graph": "cargo check -p ruvector-graph --all-features"
},
"keywords": [
"vector",
"database",
"embeddings",
"rust",
"hnsw",
"agentic",
"ai"
],
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/ruvnet/ruvector.git"
},
"engines": {
"node": ">=18.0.0"
},
"overrides": {
"axios": "^1.13.2",
"body-parser": "^2.2.1"
},
"dependencies": {
"@claude-flow/memory": "^3.0.0-alpha.7",
"hnswlib-node": "^3.0.0"
}
}