lance-format / lance-format/lance
Add small-dimension batch kernels for Hamming and binary metrics
@BubbleCal is already working on this.
Since May 18, 2026.
- Dominant language
- Rust
- Stars
- 7.1k
- Forks
- 852
- Avg merge
- 3d 18h
- Merged PRs (30d)
- 272
Description
Parent: #6820
Related: #6823
Linear: https://linear.app/lancedb/issue/OSS-926/add-small-dimension-batch-kernels-for-hamming-and-binary-metrics
Linear parent: https://linear.app/lancedb/issue/OSS-922/vector-search-performance-optimization-roadmap
Goal
Add metric-specific batch distance kernels for small-dimensional workloads, starting with Hamming / binary vectors.
For small dimensions, a general batch kernel may not provide enough work per query vector to use SIMD efficiently. Hamming-like metrics need targeted kernels and benchmarks across realistic byte/bit lengths.
Scope
- Identify the existing Hamming / binary distance hot path and benchmark dimensions.
- Add batch kernels for small fixed byte/bit widths where specialization is likely to help.
- Keep portable fallbacks and only use platform-specific SIMD behind the existing target-feature patterns.
- Avoid broad specialization that regresses non-hot dimensions.
- Integrate the specialized batch kernel into batch vector search where the metric/type match.
Acceptance criteria
- Benchmarks sweep representative small dimensions instead of reporting only one favorable size.
- Results separate hot lengths that improve from lengths that are neutral or regress.
- Tests validate distance equality with the scalar/general implementation.
- Platform-specific implementations have fallback coverage for unsupported CPUs.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Assessment
This issue has not been assessed yet.