Skip to content

fix: avoid 4-bit IVF-PQ accumulator overflow - #111

Open
adrian-wang wants to merge 1 commit into
apache:mainfrom
adrian-wang:fix-ivfpq-4bit-overflow
Open

adrian-wang wants to merge 1 commit into
apache:mainfrom
adrian-wang:fix-ivfpq-4bit-overflow

Conversation

@adrian-wang

Copy link
Copy Markdown

Use exact f32 scanning when the number of subquantizers can overflow a u16 accumulator. Apply the bound to row-major, transposed, and FastScan layouts before integer accumulation begins.

Cover m=256, 258, and 512 with exactly representable vectors and a prefix whose distance range matches the LUT, independently of range calibration. Exercise in-memory, budgeted, persisted, and batch searches.

Validation: Rust 1.95 core tests (497 passed, 2 ignored), rustfmt, and Clippy.

Use exact f32 scanning when the number of subquantizers can overflow a
u16 accumulator. Apply the bound to row-major, transposed, and FastScan
layouts before integer accumulation begins.

Cover m=256, 258, and 512 with exactly representable vectors and a prefix
whose distance range matches the LUT, independently of range calibration.
Exercise in-memory, budgeted, persisted, and batch searches.

Validation: Rust 1.95 core tests (497 passed, 2 ignored), rustfmt, and Clippy.
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.

1 participant