Skip to content

Conversation

@anonymou0719
Copy link

Summary

This PR ports a small bug fix from vlasky/sqlite-vec into asg017/sqlite-vec.

The ARM/ARM64 fallback implementation was taking an unsigned int instead of u64, which truncated the upper 32 bits when called from distance_hamming_u64. This change fixes the type to make the ARM/ARM64 path consistent with the x86 32-bit implementation.

commit

Why it fits this repo’s guidelines/policies

  • Correctness fix: Prevents truncation on ARM/ARM64 when computing Hamming distance with 64-bit inputs.
  • Minimal and review-friendly: Limited to a small change in sqlite-vec.c, no refactors or unrelated edits.
  • Compatibility-preserving: No API changes; behavior is simply corrected to match intended 64-bit semantics.

Notes (if any adaptations): Ported cleanly from vlasky/sqlite-vec with no functional deviations intended.

Why it’s useful here

  • Benefit: Bug fix for Hamming distance calculations on ARM/ARM64.
  • Impact: Ensures correct results for 64-bit distance computations across architectures and avoids silent incorrect behavior on non-x86 platforms.

Testing

  • Existing tests: ✅ Verified locally; build/tests pass
  • CI link (if any): N/A
  • Extra tests (if any): None

The ARM/ARM64 fallback was taking unsigned int instead of u64,
which truncated the upper 32 bits when called from distance_hamming_u64.
This fix makes it consistent with the x86 32-bit implementation.
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