[MOD-14958] Account for frontend blocks in tiered HNSW size estimates - #1050
Merged
Merged
Conversation
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes using high effort and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, have a team admin enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit b69aff9. Configure here.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #1050 +/- ##
=======================================
Coverage 97.54% 97.54%
=======================================
Files 141 141
Lines 9009 9011 +2
=======================================
+ Hits 8788 8790 +2
Misses 221 221 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
alonre24
approved these changes
Sep 15, 2026
This was referenced Sep 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

Describe the changes in the pull request
Tiered HNSW's element-size estimate currently covers only the backend. With SQ8 and wide vectors, the full-precision frontend needs more memory per vector, so callers sizing blocks from this estimate can exceed their intended per-block memory budget.
Return the larger of the frontend and backend estimates, reusing the frontend parameter factory. Document that this estimate sizes growth of either tier, rather than their combined memory. This lets RediSearch #11330 remove its duplicate frontend estimation after adopting the fix.
Which issues this PR fixes
Main objects this PR modified
Validation
Formatting and
git diff --checkpass. The frontend tests explicitly allow the 64-to-65-vector insertion to grow the buffer. Unit tests and sanitizer validation are running in CI for commit0b29db72.Mark if applicable
Note
Medium Risk
Behavior change to memory/block budgeting for tiered HNSW callers; reported per-vector estimates can increase (safer for limits) without API signature changes.
Overview
Tiered HNSW per-vector block sizing now uses the larger of the SQ8 HNSW backend estimate and the full-precision brute-force frontend estimate (via existing
NewBFParams), instead of backend-only. That keepsVecSimIndex_EstimateElementSizealigned when wide vectors make the flat buffer’s resize block bigger than the quantized graph.VecSimIndex_EstimateElementSizedocs clarify this is the max of either tier’s growth for shared block sizing—not combined tier memory or total index size.Tests: SQ8 tiered HNSW adds frontend block-growth checks (dim 1024, L2/IP/cosine, training on/off) with backend migration deferred so growth is measured on the flat buffer; tiered
SetUpacceptsflatBufferLimit.Reviewed by Cursor Bugbot for commit 0b29db7. Bugbot is set up for automated code reviews on this repo. Configure here.