Skip to content

Add IVF_RQ query bits and format reservations#56

Merged
JingsongLi merged 4 commits into
apache:mainfrom
JingsongLi:codex/rq-query-bits-format
Jul 9, 2026
Merged

Add IVF_RQ query bits and format reservations#56
JingsongLi merged 4 commits into
apache:mainfrom
JingsongLi:codex/rq-query-bits-format

Conversation

@JingsongLi

Copy link
Copy Markdown
Contributor

Summary

Adds IVF_RQ/RaBitQ support with a search-time query_bits tuning knob and reserves IVF_RQ v1 format fields for future multi-bit codes. Defaults remain conservative: query_bits=0 keeps the existing float-query path, and writers still emit 1-bit stored codes.

Changes

  • Implement IVF_RQ/RaBitQ core indexing, serialization, and reader search paths.
  • Add query_bits=0|4|8 APIs across Rust, C ABI, C++ wrapper, Java/JNI, and Python.
  • Reserve IVF_RQ v1 header fields for num_bits, rotation_type, factor_layout, optional ex_codes, and optional error_factor.
  • Keep current readers strict: future multi-bit or optional-section payloads are rejected until the scanner is implemented.
  • Extend ANN benchmark knobs, storage golden fixtures, validation tests, and docs.

Testing

  • cargo fmt --all
  • cargo test --workspace -- --nocapture
  • git diff --check

Notes

Current multi-bit storage is intentionally format-reserved only. Writers still produce num_bits=1 with no optional sections, so this PR does not enable multi-bit RQ by default.

@leaves12138 leaves12138 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me. I reviewed the IVF_RQ query_bits API paths, format field validation, and language bindings; the Rust workspace tests, rustfmt check, and clippy all passed locally.

@JingsongLi JingsongLi merged commit 93753f7 into apache:main Jul 9, 2026
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants