Filtered-search crossover measured and fixed; runtime threshold knob - #7
Merged
Conversation
The 16*ef scan threshold was far too conservative - a data review of the benchmark showed the exact scan beating traversal well past it. A dedicated crossover probe (scan vs forced traversal at 2-50% selectivity, 100k vectors) puts the break-even at ~15-20% of capacity: at 2% the scan is 88 us at recall 1.000 vs 6,654 us at 0.989 for the traversal the old threshold selected. Default policy is now scan while popcount(allow) <= max(16*ef, capacity/8) - 12.5%, safely inside the measured scan-wins region - with set_filter_scan_limit()/filter_scan_limit() as a runtime override (0 = always traverse, UINT64_MAX = always scan) for power users and for reproducing the probe. Also records the ACORN evaluation verdict in the README: rejected because it spends latency (the actual cost at mid selectivity) to buy recall (already >= 0.94 there). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017ULiWeodALX2ZQiLKvTw25
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The 16·ef scan threshold was too conservative. A crossover probe (scan vs forced traversal, 2–50% selectivity, 100k vectors) puts break-even at ~15–20% of capacity — at 2% the old threshold chose a 6,654 µs / 0.989 traversal over an 88 µs / 1.000 scan. Default is now
max(16·ef, capacity/8)with aset_filter_scan_limit()runtime override. README also records the ACORN evaluation verdict (rejected: buys recall we have, costs latency we don't).🤖 Generated with Claude Code
https://claude.ai/code/session_017ULiWeodALX2ZQiLKvTw25