Fix Int4 vector library tests failing on Java 21#144830
Merged
ChrisHegarty merged 8 commits intoelastic:mainfrom Mar 26, 2026
Merged
Fix Int4 vector library tests failing on Java 21#144830ChrisHegarty merged 8 commits intoelastic:mainfrom
ChrisHegarty merged 8 commits intoelastic:mainfrom
Conversation
The bulk test methods in JDKVectorLibraryInt4Tests pass heap-backed MemorySegments (via MemorySegment.ofArray) directly to native downcall handles. On Java 21, heap segments cannot be passed to FFM downcalls because Linker.Option.critical(true) is only available from Java 22+. Allocate query segments from the arena (off-heap) instead, matching the pattern used by other tests. Introduced by elastic#144215
Collaborator
|
Pinging @elastic/es-search-relevance (Team:Search Relevance) |
ldematte
reviewed
Mar 24, 2026
Contributor
ldematte
left a comment
There was a problem hiding this comment.
LGTM. I'm surprised there is no CI failure related to this... is there?
If there are, it's worth closing them with this PR.
libs/native/src/test/java/org/elasticsearch/nativeaccess/jdk/JDKVectorLibraryInt4Tests.java
Outdated
Show resolved
Hide resolved
ldematte
approved these changes
Mar 24, 2026
szybia
added a commit
to szybia/elasticsearch
that referenced
this pull request
Mar 26, 2026
* upstream/main: (146 commits) Revert "[Native] Gradle-related tweaks to improve handling of the simdvec native library (elastic#144539)" Fix ArrayIndexOutOfBoundsException in fetch phase with partial results (elastic#144385) ESQL: Correctly manage NULL data type for SUM (elastic#144942) [ESQL] Fixes GroupedTopNBenchmark not executing (elastic#144944) Fix reader context leak when query response serialization fails (elastic#144708) Validate individual offset values in BULK_OFFSETS bounds checks (elastic#144643) Merge main21 source set into main in simdvec (elastic#144921) [TEST] Unmute TsidExtractingIdFieldMapperTests (elastic#144848) [Native] Gradle-related tweaks to improve handling of the simdvec native library (elastic#144539) Fix `ThreadedActionListenerTests#testRejectionHandling` (elastic#144795) Add new DLM Frozen Tier Transition execution plugin and service (elastic#144595) Prometheus: execute query_range via parsed EsqlStatement plan (elastic#144416) Investigate `testBulkIndexingRequestSplitting` failure (elastic#144766) Add test utility for wrapping directories in FilterDirectory layer (elastic#143563) Fix ES|QL decay tests with negative scale (elastic#144657) Fix circuit breaker leak in percolator query construction (elastic#144827) Use XPerFieldDocValuesFormat in AbstractTSDBSyntheticIdCodec (elastic#144744) [DOCS] Document how reindex work in CPS (elastic#144016) Fix Int4 vector library tests failing on Java 21 (elastic#144830) [DiskBBQ] Fix index sorting on flush (elastic#144938) ...
seanzatzdev
pushed a commit
to seanzatzdev/elasticsearch
that referenced
this pull request
Mar 26, 2026
The bulk test methods in JDKVectorLibraryInt4Tests pass heap-backed MemorySegments (via MemorySegment.ofArray) directly to native downcall handles. On Java 21, heap segments cannot be passed to FFM downcalls because Linker.Option.critical(true) is only available from Java 22+. Allocate query segments from the arena (off-heap) instead, matching the pattern used by other tests.
seanzatzdev
pushed a commit
to seanzatzdev/elasticsearch
that referenced
this pull request
Mar 27, 2026
The bulk test methods in JDKVectorLibraryInt4Tests pass heap-backed MemorySegments (via MemorySegment.ofArray) directly to native downcall handles. On Java 21, heap segments cannot be passed to FFM downcalls because Linker.Option.critical(true) is only available from Java 22+. Allocate query segments from the arena (off-heap) instead, matching the pattern used by other tests.
mamazzol
pushed a commit
to mamazzol/elasticsearch
that referenced
this pull request
Mar 30, 2026
The bulk test methods in JDKVectorLibraryInt4Tests pass heap-backed MemorySegments (via MemorySegment.ofArray) directly to native downcall handles. On Java 21, heap segments cannot be passed to FFM downcalls because Linker.Option.critical(true) is only available from Java 22+. Allocate query segments from the arena (off-heap) instead, matching the pattern used by other tests.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The bulk test methods in JDKVectorLibraryInt4Tests pass heap-backed MemorySegments (via MemorySegment.ofArray) directly to native downcall handles. On Java 21, heap segments cannot be passed to FFM downcalls because
Linker.Option.critical(true)is only available from Java 22+.Allocate query segments from the arena (off-heap) instead, matching the pattern used by other tests.
relates #144215