Incheonkirin opened a new pull request, #16409: URL: https://github.com/apache/lucene/pull/16409
### Description `FilteredHnswGraphSearcher` can stop before exploring a candidate whose score is equal to the current result floor, and it rejects neighbors whose score is exactly `Math.nextUp(results.minCompetitiveSimilarity())`. The latter score is strictly better than the current minimum and is competitive. The base `HnswGraphSearcher` already handles both boundaries: - #14249 changed neighbor admission from `>` to `>=` because a score equal to `Math.nextUp(minCompetitiveSimilarity)` is better. - #14366 allows one candidate equivalent to the current minimum to be explored, while preventing the degenerate equal-score case from expanding without bound. The filtered searcher was added before those follow-ups and retained the earlier boundary behavior. This change applies the same contract to the filtered path: - explore one candidate equivalent to the current minimum; - admit a neighbor at `minAcceptedSimilarity`; - gate the scored batch on `maxScore > results.minCompetitiveSimilarity()`, the same bound the base searcher uses; - reset the one-equivalent guard when collection raises the minimum. ### Regression tests Both tests call `FilteredHnswGraphSearcher` directly, so they do not depend on the filtered-search dispatch heuristic. The first test uses a four-node graph with two accepted nodes and `k=1`. The entry node scores `0.5`; its accepted neighbor scores `Math.nextUp(0.5)`. Before this change, filtered HNSW returns the `0.5` entry and never considers the strictly better neighbor. After the change, it returns the neighbor. The second test searches a chain where every node has the same score and asserts that visitation stays bounded: one candidate tied with the current minimum may be explored, then the search stops. ### Validation - regression tests: fail on current main, pass with the change - `./gradlew :lucene:core:check` passes: 8,534 tests, 307 skipped Related history: #14160, #14215, #14249, #14366, #15500. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
