Skip to content

Add duplicate and identity offset tests for BULK_OFFSETS#144640

Merged
ChrisHegarty merged 3 commits intoelastic:mainfrom
ChrisHegarty:bulk-offsets-test-coverage
Mar 20, 2026
Merged

Add duplicate and identity offset tests for BULK_OFFSETS#144640
ChrisHegarty merged 3 commits intoelastic:mainfrom
ChrisHegarty:bulk-offsets-test-coverage

Conversation

@ChrisHegarty
Copy link
Copy Markdown
Contributor

While working on bulk sparse scoring (#144557), I noticed the existing BULK_OFFSETS tests only use random offsets. Random offsets probabilistically cover duplicates and may happen to produce a sequential pattern, but neither case is guaranteed or verified explicitly, so I added two new tests make the patterns deterministic and assert specific properties that random offsets do not.

I added these to INT7U only since the offset dispatch logic is the same array_mapper template across all element types. A bug in offset handling would surface here; other type-specific arithmetic is already covered by the existing per-type random-offset tests.

@ChrisHegarty ChrisHegarty requested a review from a team as a code owner March 20, 2026 11:48
@ChrisHegarty ChrisHegarty added >test Issues or PRs that are addressing/adding tests :Search Relevance/Vectors Vector search Team:Search Relevance Meta label for the Search Relevance team in Elasticsearch labels Mar 20, 2026
@elasticsearchmachine
Copy link
Copy Markdown
Collaborator

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

@ChrisHegarty ChrisHegarty merged commit 400854b into elastic:main Mar 20, 2026
36 checks passed
@ChrisHegarty ChrisHegarty deleted the bulk-offsets-test-coverage branch March 20, 2026 13:57
michalborek pushed a commit to michalborek/elasticsearch that referenced this pull request Mar 23, 2026
)

While working on bulk sparse scoring (elastic#144557), I noticed the existing BULK_OFFSETS tests only use random offsets. Random offsets probabilistically cover duplicates and may happen to produce a sequential pattern, but neither case is guaranteed or verified explicitly, so I added two new tests make the patterns deterministic and assert specific properties that random offsets do not.

I added these to INT7U only since the offset dispatch logic is the same array_mapper template across all element types. A bug in offset handling would surface here; other type-specific arithmetic is already covered by the existing per-type random-offset tests.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

: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.4.0

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants