Skip to content

Conversation

@benwtrent
Copy link
Member

We currently use the bulk scoring interface on the lowest HNSW level, but there isn't any technical reason why we cannot use bulk scoring on higher levels to find the entry point. For highly connected graphs with many levels, this could provide a small speed improvement.

Additionally, I noticed that we were not doing bulk scoring when using the Filtered hnsw searcher. Again, we should be using bulk scoring even when using the filter optimized HNSW scorer.

@benwtrent benwtrent added this to the 10.4.0 milestone Dec 11, 2025
@benwtrent benwtrent changed the title Use vector bulk scoring in ep and filter hnsw search Use vector bulk scoring in entry-point and filter hnsw search Dec 11, 2025
int size = Lucene99HnswVectorsReader.EXHAUSTIVE_BULK_SCORE_ORDS;
// visit limit is a "best effort" limit given our bulk scoring logic; assert that we are
// within
// reasonable bounds
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: clean up spotless multi-line comment

results.collect(eps[0], score);
}
} else {
scorer.bulkScore(eps, scores, eps.length);
Copy link
Contributor

@john-wagster john-wagster Dec 13, 2025

Choose a reason for hiding this comment

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

Saying this outloud in case my assumption is wrong. I assume the reason we don't need benchmarking here is that we know from prior work at the leaf level that there's definitely a benefit to bulk scoring eps here instead of doing an early termination check for each entry point.

Copy link
Contributor

@john-wagster john-wagster left a comment

Choose a reason for hiding this comment

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

lgtm

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants