Skip to content

Address when scores can be very large in osq score test #129592

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

Merged
merged 3 commits into from
Jun 18, 2025

Conversation

benwtrent
Copy link
Member

Using a static diff or epsilon just doesn't work for this test as the scores can be very large, but relatively close.

Maybe there is a simpler way, but my mind wasn't wanting to "math" very much.

For example, the seed that this previously failed on had scores like 1.726524E9 and 1.7265239E9, which, given their size, are really close together (within 128). But a static epsilon wouldn't capture that.

closes: #128485

@elasticsearchmachine elasticsearchmachine added needs:triage Requires assignment of a team area label v9.1.0 labels Jun 17, 2025
@benwtrent benwtrent added >test Issues or PRs that are addressing/adding tests :Search Relevance/Vectors Vector search and removed needs:triage Requires assignment of a team area label labels Jun 17, 2025
@elasticsearchmachine elasticsearchmachine added the Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch label Jun 17, 2025
@elasticsearchmachine
Copy link
Collaborator

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

float diff = scores1[j] - scores2[j];
assertThat(
"defaultScores: " + scores1[j] + " bulkScores: " + scores2[j],
diff / scores1[j],
Copy link
Contributor

Choose a reason for hiding this comment

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

does this not need an Math.abs so as to be Math.abs(diff) / scores1[j]?

Copy link
Member Author

Choose a reason for hiding this comment

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

you are right!

Copy link
Contributor

@john-wagster john-wagster left a comment

Choose a reason for hiding this comment

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

lgtm

@benwtrent benwtrent added the auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) label Jun 18, 2025
Copy link
Contributor

@tteofili tteofili left a comment

Choose a reason for hiding this comment

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

LGTM

@elasticsearchmachine elasticsearchmachine merged commit 0a9f3a9 into elastic:main Jun 18, 2025
27 checks passed
@benwtrent benwtrent deleted the fix-osq-scorer-tests branch June 18, 2025 15:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
auto-merge-without-approval Automatically merge pull request when CI checks pass (NB doesn't wait for reviews!) :Search Relevance/Vectors Vector search Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch >test Issues or PRs that are addressing/adding tests v9.1.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[CI] ES91OSQVectorScorerTests testScore failing
4 participants