Skip to content

fix(index): work around rustc nightly ICE in NGramIndexBuilder::stream_spill_reader#7534

Merged
westonpace merged 2 commits into
lance-format:mainfrom
westonpace:fix-broken-main-compiler-error
Jun 30, 2026
Merged

fix(index): work around rustc nightly ICE in NGramIndexBuilder::stream_spill_reader#7534
westonpace merged 2 commits into
lance-format:mainfrom
westonpace:fix-broken-main-compiler-error

Conversation

@westonpace

Copy link
Copy Markdown
Member

The function was declared async but never awaited anything at the top level — num_rows() is synchronous and the unfold stream is built synchronously. The unnecessary async triggered an internal compiler error in recent nightly builds:

error: internal compiler error: Obligation DynCompatible(IndexReader)
should have been handled by fulfillment already.
(#0 evaluating async fn body of stream_spill_reader as Future)

Removing async and dropping the corresponding .await at call sites avoids the ICE while preserving identical runtime behaviour.

…m_spill_reader

The function was declared `async` but never awaited anything at the
top level — `num_rows()` is synchronous and the unfold stream is built
synchronously.  The unnecessary `async` triggered an internal compiler
error in recent nightly builds:

  error: internal compiler error: Obligation DynCompatible(IndexReader)
  should have been handled by fulfillment already.
  (#0 evaluating async fn body of stream_spill_reader as Future)

Removing `async` and dropping the corresponding `.await` at call sites
avoids the ICE while preserving identical runtime behaviour.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions github-actions Bot added bug Something isn't working A-index Vector index, linalg, tokenizer and removed bug Something isn't working labels Jun 30, 2026
Two more async fns returning impl Stream triggered the same ICE as
stream_spill_reader (DynCompatible obligation reaching trait selection
before fulfillment):

- FilteredReadStream::read_fragment: already boxes its return value
  internally; change the declared return type from impl Stream to
  BoxStream to avoid the opaque type that triggers the ICE.
- FragmentScanner::scan: no top-level awaits; remove async and drop
  the corresponding .await at the call site.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
@github-actions github-actions Bot added the bug Something isn't working label Jun 30, 2026
@codecov

codecov Bot commented Jun 30, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 83.33333% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
rust/lance-index/src/scalar/ngram.rs 66.66% 0 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@westonpace westonpace merged commit 78df02c into lance-format:main Jun 30, 2026
30 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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants