-
Notifications
You must be signed in to change notification settings - Fork 25.7k
test(TestInferenceService): prevent negative embedding values #136806
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
test(TestInferenceService): prevent negative embedding values #136806
Conversation
|
Pinging @elastic/search-relevance (Team:Search - Relevance) |
...rc/main/java/org/elasticsearch/xpack/inference/mock/TestSparseInferenceServiceExtension.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Can we also backport this as far back as 8.19? This test code has been around for a while and it's only a matter of time until get failures for those releases as well.
Sure, on it. |
💔 Backport failedYou can use sqren/backport to manually backport by running |
💚 All backports created successfully
Questions ?Please refer to the Backport tool documentation |
Closes #133453
This PR fixes edge cases where the generated test embeddings could become negative.
Math.abscan overflow when the provided int isInteger.MIX_VALUEcausing a negative embedding value<abs(hashCode)> + 1 + positionwas computed as anintwhich can also overflow if the absolute value is close toInteger.MAX_VALUE