Skip to content

Conversation

mromaios
Copy link
Contributor

@mromaios mromaios commented Oct 20, 2025

Closes #133453

This PR fixes edge cases where the generated test embeddings could become negative.

  • Math.abs can overflow when the provided int is Integer.MIX_VALUE causing a negative embedding value
  • The expression <abs(hashCode)> + 1 + position was computed as an int which can also overflow if the absolute value is close to Integer.MAX_VALUE

@mromaios mromaios self-assigned this Oct 20, 2025
@mromaios mromaios added >test Issues or PRs that are addressing/adding tests :SearchOrg/Relevance Label for the Search (solution/org) Relevance team labels Oct 20, 2025
@elasticsearchmachine
Copy link
Collaborator

Pinging @elastic/search-relevance (Team:Search - Relevance)

@elasticsearchmachine elasticsearchmachine added Team:Search - Relevance The Search organization Search Relevance team v9.3.0 labels Oct 20, 2025
@mromaios mromaios changed the title test(ShardBulkInferenceActionFilterIT): prevent negative embedding values test(TestInferenceService): prevent negative embedding values Oct 20, 2025
@mromaios mromaios marked this pull request as draft October 20, 2025 13:52
@mromaios mromaios marked this pull request as ready for review October 20, 2025 15:37
Copy link
Contributor

@Mikep86 Mikep86 left a 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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

:SearchOrg/Relevance Label for the Search (solution/org) Relevance team Team:Search - Relevance The Search organization Search Relevance team >test Issues or PRs that are addressing/adding tests v9.3.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[CI] ShardBulkInferenceActionFilterIT testRestart {p0=false p1=true} failing

3 participants