Skip to content

research(nightly): adaptive-sq-coherence — mixed-precision SQ with coherence-precision routing#702

Draft
ruvnet wants to merge 1 commit into
mainfrom
research/nightly/2026-07-17-adaptive-sq-coherence
Draft

research(nightly): adaptive-sq-coherence — mixed-precision SQ with coherence-precision routing#702
ruvnet wants to merge 1 commit into
mainfrom
research/nightly/2026-07-17-adaptive-sq-coherence

Conversation

@ruvnet

@ruvnet ruvnet commented Jul 17, 2026

Copy link
Copy Markdown
Owner

Summary

Nightly RuVector research for 2026-07-17: Adaptive Scalar Quantization with Coherence-Precision Routing.

Core idea: route each stored vector to 8-bit or 16-bit scalar quantization at insert time, based on its local neighbourhood density score (mean kNN L2 distance). Dense, contested embedding regions get 16-bit precision; sparse regions get 8-bit. The result is a memory:recall Pareto improvement over both uniform options.

  • Recall@10: AdaptiveSQ 0.9520 vs Uniform8 0.8235 vs Uniform16 1.0000
  • Memory: AdaptiveSQ 195 KB = 62.5% of Uniform16 (312 KB) and 125% of Uniform8 (156 KB)
  • Latency overhead: +2.7% vs Uniform8 (421 µs vs 410 µs)
  • Both acceptance tests pass: recall ≥ 0.93 × Uniform16; memory ≤ 75% × Uniform16

All numbers from cargo run --release -p ruvector-adaptive-sq --bin benchmark, seed=42, N=5000, dim=32, 200 queries, k=10.

Deliverables

  • Crate: crates/ruvector-adaptive-sq — zero external deps (library), builds to WASM unmodified
  • Tests: 17 unit tests, all passing (cargo test -p ruvector-adaptive-sq)
  • Benchmark: cargo run --release -p ruvector-adaptive-sq --bin benchmark
  • ADR: docs/adr/ADR-272-adaptive-sq-coherence.md
  • Research doc: docs/research/nightly/2026-07-17-adaptive-sq-coherence/README.md
  • Public gist: docs/research/nightly/2026-07-17-adaptive-sq-coherence/gist.md

Ecosystem Connections

Connects: RuVector vector search + coherence scoring + agent memory + edge WASM + RVF + ruFlo.

Known Limitations (documented in ADR)

  • Build time is O(N²) for brute-force density scoring — Phase 2 replaces with HNSW-based approximate kNN
  • Static routing; streaming density score updates are a Phase 2 item
  • Benchmark uses synthetic clustered data; real embedding distributions may show smaller routing accuracy

Build Status

cargo build --release -p ruvector-adaptive-sq  ✓
cargo test -p ruvector-adaptive-sq             ✓  17/17 pass
cargo run --release -p ruvector-adaptive-sq --bin benchmark  ✓  PASS

Generated by Claude Code

Topic: Adaptive Scalar Quantization with Coherence-Precision Routing
Slug: adaptive-sq-coherence
Date: 2026-07-17
ADR: ADR-272

Connects: vector search, coherence scoring, agent memory, edge WASM, RVF.

Co-Authored-By: claude-flow <ruv@ruv.net>
Claude-Session: https://claude.ai/code/session_01Rgb8BSCix9faJMAPNCaGmJ
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