Repository navigation
CI: Add a Windows ARM64 build and test workflow - #510
Merged
Merged
Conversation
Build randomgen on the windows-11-arm runner with the native ARM64 MSVC toolchain (--vsenv), then run the test suite from outside the checkout so the installed package is the one tested, as linux-arm.yml does. Test Python 3.11, the oldest version with a Windows ARM64 build, 3.15 and free-threaded 3.14t. NumPy, SciPy, Cython and ninja all publish win_arm64 wheels for these versions. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #510 +/- ##
=======================================
Coverage 94.80% 94.80%
=======================================
Files 56 56
Lines 9922 9922
Branches 214 214
=======================================
Hits 9407 9407
Misses 495 495
Partials 20 20
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
Random123's MSVC header stopped the build on anything but x86, and assumed SSE, CPUID and _umul128, none of which exist on ARM64. Accept _M_ARM64, use SSE, CPUID and the SSE headers only on x86, and take the high half of 64-bit products from __umulh on ARM64, so Philox stays 64-bit. The x86 settings are unchanged. randomgen_endian.h could not find the byte order under MSVC on ARM64, which defines neither __BYTE_ORDER__ nor _M_X64. Treat _M_ARM64 and _M_ARM as little-endian, as Windows always is. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
bashtage
marked this pull request as ready for review
November 4, 2026 19:12
This was referenced Nov 5, 2026
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.
Adds a GitHub Actions workflow,
windows-arm.yml, that builds and tests randomgen on Windows ARM64. It also fixes the two headers that stopped MSVC from compiling for ARM64.Workflow
windows-11-arm, with Python set up asarm64.pip install -v . -Csetup-args=--vsenv, so meson activates the native ARM64 MSVC toolchain.pip install --group test, thenrandomgen.test(['--skip-slow', '-n', 'auto', ...])from outside the checkout, aslinux-arm.ymldoes.NumPy 2.5.4, SciPy 1.18.1, Cython 3.3.1 and ninja 1.13.2 all publish
win_arm64wheels for these versions, so only randomgen is compiled.Fixes. The first run (c0e81e5) failed in ThreeFry with Random123's
#error "This code has only been tested on x86 platforms.".src/common/features/msvcfeatures.h(Random123, used by Philox and ThreeFry):_M_ARM64is now accepted.__umulh, since_umul128exists only on x64. So Philox stays 64-bit.src/common/randomgen_endian.h: MSVC on ARM64 defines neither__BYTE_ORDER__nor_M_X64, so the byte order was not found (#error Unable to determine target endianness, in AES, dSFMT and SFMT)._M_ARM64and_M_ARMare now treated as little-endian.The rest of the x86-only code already checks
_M_AMD64or_M_X64first:_umul128in PCG64 and LCG128Mix, CPUID, RDRAND and the SIMD paths. MWCX already uses__umulhon_M_ARM64.Checked locally. There is no MSVC ARM64 compiler on the machine I used. Instead, I compiled all 82 C files of an x64 meson build again with
clang-cl --target=aarch64-pc-windows-msvcand the ARM64 flags from the CI log (no/arch:SSE4.2, so noHAVE_SSE2).__clang__,__BYTE_ORDER__and__aarch64__undefined, so the headers take their MSVC branches, every file compiles exceptentropy.c. That failure is inwindows.hitself and is caused by undefining__clang__;entropy.chas no architecture-specific code.R123_USE_SSE0 andR123_USE_PHILOX_64BIT1 on ARM64, andmulhilo64uses__umulh.Not yet known: whether the tests pass on ARM64. This CI run is the first.
The README badge and the list of tested platforms can follow once the job passes.
🤖 Generated with Claude Code