benwtrent commented on code in PR #12373:
URL: https://github.com/apache/lucene/pull/12373#discussion_r1236979787


##########
lucene/core/src/java/org/apache/lucene/index/FloatVectorValues.java:
##########
@@ -31,6 +31,15 @@ public abstract class FloatVectorValues extends 
DocIdSetIterator {
   /** The maximum length of a vector */
   public static final int MAX_DIMENSIONS = 1024;
 
+  /**
+   * This is the largest float vector value that we allow.
+   *
+   * <p>The largest float32 that you can square without overflowing is about 
1.8E19. We reduce that
+   * further to accommodate the addition of multiple such components in 
similarity computations in
+   * vectors up to MAX_DIMENSIONS in length.
+   */
+  public static final float MAX_FLOAT32_COMPONENT = 1E17f;

Review Comment:
   squareDistance is very different than dotProduct and enforcing the same 
limitations on both seems strange.



-- 
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.apache.org

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


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

Reply via email to