fix(simd): remove outdated nightly-only comment; add AVX-512 CI compile check (#494)

AVX-512 intrinsics (_mm512_*, _mm512_reduce_add_ps, _mm512_abs_ps) are
stable since Rust 1.72. The comment saying "requires nightly Rust" was
misleading — callers would skip the feature unnecessarily.

CI: add a compile-check build step with --features simd-avx512 on the
stable toolchain so regressions are caught. Runtime dispatch is already
in place (is_x86_feature_detected!("avx512f")); the build step verifies
the code at least compiles on runners that may lack AVX-512 hardware.

Closes #47

Co-authored-by: ruvnet <ruvnet@gmail.com>
This commit is contained in:
rUv 2026-05-22 02:47:21 -04:00 committed by GitHub
parent 5ba2b59b5e
commit e3b3dc67fa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 6 additions and 3 deletions

View file

@ -229,6 +229,10 @@ jobs:
run: cargo build --features pg17,index-all,quant-all,graph-complete --release
working-directory: crates/ruvector-postgres
- name: Build with AVX-512 feature (compile-check on stable Rust)
run: cargo build --features pg17,simd-avx512 --release
working-directory: crates/ruvector-postgres
- name: Test with all features
run: cargo pgrx test pg17 --features index-all,quant-all,graph-complete
working-directory: crates/ruvector-postgres

View file

@ -22,9 +22,8 @@ use simsimd::SpatialSimilarity;
// SIMD Feature Detection
// ============================================================================
/// Check if AVX-512F is available at runtime
/// Note: AVX-512 intrinsics require nightly Rust, so this returns false on stable builds
/// To enable AVX-512, compile with --features simd-avx512 on nightly Rust
/// Check if AVX-512F is available at runtime.
/// Requires compiling with `--features simd-avx512` (stable Rust 1.72+).
#[cfg(target_arch = "x86_64")]
#[inline]
pub fn is_avx512_available() -> bool {