Open
Conversation
… beam width handling
Contributor
There was a problem hiding this comment.
Pull request overview
Adds a minimum search “beam width” (candidate exploration) to decouple HNSW search effort from the requested k, aiming to make top-k results stable when callers vary k.
Changes:
- Introduces a minimum
rerankKfor HNSW search to ensure sufficient exploration for smallk. - Updates in-memory, disk, incremental, and PQ-rerank search paths to use
rerankK. - Adds a regression test asserting top-5 stability between
k=5andk=50.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 4 comments.
| File | Description |
|---|---|
| gigamap/jvector/src/main/java/org/eclipse/store/gigamap/jvector/VectorIndex.java | Computes and applies a minimum rerankK; updates search paths and incremental merging behavior. |
| gigamap/jvector/src/main/java/org/eclipse/store/gigamap/jvector/PQCompressionManager.java | Threads rerankK into PQ rerank flow; ensures candidate count meets the minimum exploration level. |
| gigamap/jvector/src/test/java/org/eclipse/store/gigamap/jvector/VectorIndexTest.java | Adds a test to verify top-5 consistency across different requested k values. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…h overrides to enhance HNSW search tuning
Contributor
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 7 out of 7 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ry and default beam width usage
zdenek-jonas
approved these changes
Apr 24, 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.
Summary
The HNSW search path enforces a minimum beam width (HNSW efSearch) so that the top-k stays stable across different requested
kvalues — without it,search(q, 5)can return a different top-5 than the first five entries ofsearch(q, 50).This PR turns the floor into two knobs:
VectorIndexConfiguration.minSearchBeamWidth()— index-level floor (default100, preserves current behavior). Set to1to disable the floor entirely.VectorIndex.search(float[] query, int k, int searchBeamWidth)(plus the matchingsearch(E entity, int k, int searchBeamWidth)default) — per-query override. The effective beam width becomesmax(k, searchBeamWidth)for that call, bypassing the config floor.Search-time beam width (HNSW efSearch) is conceptually distinct from the existing
beamWidth()(HNSW efConstruction, construction only), so it's a separate property rather than a reinterpretation of the existing one.Changes
VectorIndexConfiguration: newminSearchBeamWidth()getter + builder method, default 100.VectorIndex.Default:computeRerankKnow reads from the configuration. Search dispatch refactored sorerankKflows as a parameter intosearchInMemoryIndex/searchDiskIndex/searchIncremental— the floor logic lives in one place.search(..., int searchBeamWidth)overloads onVectorIndex.configuration.adoc,index.adoc,advanced.adoc— new parameter, clarified construction-vs-search wording, and the PQ two-phase reranking section now showsmax(2 * k, minSearchBeamWidth)instead of just2 * k.Compatibility
VectorIndexConfiguration.Defaultinstances deserialize withminSearchBeamWidth = 0, which collapses torerankK = k— safe, no migration required.