Skip to content

fix: compile sqlite-vec NEON on ARM - #17

Merged
gabewillen merged 1 commit into
mainfrom
fix/arm-native-cmake
Aug 7, 2026
Merged

fix: compile sqlite-vec NEON on ARM#17
gabewillen merged 1 commit into
mainfrom
fix/arm-native-cmake

Conversation

@gabewillen

Copy link
Copy Markdown
Contributor

Fixes ARM NEON compilation in the tracked sqlite-vec source.

vabdq_s8 produces signed vectors, while vpaddlq_u8 requires unsigned vectors. Reinterpret the absolute-difference bytes before widening, preserving the intended 128..255 byte values and allowing GCC/Clang ARM builds.

Copilot AI lite review requested due to automatic review settings August 7, 2026 07:24
@gabewillen
gabewillen merged commit aa59e38 into main Aug 7, 2026
13 checks passed
@gabewillen
gabewillen deleted the fix/arm-native-cmake branch August 7, 2026 07:24

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes ARM NEON compilation for the vendored sqlite-vec distance kernel by ensuring the vabdq_s8 absolute-difference results are treated as unsigned bytes before being widened and accumulated. This aligns the types expected by vpaddlq_u8 / vpaddlq_u16 and preserves correct 0..255 absolute-difference semantics.

Changes:

  • Reinterpret int8x16_t absolute-difference vectors as uint8x16_t before vpaddlq_u8 widening in l1_int8_neon.
  • Add an in-code comment explaining why the reinterpret is required for correct accumulation of 128..255 differences.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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