vignesh9727 opened a new pull request, #16156: URL: https://github.com/apache/lucene/pull/16156
`OffHeapFloatVectorValues#prefetch` computes `finalNumOrds = Math.min(numOrds, ordsToPrefetch.length)` and uses it for the early-return guard, but then loops over `numOrds` instead of `finalNumOrds`. The byte counterpart `OffHeapByteVectorValues#prefetch` correctly loops over `finalNumOrds`. Since callers (e.g. `PrefetchableFlatVectorScorer`) pass a reused scratch array, `numOrds` can be smaller than the array length — the float path then prefetches stale ordinals from previous calls. If `numOrds` ever exceeded the array length, the loop would also go out of bounds (which `finalNumOrds` exists to prevent). One-line fix to match the byte implementation. Introduced in #15722. --- This is a trivial fix — a `skip-changelog` label may be appropriate. -- 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]
