Repository navigation
Windows with AVX-512: start the JVM with -XX:UseAVX=2 -XX:MaxVectorSize=16 by default to avoid the isDiverse crash - #531
Merged
Conversation
On Windows build 26100 or 26200 on x86-64 with AVX-512, start_jvm now adds -XX:UseAVX=2 -XX:MaxVectorSize=16 and logs one warning. The JVM wheel has crashed on such hosts in jvector's isDiverse; the likely cause is that Windows loses AVX-512 register state when a thread resumes (JDK-8365196, not reproduced here on its own). Both builds are listed because Windows 11 25H2 reports build 26200. A user's own -XX:UseAVX or -XX:MaxVectorSize, also from JAVA_TOOL_OPTIONS or _JAVA_OPTIONS, turns the default off, and so does ARCADEDB_WINDOWS_AVX512_WORKAROUND=0. The native package has no HotSpot and needs nothing. Refs #352
This was referenced Nov 29, 2026
Open
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 makes the JVM wheel add
-XX:UseAVX=2 -XX:MaxVectorSize=16by default on the Windows hosts that can hit the JVM crash of #352. It is a mitigation that the evidence supports and does not prove, and it makes vector index builds slower on those hosts. Refs #352 (the issue stays open).Both settings have now run in turn on one AVX-512 host: 2 crashes in 338 runs without the flags, 0 in 338 with them.
What changes:
26100or26200, andIsProcessorFeaturePresent(41)(AVX-512) is true.26200is listed because Windows 11 25H2 reports that build.-XX:UseAVXor-XX:MaxVectorSizeis injvm_args,ARCADEDB_JVM_ARGS,JAVA_TOOL_OPTIONS, or_JAVA_OPTIONS.ARCADEDB_WINDOWS_AVX512_WORKAROUND=0turns the default off.-march=compatibilityand-H:-VectorAPISupport. I did not test it on an affected host or inspect its machine code.One limit: a public reproducer reports that Windows 11 24H2 and 25H2 are fixed from kernel
26100.7920, and that Windows Server 2025 has no fixed kernel yet. I have not verified either, so the default also covers those Windows 11 revisions, and users there pay the cost until they turn it off.Crashes of
11_vector_index_build.pyin the CI loop onwindows-2025, one fresh JVM per run:The last row shows that the AMD EPYC 9V74, the CPU model with the clean runs, does crash without the flags (both reports in
VamanaDiversityProvider.isDiverse). On its own, 2 against 0 is too few to rule out chance, and the other rows compare different CPUs.Cost on affected hosts, medians of 15 runs per setting, taken in turn on one host:
create_indexcreate_indexIn the last crash run (another AMD EPYC 9V74 job, medians of 338 runs per setting),
create_indextook 5.96 s without and 7.98 s with the flags (34% longer), and the whole example 10.55 s and 12.52 s (19% longer).Tests:
tests/test_jvm_windows_avx512.pyfakes the system, the architecture, the build, and the CPU check, so it runs on every platform and starts no JVM. It passes locally from the source tree, together withtests/test_release_notes_changed_behaviour.py. All checks of this pull request passed with the labelci:full, the Windows legs included.