You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@lucene.apache.org by "kaivalnp (via GitHub)" <gi...@apache.org> on 2026/09/15 18:50:46 UTC

[PR] Backport "Fix the COSINE merge scorer in Lucene104ScalarQuantizedVectorsReader" to 10.5.2 [lucene]

kaivalnp opened a new pull request, #16678:
URL: https://github.com/apache/lucene/pull/16678

   ### Description
   
   Backport of #16665 to `branch_10_5`. The fix has already been backported to `branch_10x` in https://github.com/apache/lucene/commit/2a5039d6a190d5641266b84205dc4aadd2f3d0f9.
   
   A test in the fix depends on `Lucene99HnswVectorsReader#getFlatVectorsReader`, which is **not** present in 10.5 (the function exists on `branch_10x`, and will be added in 10.6). I'm not sure if this is okay to add in a bugfix release, hence this PR.
   
   Some alternatives: modify the test to avoid using this function (creates some small divergence), or delay the fix to a later release (perhaps 10.6 is right around the corner, and more suitable for the release of the fix).
   
   Looking for some advice!


-- 
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: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


Re: [PR] Backport "Fix the COSINE merge scorer in Lucene104ScalarQuantizedVectorsReader" to 10.5.2 [lucene]

Posted by "kaivalnp (via GitHub)" <gi...@apache.org>.
kaivalnp closed pull request #16678: Backport "Fix the COSINE merge scorer in Lucene104ScalarQuantizedVectorsReader" to 10.5.2
URL: https://github.com/apache/lucene/pull/16678


-- 
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: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


Re: [PR] Backport "Fix the COSINE merge scorer in Lucene104ScalarQuantizedVectorsReader" to 10.5.2 [lucene]

Posted by "john-mlika (via GitHub)" <gi...@apache.org>.
john-mlika commented on PR #16678:
URL: https://github.com/apache/lucene/pull/16678#issuecomment-5689270820

   the test doesn't need the function on any of the branches. Lucene99HnswVectorsReader already implements QuantizedVectorsReader, so we can cast the reader already in the test:
   
   ```diff
   -import org.apache.lucene.codecs.hnsw.FlatVectorsReader;
   +import org.apache.lucene.codecs.hnsw.FlatVectorScorerUtil;
   @@
   -          Lucene99HnswVectorsReader hnswReader = (Lucene99HnswVectorsReader) vectorsReader;
   -          FlatVectorsReader flatReader = hnswReader.getFlatVectorsReader();
   -          QuantizedVectorsReader quantizedReader = (QuantizedVectorsReader) flatReader;
   +          QuantizedVectorsReader quantizedReader = (QuantizedVectorsReader) vectorsReader;
   @@
   -          FlatVectorsScorer searchScorer = flatReader.getFlatVectorScorer("f");
   +          FlatVectorsScorer searchScorer =
   +              new Lucene104ScalarQuantizedVectorScorer(
   +                  FlatVectorScorerUtil.getLucene99FlatVectorsScorer());
   ```
   
   the new function can then be deleted
   
   if that looks right, you can also pick the commit from my branch if that's easier: https://github.com/john-mlika/lucene/tree/backport-16665-no-new-api


-- 
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: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


Re: [PR] Backport "Fix the COSINE merge scorer in Lucene104ScalarQuantizedVectorsReader" to 10.5.2 [lucene]

Posted by "john-mlika (via GitHub)" <gi...@apache.org>.
john-mlika commented on PR #16678:
URL: https://github.com/apache/lucene/pull/16678#issuecomment-5702554581

   done #16681


-- 
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: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


Re: [PR] Backport "Fix the COSINE merge scorer in Lucene104ScalarQuantizedVectorsReader" to 10.5.2 [lucene]

Posted by "kaivalnp (via GitHub)" <gi...@apache.org>.
kaivalnp commented on PR #16678:
URL: https://github.com/apache/lucene/pull/16678#issuecomment-5702322303

   Thanks @john-mlika, this modification LGTM -- basically pin the `FlatVectorsScorer` to an "expected" implementation instead of inferring from the reader.
   
   I'm slightly hesitant to diverge because I'm not sure if that's okay to do, perhaps we could make the same change on `main` and `branch_10x` too? Do you mind opening a follow-up PR to modify the test?


-- 
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: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org


Re: [PR] Backport "Fix the COSINE merge scorer in Lucene104ScalarQuantizedVectorsReader" to 10.5.2 [lucene]

Posted by "kaivalnp (via GitHub)" <gi...@apache.org>.
kaivalnp commented on PR #16678:
URL: https://github.com/apache/lucene/pull/16678#issuecomment-5703117676

   Thanks @john-mlika, merged all the way to `branch_10_5` in https://github.com/apache/lucene/commit/cfcceee2894bdd2ed13c8a3f1f693dab81d2f2e7.


-- 
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: issues-unsubscribe@lucene.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: issues-unsubscribe@lucene.apache.org
For additional commands, e-mail: issues-help@lucene.apache.org