Skip to content

Add Windows ARM64 support#271

Open
oddrationale wants to merge 1 commit intoasg017:mainfrom
oddrationale:codex/windows-arm64-support
Open

Add Windows ARM64 support#271
oddrationale wants to merge 1 commit intoasg017:mainfrom
oddrationale:codex/windows-arm64-support

Conversation

@oddrationale
Copy link

Summary

This adds Windows ARM64 support for sqlite-vec's loadable extension, test workflow, and release workflow.

Why this is needed

There were two separate gaps here:

  1. sqlite-vec.c had a real Windows ARM64 correctness bug.

    On MSVC Windows ARM, sqlite-vec uses a fallback for popcount because __popcnt64 is not available in the same way it is on x64. The existing fallback accepted a 32-bit argument, but distance_hamming_u64() passes 64-bit values. That meant the upper 32 bits of each XOR result could be truncated, producing incorrect hamming distances for some bitvectors on Windows ARM64.

    This PR changes that fallback to operate on u64 and adds a regression test that exercises the 64-bit hamming path.

  2. Windows-on-ARM needs a native Python interpreter to run the loadable-extension tests.

    uv --managed-python can select or download an x64 Python under emulation on Windows-on-ARM, and that interpreter cannot load an ARM64 vec0.dll (%1 is not a valid Win32 application).

    To make this work both locally and in CI, this PR moves the interpreter selection into the Makefile so make test-loadable and make test-loadable-sync automatically use --python python on Windows ARM64. The Makefile also needed a small platform-detection update because GitHub's Windows jobs run make under Git Bash / MSYS, where OS=Windows_NT is not a reliable Windows check by itself.

Changes

  • fix the MSVC Windows ARM popcount fallback in sqlite-vec.c
  • add a regression test that hits the 64-bit hamming-distance path
  • add a native windows-11-arm test job
  • add a Windows ARM64 release build and artifact path
  • add Makefile support for ARM-aware Python selection on Windows
  • update tests/uv.lock so the native Windows ARM64 test environment resolves a NumPy build with win_arm64 wheels

Validation

  • local ARM64 and x64 MSVC builds succeeded
  • uv run --project tests pytest -q tests/test-loadable.py -k vec_distance_hamming
  • native GitHub Actions validation on windows-11-arm succeeded using the shared make test-loadable-sync / make test-loadable path: https://github.com/oddrationale/sqlite-vec/actions/runs/23320284238
  • local sqlite-dist dry run generated the expected Windows ARM64 GitHub release and npm artifacts

Notes

The Windows x64 test job still follows the existing behavior; the Makefile change just centralizes the Windows ARM64 interpreter selection so local development and CI use the same entry points.

Refs #73
Refs #222

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant