Add JDK 21 test task to simdvec module#145007
Merged
ChrisHegarty merged 6 commits intoelastic:mainfrom Mar 30, 2026
Merged
Conversation
Collaborator
|
Pinging @elastic/es-search-relevance (Team:Search Relevance) |
thecoop
approved these changes
Mar 26, 2026
Member
|
To confirm, |
Contributor
Author
It is, but actually it would be better to make |
mamazzol
pushed a commit
to mamazzol/elasticsearch
that referenced
this pull request
Mar 30, 2026
This commit adds a testJava21 Gradle task to simdvec that automatically runs the simdvec test suite under JDK 21 as part of test. Now that the main22 source set will be merged into main (with runtime SUPPORTS_HEAP_SEGMENTS guards replacing compile-time MR-JAR separation), it is important to continuously verify that the simdvec code behaves correctly on JDK 21, where heap-backed MemorySegments cannot be passed to native downcalls and the scorer create() methods must return Optional.empty(). The new task uses the Gradle toolchain service to select a JDK 21 launcher, independent of the global runtime.java setting, and sets executable explicitly to override the global runtime-jdk-provision. It is wired into check so that both CI and local builds exercise both JDK paths automatically. When the runtime JDK is already 21 the task is skipped to avoid running the same tests twice. JDK 21 failures tend to be painful to diagnose after the fact, so catching regressions early, at build time rather than post merge in CI, is well worth the extra few seconds of test time.
mouhc1ne
pushed a commit
to shmuelhanoch/elasticsearch
that referenced
this pull request
Mar 31, 2026
This commit adds a testJava21 Gradle task to simdvec that automatically runs the simdvec test suite under JDK 21 as part of test. Now that the main22 source set will be merged into main (with runtime SUPPORTS_HEAP_SEGMENTS guards replacing compile-time MR-JAR separation), it is important to continuously verify that the simdvec code behaves correctly on JDK 21, where heap-backed MemorySegments cannot be passed to native downcalls and the scorer create() methods must return Optional.empty(). The new task uses the Gradle toolchain service to select a JDK 21 launcher, independent of the global runtime.java setting, and sets executable explicitly to override the global runtime-jdk-provision. It is wired into check so that both CI and local builds exercise both JDK paths automatically. When the runtime JDK is already 21 the task is skipped to avoid running the same tests twice. JDK 21 failures tend to be painful to diagnose after the fact, so catching regressions early, at build time rather than post merge in CI, is well worth the extra few seconds of test time.
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.
This commit adds a
testJava21Gradle task tosimdvecthat automatically runs the simdvec test suite under JDK 21 as part oftest.Now that the
main22source set will be merged intomain(with runtimeSUPPORTS_HEAP_SEGMENTSguards replacing compile-time MR-JAR separation), it is important to continuously verify that the simdvec code behaves correctly on JDK 21, where heap-backedMemorySegments cannot be passed to native downcalls and the scorercreate()methods must returnOptional.empty().The new task uses the Gradle toolchain service to select a JDK 21 launcher, independent of the global
runtime.javasetting, and setsexecutableexplicitly to override the globalruntime-jdk-provision. It is wired intocheckso that both CI and local builds exercise both JDK paths automatically. When the runtime JDK is already 21 the task is skipped to avoid running the same tests twice.JDK 21 failures tend to be painful to diagnose after the fact, so catching regressions early, at build time rather than post merge in CI, is well worth the extra few seconds of test time.