Skip to content

perf(fts): defer decoding for underfilled conjunctions - #9031

Open
BubbleCal wants to merge 1 commit into
mainfrom
yang/fts-stack-lazy-postings
Open

perf(fts): defer decoding for underfilled conjunctions#9031
BubbleCal wants to merge 1 commit into
mainfrom
yang/fts-stack-lazy-postings

Conversation

@BubbleCal

@BubbleCal BubbleCal commented Sep 7, 2026

Copy link
Copy Markdown
Contributor

Before a competitive floor exists, AND queries still decoded frequencies and prepared bounds while looking for intersections. This PR keeps that work lazy, particularly when the final intersection has fewer than k matches.

  • Split DocID and frequency decoding for full posting blocks and tails, retaining the existing encoded format and combined decoding entry points.
  • Advance and intersect DocIDs before decoding frequencies; initialize score bounds when a positive competitive floor makes them useful.
  • Avoid loading document lengths for partitions whose dictionaries cannot satisfy all required tokens.
  • Use SIMD catch-up for the existing classic 4/5-clause path, with unsigned comparisons covering the full u32 DocID range and a binary-search fallback without AVX2.

Tests cover empty/underfilled intersections, delayed frequency and bound activation, block/tail transitions, required-token misses, and scalar/SIMD boundary behavior. Code and its regression tests stay together in this PR.

No isolated main A/B measurement is claimed for this layer. The later bulk-intersection measurements belong to #9030.

Validation

  • Local inverted-index suite: 530 passed.
  • Required all-workspace Clippy: passed.
  • CI: pending.

Stack, 1/4: this PR#9032#9033#9030. Base: main.

Merge in stack order; retarget/restack the remaining PRs after their parent merges.

Separate posting DocIDs from frequency decoding and defer score-bound work
until a competitive floor exists. Avoid document-length loads for partitions
that cannot satisfy required tokens. Use full-u32-domain SIMD catch-up for
the existing classic four/five-clause path.

@lance-gatekeeper lance-gatekeeper Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Gate recommendation: approve with a non-blocking risk.

The lazy, block-granular decoder addresses the real underfilled-AND cost without changing the posting format, and the current coverage preserves classic/bulk, phrase, tail, score, and full-u32 behavior. The residual risk is evaluation: this layer has no isolated base-to-head benchmark, while the linked #9030 measurements cover a later stacked increment, so net latency and possible regressions outside underfilled conjunctions remain unquantified. No change is requested for this PR.

@lance-gatekeeper lance-gatekeeper Bot added K-approved Latest Gatekeeper recommendation permits acceptance. K-risk Latest Gatekeeper recommendation includes a non-blocking risk. labels Sep 7, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-index Vector index, linalg, tokenizer K-approved Latest Gatekeeper recommendation permits acceptance. K-risk Latest Gatekeeper recommendation includes a non-blocking risk. performance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant