Skip to content

Hotfix for Windows ARM64 builds, disable some Neon features#7690

Merged
timvisee merged 4 commits intodevfrom
windows-aarch64-disable-neon-f16
Dec 5, 2025
Merged

Hotfix for Windows ARM64 builds, disable some Neon features#7690
timvisee merged 4 commits intodevfrom
windows-aarch64-disable-neon-f16

Conversation

@timvisee
Copy link
Member

@timvisee timvisee commented Dec 4, 2025

Hotfix for #7686

Some of these features don't work on Windows ARM64. This temporarily disabled them at compile time until we properly patch them.

Note: this is untested

All Submissions:

  • Contributions should target the dev branch. Did you create your branch from dev?
  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?

@timvisee timvisee added the do not merge Pull requests blocked on an external event label Dec 4, 2025
@IvanPleshkov IvanPleshkov self-requested a review December 4, 2025 18:29
@timvisee timvisee marked this pull request as ready for review December 5, 2025 09:56
@timvisee
Copy link
Member Author

timvisee commented Dec 5, 2025

Merging this as temporary hotfix.

This is confirmed to work in #7686 (comment).

We can revert this temporary hotfix once #7691 is properly implemented. That will be done later.

@timvisee timvisee merged commit 64690cd into dev Dec 5, 2025
15 checks passed
@timvisee timvisee deleted the windows-aarch64-disable-neon-f16 branch December 5, 2025 09:56
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 5, 2025

Caution

Review failed

The pull request is closed.

📝 Walkthrough

Walkthrough

This PR adds Windows/MSVC compatibility to quantization code by introducing a preprocessor shim in C to handle the popcount operation, and systematically restricts Neon SIMD implementations across multiple Rust metric modules to non-Windows platforms. The C change maps __builtin_popcount to __popcnt for MSVC. The Rust changes add a not(windows) condition to existing aarch64 Neon cfg attributes, preventing Neon-specific code from compiling on Windows while preserving it on other platforms.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

The changes follow a consistent, repetitive pattern across files with minimal logic density. Key areas to verify during review:

  • The C preprocessor change in neon.c does not inadvertently affect non-Windows or non-MSVC builds
  • The not(windows) condition is consistently applied across all intended locations in the metric modules (verify no conditional compilation paths were missed)
  • Fallback implementations exist for Windows builds when Neon is excluded, ensuring no feature gaps
  • The changes maintain backward compatibility for existing non-Windows builds
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch windows-aarch64-disable-neon-f16

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between e8f8e3f and 7fae2eb.

📒 Files selected for processing (6)
  • lib/quantization/cpp/neon.c (1 hunks)
  • lib/segment/src/spaces/metric_f16/mod.rs (1 hunks)
  • lib/segment/src/spaces/metric_f16/simple_cosine.rs (4 hunks)
  • lib/segment/src/spaces/metric_f16/simple_dot.rs (2 hunks)
  • lib/segment/src/spaces/metric_f16/simple_euclid.rs (2 hunks)
  • lib/segment/src/spaces/metric_f16/simple_manhattan.rs (2 hunks)

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@timvisee timvisee removed the do not merge Pull requests blocked on an external event label Dec 5, 2025
timvisee added a commit that referenced this pull request Dec 18, 2025
* On Windows ARM64 builds, disable usage of neon

* Also disable optimized popcount on Windows ARM64

* fix quantization build

* revert changes in BQ

---------

Co-authored-by: Ivan Pleshkov <pleshkov.ivan@gmail.com>
@timvisee timvisee mentioned this pull request Dec 19, 2025
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.

2 participants