Skip to content

fix(bench): give the scalar index benches the schema their trainers read - #10776

Merged
Xuanwo merged 4 commits into
lance-format:mainfrom
Ali2Arslan:fix/scalar-index-bench-fixture
Nov 13, 2026
Merged

Xuanwo merged 4 commits into
lance-format:mainfrom
Ali2Arslan:fix/scalar-index-bench-fixture

Conversation

@Ali2Arslan

@Ali2Arslan Ali2Arslan commented Nov 5, 2026 •

Copy link
Copy Markdown
Contributor

Why

The scalar index benchmarks should run to completion. Four bench targets panicked in their first benchmark, because each one fed its trainer a stream with column names the trainer does not read.

What changed

  • In scalar_index.rs, test_data takes the value and row column names. The training stream passes VALUE_COLUMN_NAME and ROW_ADDR. The dataset keeps values and row_ids, so the baseline benchmarks scan the same data as before.
  • In common.rs, the five generators write ROW_ADDR instead of _rowid.
  • In btree.rs, the ordered-search benchmark had its own copy of generate_int_unique_stream with a _rowaddr column. It now calls the shared generator, and the imports that only the copy used are gone.
  • In ngram.rs, the text column is VALUE_COLUMN_NAME. The row column stays ROW_ADDR, which main already used after feat(index)!: change ngram, rtree, and minhash lsh scalar indexes to row-address domain #9858 moved NGram to the row-address domain.

Scope

  • Only bench files change. The benchmarks, their queries, and their assertions stay the same.
  • The zonemap, bloomfilter, inverted, geo, and minhash_lsh benches already write the columns their trainers read, so they do not change.
  • A missing row column still fails B-tree and bitmap training with the vague error Expected option to have value. A schema check with a clear message belongs in the trainers, in a separate change.

Tradeoffs

  • The scalar_index dataset cannot use the training names, because Lance rejects a stored column named _rowaddr.
  • A second generator for the scalar_index training stream would repeat the row and batch counts that every assertion depends on.

Blast radius

The change touches bench code only. Library code, the file format, and tests do not change.

Verification

The branch is merged with main at 01036bf80. Every command below ran in criterion test mode on that merged tree with --profile ci --locked, and each benchmark reports Success, so this covers the fixture generation and trainer calls rather than compilation alone.

  • cargo test --profile ci --locked -p lance-index --bench btree: 84 Success, including btree_ordered_first_k and tuple_planning.
  • cargo test --profile ci --locked -p lance-index --bench bitmap: 40 Success.
  • cargo test --profile ci --locked -p lance-index --bench ngram: 2 Success (ngram_train, ngram_search).
  • cargo test --profile ci --locked -p lance --bench scalar_index: 5 Success, including both baseline scans.
  • cargo fmt --all -- --check and cargo clippy --profile ci --all --tests --benches --locked -- -D warnings pass.

On the original base, before the fix, --bench btree and --bench bitmap panicked with Expected option to have value, and --bench ngram panicked with Unable to get field named "value".

Ali2Arslan and others added 3 commits October 31, 2026 15:37
… schema

The fixture trained the B-tree from columns `values` and `row_ids`, but
`train_btree_index` reads `value` and `_rowaddr`, so `bench_baseline`
panicked before any benchmark ran. The training stream now uses
`VALUE_COLUMN_NAME` and `ROW_ADDR`. The dataset keeps `values` and
`row_ids`, because a dataset cannot store a column named `_rowaddr`.

Co-authored-by: Cursor <[email protected]>
… schema

The generators in `benches/common.rs` wrote the row column as `_rowid`.
The B-tree trainer reads `_rowaddr` since upstream PR 9481, and the
bitmap trainer since upstream PR 9814. So `cargo test -p lance-index
--bench btree` and `--bench bitmap` panicked while they built their
first index, before any benchmark ran. The five generators now write
`ROW_ADDR`.

The ordered-search benchmark in `btree.rs` carried its own copy of
`generate_int_unique_stream` to get a `_rowaddr` column. It now calls
the shared generator, and the imports only the copy used are gone.

The ngram benchmark named its text column `doc`, but
`NGramIndexBuilder::train` has looked up `value` since upstream PR 4584,
so `ngram_train` panicked. The column is now `VALUE_COLUMN_NAME`.

Co-authored-by: Cursor <[email protected]>

@claude claude Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Claude Code Review

This pull request is from a fork — automated review is disabled. A repository maintainer can comment @claude review to run a one-time review.

@github-actions github-actions Bot added A-index Vector index, linalg, tokenizer bug Something isn't working labels Nov 5, 2026
lance-gatekeeper[bot]

This comment was marked as outdated.

@lance-gatekeeper lance-gatekeeper Bot added the K-approved Latest Gatekeeper recommendation permits acceptance. label Nov 5, 2026
@lance-gatekeeper lance-gatekeeper Bot removed the K-approved Latest Gatekeeper recommendation permits acceptance. label Nov 13, 2026

@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.

The fixtures match the current trainer schemas while preserving the benchmark workloads. All four affected targets passed local smoke runs on this revision; no blocking issues found.

@lance-gatekeeper lance-gatekeeper Bot added the K-approved Latest Gatekeeper recommendation permits acceptance. label Nov 13, 2026
@Xuanwo
Xuanwo merged commit 3f03534 into lance-format:main Nov 13, 2026
44 checks passed
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 bug Something isn't working K-approved Latest Gatekeeper recommendation permits acceptance.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants