lance-format / lance-format/lance

Add small-dimension batch kernels for Hamming and binary metrics

Open
#6,824 0 comments 0 reactions 1 assignee View on GitHub

@BubbleCal is already working on this.

Since May 18, 2026.

A-index enhancement performance rust
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

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.