Files
Arnaud GourlayandClaude Opus 5.5 06433b7028 [BM25] Add a BM25-over-sparse baseline benchmark (#10677)
* Add a BM25-over-sparse baseline benchmark

The text payload index is meant to score about as fast as BM25 over sparse
vectors, so the number it has to match needs to exist before the scorer
does. Measures a local shard end to end, no HTTP.

- embeds the corpus through `lib/bm25` with its defaults, so the baseline
  is the route a user migrates from rather than a reimplementation
- Zipf-like vocabulary. On a uniform one every term is equally selective,
  IDF is flat and pruning has nothing to prune, which would flatter any
  scorer measured against it
- two shards rather than one shard before and after optimization: a shard
  that will optimize starts as soon as the upsert lands, so the first cut
  timed a half-converted index and called it fresh. Both states assert
  what they hold before anything is timed

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

* Measure the sparse BM25 baseline where the routes separate

- 200k documents by default (BM25_SPARSE_DOCS overrides): at 20k every shape
  of both routes measures the same and half of a shard-level query is the
  shard; reachable through the shard since #10682
- a third shard with the sparse index on disk, which the optimized state never
  exercised
- recall at 10 against BM25 by definition, printed per state: the default
  avg_len of 256 on a corpus averaging 110 tokens misses a quarter of the true
  top 10, so the optimized state is also timed with the corpus average
- corpus, queries, reference and recall move to segment::fixtures::bm25_corpus,
  to be shared with the text-index bench and the comparison harness
- module doc: the sparse shapes measure within a few percent of each other; the
  states exist for the text comparison

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* Refuse an empty corpus in the sparse BM25 baseline

BM25_SPARSE_DOCS=0 built empty shards, made the average length NaN and
scored every empty truth as recall 1.0.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>

* Measure what the sparse BM25 baseline states claim

The fresh shard kept the default 10 MB indexing threshold and optimized
itself in the background, so it was timed as a second optimized state.
Disable indexing and re-check it after timing. Keep the shard storage
under CARGO_TARGET_TMPDIR so the on-disk index is not read from a tmpfs.
Fix doc comments that named missing files, a no-op IDF clamp and the
wrong reason for the empty-corpus guard.

Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>

---------

Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
2026-09-23 13:59:20 +02:00
..

Collection

Crate, which implements all functions required for operations with a single collection of points. Points within a collection should share the same payload schema and have same vector size. So that search requests could be performed over all points of a single collection.

Structure

Collection structure

Update process

Update process