1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
//! Pure Rust SIMD kernels for SochDB vector operations.
//!
//! This module provides high-performance SIMD implementations for:
//! - **BPS Scan**: L1 distance computation for Block Projection Sketches
//! - **Int8 Dot Product**: Quantized dot products for reranking
//! - **Visibility Check**: MVCC visibility bitmap generation
//!
//! # Architecture
//!
//! The module uses a trait-based abstraction (`SimdBackend`) that allows
//! swapping between architecture-specific intrinsics (`core::arch`) and
//! portable SIMD (`core::simd`) when it stabilizes.
//!
//! # CPU Detection
//!
//! Runtime CPU feature detection is used to select the optimal code path:
//! - x86_64: AVX-512 > AVX2 > SSE4.1 > Scalar
//! - aarch64: NEON (mandatory) + optional SVE
//! - Other: Scalar fallback
//!
//! # Safety
//!
//! SIMD intrinsic functions are `unsafe` because they require specific CPU
//! features. The dispatch layer handles feature detection and ensures
//! that intrinsics are only called when the CPU supports them.
// Re-export main types and functions
pub use ;
pub use ;
pub use ;
pub use ;
/// Trait for SIMD backend abstraction.
///
/// This allows the algorithm code to be generic over the backend,
/// enabling A/B testing and gradual migration to `core::simd`.