feat(binary): Add native binary vector storage with BinaryFlatIndex#7
Conversation
Add comprehensive binary vector support including: - BinaryFlatIndex with Hamming and Jaccard distance metrics - Native packed binary storage (8 bits per byte) - WASM SIMD-accelerated Hamming distance computation - Binary quantization for f32 vectors - Full persistence support (snapshot save/load) - Soft delete and compaction support - Result type API for better error handling
9d7cc7b to
af09fda
Compare
🎖️ HOSTILE_REVIEWER Verdict: APPROVED ✅Hey @jsonMartin! Excellent work on this PR. The \ implementation is solid, well-tested, and follows EdgeVec standards. ✅ CI Failures: NOT Your FaultThe two failing checks () are not actual regressions. All benchmarks passed:
The failure is a GitHub Actions permissions issue (HTTP 403) - the workflow can't post comments on PRs from forks because it lacks \ permission. We'll fix this on our end. You don't need to do anything about this. ✅ Code Quality: Excellent
💡 Optional Improvements (Non-Blocking)These are suggestions for follow-up PRs, not required for this merge:
🏆 SummaryThis is a high-quality contribution that adds valuable functionality to EdgeVec:
Ready to merge once CI permissions are fixed on our end. 🚀 Thanks for the excellent work! Reviewed by: HOSTILE_REVIEWER protocol |
- BinaryFlatIndex with native binary storage by @jsonMartin - HNSW binary methods (insert_binary, search_binary) - WASM integration with JsIndexType enum - CI fix for fork PR comment permissions Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
|
Thanks @matte1782! Finally got this shipped — January was unexpectedly a bit of a whirlwind 🤪 Hope your New Year’s off to a good start! |
Summary
This PR implements RFC-004: Flat Index for Binary Vectors, adding native binary vector support to EdgeVec with a specialized
BinaryFlatIndexoptimized for semantic caching and insert-heavy workloads.Key Features
StorageType::Binary(u32)- 32x memory reduction vs f32IndexType.binary(dimensions)Performance Characteristics
Use Cases
Files Changed
src/flat/mod.rs- New BinaryFlatIndex implementationsrc/storage/mod.rs- AddedStorageType::Binary(u32)variantsrc/wasm/mod.rs- WASM bindings for binary index creation and searchsrc/error.rs- AddedBinaryFlatIndexErrorto unified error hierarchydocs/rfcs/RFC_FLAT_INDEX.md- Design documentRelationship to FlatIndex (Week 40)
This PR complements the f32
FlatIndexadded in Week 40 (upstream). The two serve different purposes:Both coexist via the
IndexTypeenum.Test plan
cargo fmt --checkpassescargo clippy -- -D warningspasses