Skip to content

Windows with AVX-512: start the JVM with -XX:UseAVX=2 -XX:MaxVectorSize=16 by default to avoid the isDiverse crash - #531

Merged
tae898 merged 2 commits into
mainfrom
fix/352-win-avx512-default
Nov 29, 2026
Merged

tae898 merged 2 commits into
mainfrom
fix/352-win-avx512-default

Conversation

@tae898

@tae898 tae898 commented Nov 29, 2026 •

Copy link
Copy Markdown
Collaborator

This makes the JVM wheel add -XX:UseAVX=2 -XX:MaxVectorSize=16 by 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:

  • The default applies only when all of these are true: Windows, x86-64, build 26100 or 26200, and IsProcessorFeaturePresent(41) (AVX-512) is true. 26200 is listed because Windows 11 25H2 reports that build.
  • Neither flag is added when -XX:UseAVX or -XX:MaxVectorSize is in jvm_args, ARCADEDB_JVM_ARGS, JAVA_TOOL_OPTIONS, or _JAVA_OPTIONS.
  • ARCADEDB_WINDOWS_AVX512_WORKAROUND=0 turns the default off.
  • One warning is logged when it applies.
  • Docs: a section on the installation page (what, why, cost, how to turn it off, when it will be removed) and an entry under changed behaviour on the upgrading page.
  • The native package needs nothing: it has no HotSpot, and its image is built with -march=compatibility and -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.py in the CI loop on windows-2025, one fresh JVM per run:

Run CPU Without the flags With the flags
without only Intel Xeon 8573C 6 of 600 no runs
with only AMD EPYC 9V74 no runs 0 of 600
both in turn AMD EPYC 7763 (no AVX-512) no runs no runs
both in turn AMD EPYC 9V74 2 of 338 0 of 338

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:

Host Phase Without (s) With (s) Longer by
Intel Xeon 8573C create_index 6.90 9.75 41%
Intel Xeon 8573C whole example 11.77 14.65 24%
AMD EPYC 9V74 create_index 5.59 7.66 37%
AMD EPYC 9V74 whole example 9.76 11.86 21%

In the last crash run (another AMD EPYC 9V74 job, medians of 338 runs per setting), create_index took 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.py fakes 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 with tests/test_release_notes_changed_behaviour.py. All checks of this pull request passed with the label ci:full, the Windows legs included.

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
@tae898 tae898 added bug Something isn't working vector Vector indexes and find_nearest jvm The arcadedb-jvm package (JPype build) labels Nov 29, 2026
@tae898 tae898 self-assigned this Nov 29, 2026
@tae898 tae898 added the ci:full Run the full platform matrix on this pull request (the legs of a push to main) label Nov 29, 2026
@tae898
tae898 merged commit 133251b into main Nov 29, 2026
79 of 81 checks passed
@tae898
tae898 deleted the fix/352-win-avx512-default branch November 29, 2026 11:41
@github-actions github-actions Bot added this to the 26.12.1 milestone Nov 29, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working ci:full Run the full platform matrix on this pull request (the legs of a push to main) jvm The arcadedb-jvm package (JPype build) vector Vector indexes and find_nearest

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant