Skip to content

Add missing HNSW bindings#2307

Open
julianmi wants to merge 2 commits into
NVIDIA:mainfrom
julianmi:hnsw-bindings
Open

Add missing HNSW bindings#2307
julianmi wants to merge 2 commits into
NVIDIA:mainfrom
julianmi:hnsw-bindings

Conversation

@julianmi

@julianmi julianmi commented Jul 8, 2026

Copy link
Copy Markdown
Contributor

Add the missing HNSW bindings and cleans up the changes in #1719.

Implements feature #2156. More work might be needed to better fit the recall curve provided by HNSW. See #2031. CC @achirkin

@julianmi julianmi requested review from a team as code owners July 8, 2026 13:26
@julianmi julianmi self-assigned this Jul 8, 2026
@julianmi julianmi added feature request New feature or request non-breaking Introduces a non-breaking change labels Jul 8, 2026
*/
@Override
public SearchResults search(HnswQuery query) throws Throwable {
synchronized (lifecycleLock) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

If I understand the intent correctly, this synchronized block was added to ensure a clean shutdown. However, it also appears to serialize all searches, preventing concurrent execution. If we want to enforce shutdown semantics here, a read-write lock may be a better fit. That said, at least in Lucene this concern is usually delegated to the caller. The caller typically tracks in-flight requests via reference counting (or a similar mechanism) and ensures that shutdown does not proceed until all outstanding requests have completed. So adding it here might duplicate an effort in some systems.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

feature request New feature or request non-breaking Introduces a non-breaking change

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants