Skip to content

research(nightly): rairs-ivf — RAIRS IVF, ruvector's first Inverted File Index (ADR-193)#459

Draft
ruvnet wants to merge 1 commit into
mainfrom
research/nightly/2026-05-12-rairs-ivf
Draft

research(nightly): rairs-ivf — RAIRS IVF, ruvector's first Inverted File Index (ADR-193)#459
ruvnet wants to merge 1 commit into
mainfrom
research/nightly/2026-05-12-rairs-ivf

Conversation

@ruvnet
Copy link
Copy Markdown
Owner

@ruvnet ruvnet commented May 12, 2026

Summary

  • Implements RAIRS IVF (arXiv:2601.07183, SIGMOD 2026) as crates/ruvector-rairs — ruvector's first Inverted File Index (IVF) family
  • Three measurable variants behind a common AnnIndex trait: IvfFlat, RairsStrict, RairsSeil
  • RairsSeil achieves 93.1% recall@10 at nprobe=1 vs IvfFlat's 61.3% — +31.8 pp — with identical memory (2,571 KB)
  • 10/10 unit tests pass; cargo build --release -p ruvector-rairs green
  • Gist: https://gist.github.com/ruvector/259532106aa52b14a16347075af6b6a6

Benchmark results (x86-64, rustc 1.87.0 --release, N=5K D=128)

Variant nprobe=1 recall@10 nprobe=4 recall@10 Memory
IvfFlat (baseline) 61.3% / 26,984 QPS 97.9% / 13,532 QPS 2,571 KB
RairsStrict (SRAIR) 83.8% / 13,243 QPS 99.4% / 7,584 QPS 5,110 KB
RairsSeil (RAIRS+SEIL) 93.1% / 13,582 QPS 99.9% / 7,798 QPS 2,571 KB

Files

  • crates/ruvector-rairs/ — new standalone crate (IvfFlat + RairsStrict + RairsSeil)
  • docs/adr/ADR-193-rairs-ivf.md — architecture decision record
  • docs/research/nightly/2026-05-12-rairs-ivf/README.md — full SOTA survey + results + roadmap

RAIRS algorithm

Each vector is assigned to a primary centroid (nearest by L2) and a secondary centroid chosen by the RAIR metric:

score(c_j) = ‖v − c_j‖² + λ · ⟨r_p, v − c_j⟩

where r_p = v − c_primary is the primary residual. This prefers secondaries that cover the opposite side of the Voronoi boundary, maximising recall for queries near boundaries.

SEIL (Shared-cell Enhanced IVF Lists) stores shared vectors in 32-entry blocks in the lower-indexed list and holds Ref { list, block } pointers in the secondary list — achieving dual-assignment recall with single-assignment memory.

Test plan

  • cargo build --release -p ruvector-rairs — green
  • cargo test -p ruvector-rairs — 10/10 pass
  • cargo run --release -p ruvector-rairs --bin rairs-demo — real numbers captured
  • Run on SIFT1M (1M×128) for production-scale validation (future)
  • IVF-PQ follow-up (ADR-194 TBD)

… (ADR-193)

Implements Yang & Chen, SIGMOD 2026 (arXiv:2601.07183): three variants of
IVF with Redundant Assignment + Amplified Inverse Residual + SEIL layout.

Three measurable variants (N=5K, D=128, 64 clusters, cargo --release):
  IvfFlat      nprobe=1 recall@10  61.3%  mem 2,571 KB  26,984 QPS
  RairsStrict  nprobe=1 recall@10  83.8%  mem 5,110 KB  13,243 QPS
  RairsSeil    nprobe=1 recall@10  93.1%  mem 2,571 KB  13,582 QPS

RairsSeil: +31.8 pp recall at nprobe=1 vs IvfFlat with identical memory.

Files:
  crates/ruvector-rairs/         — new crate (IvfFlat, RairsStrict, RairsSeil)
  docs/adr/ADR-193-rairs-ivf.md  — architecture decision record
  docs/research/nightly/2026-05-12-rairs-ivf/README.md — SOTA survey + results
  Cargo.toml                     — workspace member added

10/10 unit tests pass. cargo build --release -p ruvector-rairs green.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants