benwtrent merged PR #12727:
URL: https://github.com/apache/lucene/pull/12727
--
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-unsubscr...@lucene.a
jpountz commented on code in PR #12727:
URL: https://github.com/apache/lucene/pull/12727#discussion_r1376230730
##
lucene/core/src/test/org/apache/lucene/util/TestVectorUtil.java:
##
@@ -115,6 +116,21 @@ public void testNormalizeZeroThrows() {
expectThrows(IllegalArgumentEx
jpountz commented on PR #12727:
URL: https://github.com/apache/lucene/pull/12727#issuecomment-1785162374
I had a suspicion that the double promotion is not buying us anything in
that case, so I ran a quick test that seems to confirm it:
```java
long equals = 0;
long notEquals =
benwtrent commented on PR #12727:
URL: https://github.com/apache/lucene/pull/12727#issuecomment-1785060096
@ChrisHegarty added a test for verifying VectorSimilarityFunction returns
scores `>= 0`.
--
This is an automated message from the Apache Git Service.
To respond to the message, pleas
ChrisHegarty commented on code in PR #12727:
URL: https://github.com/apache/lucene/pull/12727#discussion_r1375318432
##
lucene/core/src/java/org/apache/lucene/index/VectorSimilarityFunction.java:
##
@@ -70,7 +74,11 @@ public float compare(byte[] v1, byte[] v2) {
COSINE {
ChrisHegarty commented on code in PR #12727:
URL: https://github.com/apache/lucene/pull/12727#discussion_r1375316778
##
lucene/core/src/java/org/apache/lucene/index/VectorSimilarityFunction.java:
##
@@ -70,7 +74,11 @@ public float compare(byte[] v1, byte[] v2) {
COSINE {
ChrisHegarty commented on PR #12727:
URL: https://github.com/apache/lucene/pull/12727#issuecomment-1783913908
Hi @benwtrent I think that this is fine - LGTM, just dropping a few small
comments / questions.
I grabbed and modified your test, and was able to repo this on both my Linu
benwtrent opened a new pull request, #12727:
URL: https://github.com/apache/lucene/pull/12727
We shouldn't ever return negative scores from vector similarity functions.
Given vector panama and nearly antipodal float[] vectors, it is possible that
cosine and (normalized) dot-product become s