Skip to content

Filtered-search crossover measured and fixed; runtime threshold knob - #7

Merged
JonathanKash merged 1 commit into
mainfrom
filter-threshold
Sep 2, 2026
Merged

Filtered-search crossover measured and fixed; runtime threshold knob#7
JonathanKash merged 1 commit into
mainfrom
filter-threshold

Conversation

@JonathanKash

Copy link
Copy Markdown
Owner

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 a set_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

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
@JonathanKash
JonathanKash merged commit 2b72fb9 into main Sep 2, 2026
7 checks passed
@JonathanKash
JonathanKash deleted the filter-threshold branch September 2, 2026 05:49
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