Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

require that float vector components are smaller than 1E17 to prevent overflowing to Infinity #12373

Closed
wants to merge 1 commit into from

Conversation

jbellis
Copy link
Contributor

@jbellis jbellis commented Jun 14, 2023

Following up to PR #12281

…ponents are smaller than 1E17 to prevent overflowing to Infinity
@jbellis
Copy link
Contributor Author

jbellis commented Jun 14, 2023

cc @uschindler

* 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;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that's true, but there's also something to be said for "here's a simple rule to follow" vs "look up the docs on every distance function to see what the limit is"

@msokolov
Copy link
Contributor

msokolov commented Nov 2, 2023

it's not clear that we need this limit and it seems somewhat complicated to maintain. I'm closing since we haven't seen any activity in quite a while and there's no consensus to impose this limit

@msokolov msokolov closed this Nov 2, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants