Expand description
The search loop: window-batched scoring with WAND pruning.
Structs§
- Scratch
- Reusable buffers for window scoring. Keep one per thread and pass it to
search_withto avoid allocating on every query. - Search
Options - Tunables of the search loop.
Constants§
- MAX_
WINDOW - Largest accepted
SearchOptions::window: bounds the scratch buffers (4 M slots, 20 MB) whatever the caller asks for.
Functions§
- search
- Top-k search by dot product.
- search_
ids - Score only
ids— sorted ascending, without duplicates — by seeking every lane to each of them, and offer the ones present in at least one lane to the sink. Cost O(|ids| × lanes × log): the path for a caller who already knows the candidates (a database pre-filter) when they are few against the postings a window search would walk. Scores are the same f32 sums assearch_with: contributions added lane by lane in query order. - search_
with searchwith an explicit sink, options and scratch buffers.