perf(fts): add WAND exactness certificate - #8703
Open
BubbleCal wants to merge 1 commit into
Open
Conversation
BubbleCal
force-pushed
the
yang/oss-2078-wand-exactness-certificate
branch
from
August 21, 2026 17:02
4eab6d1 to
a132925
Compare
BubbleCal
force-pushed
the
yang/oss-2078-wand-exactness-certificate
branch
from
August 21, 2026 17:30
a132925 to
563efeb
Compare
Contributor
There was a problem hiding this comment.
✅ Gate recommendation: approve.
The previous no-impact blocker is fixed: certificate eligibility now requires every opened segment and physical partition to be impact-backed, while unsupported or mixed postings fall back to exact compound scoring. The strict/exhaustive certificate and ambiguous-boundary fallback preserve exact score and row-ID ordering across field-local, mixed-field, and partial-coverage paths.
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.
Performance issue
The exact field-local top-level MultiMatch path introduced by #8702 uses
CompoundQueryExecfor every field. This preserves final(score DESC, row_id ASC)ties, but always pays inclusive score-floor and row-ID resolution costs even when the existing Match WAND result already has a strict kth score boundary.Linear: https://linear.app/lancedb/issue/OSS-2078
Stack parent: #8702
How this PR improves performance
For eligible root Match children, this PR runs the existing global Match WAND chain with
k + 1results and classifies the final boosted scores:k + 1results proves the field result is exhaustive.score[k - 1] > score[k]gap proves that the first k results cannot depend on a discarded row-ID tie.Each MultiMatch field certifies or falls back independently. The ambiguous path reuses the same opened indices, ready prefilter, and corpus-wide BM25 scorer. The implementation does not change WAND pruning algorithms, external query APIs, or index formats.
The certificate is conservatively disabled for zero/non-finite boosts,
wand_factor != 1, legacy indices, physical posting schemas without impacts, injected base scorers, zero/non-finite term weights, unbounded queries, and unsupported planner shapes. No-impact postings fall back to the existing exact compound scorer because partition-local candidate pruning cannot certify a corpus-wide score boundary.Benchmark results (measured before review fixes)
Environment and methodology:
c4-highmem-16k=10/100A1-B1-B2-A2ABBA blocksc581b764bversus this PR4eab6d16a3d27cf91f/563efebe7. They add per-field mixed fallback and reject no-impact certificate probes. The measured MMLB corpus uses impact-backed postings, so its fast path is unchanged, but these heads have not been re-benchmarked.Higher QPS is better; lower latency is better.
k=10QPSk=10p95 latencyk=100QPSk=100p50 latencyk=100p95 latencyk=10Q000001k=100Q000001Correctness and determinism:
Certificate census over 250 queries:
Metric invariant violations were zero:
attempts == strict + exhaustive + fallbacksfor every query.Known tradeoff: the rare
k=100one-field-fallback cohort had about 15% worse warm p95 because it runs WAND and then exact scoring. Overallk=100p95 improved 1.82x. Reusing first-pass WAND state for ambiguous fallback is a possible follow-up.RSS stayed within roughly +0.5% to +3% in the fresh-cold runs.
Metrics
wand_exactness_certificate_attemptswand_exactness_certificate_strictwand_exactness_certificate_exhaustivewand_exactness_certificate_fallbackswand_exactness_certificate_candidatesTests and checks
cargo fmt --all -- --checkgit diff --checkPer the requested workflow, I did not run local
cargo testorcargo clippy; CI will run them.