Add Windows ARM64 wheel support - #703
ssss141414 wants to merge 2 commits into
Conversation
| T pq = dot(x->v, y->v, f); | ||
| T ppqq = pp * qq; | ||
| if (ppqq > 0) return 2.0 - 2.0 * pq / sqrt(ppqq); | ||
| if (ppqq > 0) return memcmp(x->v, y->v, f * sizeof(T)) == 0 ? 0 : 2.0 - 2.0 * pq / sqrt(ppqq); |
There was a problem hiding this comment.
Hi,
The
annoylib.hchange is needed because the existing angular-distance tests fail on native Windows ARM64 without it.For two byte-identical vectors, the angular distance should be exactly zero. However, with the optimized MSVC ARM64 build, the dot product and cached norm can have slightly different floating-point rounding. As a result, this expression:
2.0 - 2.0 * pq / sqrt(pp * qq)returns a small positive value instead of zero. The observed self-distances were approximately
0.0001957and0.0002183.This causes the existing
test_include_distsandtest_include_dists_check_rangestests to fail. Thememcmpcheck only handles vectors with identical stored representations and returns the mathematically correct distance of zero before evaluating the floating-point formula.Without this change, the Windows ARM64 wheel still builds and imports, but its native CI test suite reports 2 failures. With the change, those tests pass.
This is therefore a runtime correctness fix exposed by Windows ARM64 rather than a wheel-build configuration change. If preferred, it can be submitted as a separate prerequisite bug-fix PR, with the Windows ARM64 wheel PR depending on it.
Thank you!
|
Hi annoy maintainers, I'm from Microsoft and recently I'm working on improving Python ecosystem support for Windows on Arm. So I also adds CI support for Windows ARM64. Could you please help to review? Thanks. |
Summary
Local validation
Publication behavior
The wheel is not committed to this repository and this PR does not publish to PyPI. The existing publish workflow remains tag-push-only; after merge, a maintainer-created release tag can build and publish the ARM64 wheel through the normal release path.