research(nightly): SymphonyQG — graph-coupled 4-bit FastScan neighbor scoring#443
Draft
research(nightly): SymphonyQG — graph-coupled 4-bit FastScan neighbor scoring#443
Conversation
…it FastScan neighbor scoring Implements the core SymphonyQG mechanism (SIGMOD 2025, arXiv:2411.12229): co-located packed nibble codes in graph edge lists + SIMD LUT (FastScan) eliminate the separate re-rank phase in graph-based ANN search. Components: - pq4.rs: 4-bit product quantizer with k-means training, encode, LUT build - fastscan.rs: scan_scalar (portable) + scan_avx2 (x86_64 AVX2) kernels - graph.rs: bidirectional greedy k-NN graph with contiguous packed edge codes - lib.rs: SqgIndex with flat_exact / sqg_fastscan / sqg_rerank variants - main.rs: benchmark binary — Section 1 (kernel) + Section 2 (graph search) Measured kernel throughput (cargo --release, x86_64): D=128: FastScan4bit 27M dist/s vs ExactF32 6.5M dist/s → 4.17× D=256: FastScan4bit 27M dist/s vs ExactF32 3.2M dist/s → 8.48× Graph search (n=5000, D=128, ef=50): 10,644 QPS vs 1,253 QPS brute force (8.50×) Build: cargo build --release -p ruvector-symphony-qg ✓ Tests: 11/11 pass (cargo test -p ruvector-symphony-qg) ✓ https://claude.ai/code/session_01N16QAFgeByR21nX3n1ewRC
ADR-193: design decision for graph-coupled 4-bit FastScan ANN. Research doc: SOTA survey, algorithm walkthrough, benchmark results, failure modes, roadmap, and production crate layout proposal. Key findings: - FastScan kernel: 4.17× faster (D=128), 8.48× faster (D=256) vs exact f32 - Graph search: 8.50× QPS at ef=50 (n=5000, D=128) vs brute force - Recall gap documented: flat greedy graph vs paper's HNSW multi-layer References SIGMOD 2025 arXiv:2411.12229 (SymphonyQG), arXiv:2401.08281 (FAISS), VLDB 2015 (FastScan origin). https://claude.ai/code/session_01N16QAFgeByR21nX3n1ewRC
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Implements SymphonyQG (SIGMOD 2025, arXiv:2411.12229) as a new standalone Rust crate
ruvector-symphony-qg: graph-coupled 4-bit Product Quantization FastScan neighbor scoring — the first pure-Rust implementation of this algorithm.The core idea: instead of chasing pointers to load each neighbor's f32 vector, store packed 4-bit PQ codes of all neighbors contiguously inside the graph edge list, then score the entire batch with a pre-built SIMD look-up table (FastScan). No separate re-rank phase needed.
Deliverables
crates/ruvector-symphony-qg/docs/adr/ADR-193-symphony-qg.mddocs/research/nightly/2026-05-08-symphony-qg/README.mdBenchmark Results (real cargo --release numbers, x86_64)
FastScan Kernel Throughput (scores all n candidates, isolates the kernel):
End-to-End Graph Search (n=5,000, D=128):
Graph recall is limited by the PoC flat k-NN graph (vs paper's HNSW multi-layer). FastScan kernel speedup (4–10×) is the measured contribution.
Files Changed
Test Plan
cargo build --release -p ruvector-symphony-qg— passescargo test -p ruvector-symphony-qg— 11/11 tests pass./target/release/symphony-qg-demo— real benchmark numbers capturedReferences
https://claude.ai/code/session_01N16QAFgeByR21nX3n1ewRC
Generated by Claude Code