Skip to content

fix: allocate too much memory for block max scores#5718

Merged
BubbleCal merged 1 commit intomainfrom
yang/fix-docset-maxscores
Jan 15, 2026
Merged

fix: allocate too much memory for block max scores#5718
BubbleCal merged 1 commit intomainfrom
yang/fix-docset-maxscores

Conversation

@BubbleCal
Copy link
Copy Markdown
Contributor

this could reduce the memory footprint by 128x less for block max scores while indexing

@github-actions github-actions Bot added the bug Something isn't working label Jan 15, 2026
@github-actions
Copy link
Copy Markdown
Contributor

Code Review

Summary: Good fix for a memory over-allocation bug. The PR correctly reduces pre-allocated capacity from length (number of documents) to num_blocks (number of blocks), which is ~128x smaller since BLOCK_SIZE = 128.

Feedback

No P0/P1 issues found. The changes are correct and well-tested.

Minor observations (non-blocking):

  • The idf_scale hoisting is a nice micro-optimization that avoids redundant computation in the hot loop.
  • Test correctly validates both len() and capacity() to ensure the fix works as intended.

LGTM ✓

@codecov
Copy link
Copy Markdown

codecov Bot commented Jan 15, 2026

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@BubbleCal BubbleCal merged commit df1462d into main Jan 15, 2026
30 checks passed
@BubbleCal BubbleCal deleted the yang/fix-docset-maxscores branch January 15, 2026 14:23
jackye1995 pushed a commit to jackye1995/lance that referenced this pull request Jan 21, 2026
this could reduce the memory footprint by 128x less for block max scores
while indexing
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants