feat(rust): add IVF-SQ bindings#2229
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: CHILL Plan: Enterprise Run ID: 📒 Files selected for processing (1)
🚧 Files skipped from review as they are similar to previous changes (1)
📝 WalkthroughSummary by CodeRabbit
WalkthroughAdds Rust FFI bindings and safe Rust wrappers for an IVF‑SQ approximate nearest‑neighbor index: parameter types, search parameters, Index wrapper (build/search/extend/serialize/deserialize), module exports, and unit tests. ChangesIVF-SQ Approximate Neighbor Index
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Possibly related PRs
Suggested labels
Suggested reviewers
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
0fa1808 to
f1f99f1
Compare
|
Rebased all five Rust binding PRs — #2229 (IVF-SQ), #2230 (refine), #2231 (brute-force serialize), #2234 (scalar quantizer), #2235 (tiered index) — onto current They're independent but related bindings, so they can be reviewed together whenever you have a chance. If it helps triage: label-wise they should all be |
Adds Rust bindings for the IVF-SQ index, wrapping the C API introduced in v26.06 ("IVF-SQ C API"). Follow-up to the CAGRA serialize/deserialize and
search_with_filterwrappers (#2019 lineage).What
rust/cuvs/src/ivf_sq/module mirroring thecagramodule structure:IndexParams/SearchParamsbuilders,Indexwithbuild,search,search_with_filter(cuvsFilterbitset),extend,serialize/deserialize, and then_lists/dim/sizegetters.rust/cuvs-sys/src/bindings.rsregenerated viarust/scripts/generate-bindings.sh— purely additive (cuvsIvfSq*block).Notes for reviewers
cuvsIvfSqIndexGetCentersis deliberately not wrapped, matching the cagra and ivf_pq modules — it fills a caller-allocatedDLManagedTensor, which has no ergonomic safe-Rust shape yet (commented inindex.rs).extendwhere the ivf_pq Rust module currently doesn't; the C API supports them for both, so this module simply wraps the full practical surface. Happy to trim for symmetry if preferred.Testing
9 GPU tests (single-process): params builders, build + self-neighbor search, repeated search, getters, extend-from-empty (NULL indices path), bitset-filtered search asserting exclusion, serialize/deserialize round-trip re-verifying search on the loaded index, interior-NUL path rejection.
cargo fmt/ clippy clean. Validated against both the v26.06.00 tag (conda libcuvs 26.06) and currentmain— theivf_sq.hheader is byte-identical between the two.