From e3b3dc67fa0c35f7d70aae445b0ca1cb3596ad48 Mon Sep 17 00:00:00 2001 From: rUv Date: Fri, 22 May 2026 02:47:21 -0400 Subject: [PATCH] fix(simd): remove outdated nightly-only comment; add AVX-512 CI compile check (#494) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- .github/workflows/ruvector-postgres-ci.yml | 4 ++++ crates/ruvector-postgres/src/distance/simd.rs | 5 ++--- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/.github/workflows/ruvector-postgres-ci.yml b/.github/workflows/ruvector-postgres-ci.yml index 8d8271ea1..25e6efa7a 100644 --- a/.github/workflows/ruvector-postgres-ci.yml +++ b/.github/workflows/ruvector-postgres-ci.yml @@ -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 diff --git a/crates/ruvector-postgres/src/distance/simd.rs b/crates/ruvector-postgres/src/distance/simd.rs index 55276e538..b44fc6de6 100644 --- a/crates/ruvector-postgres/src/distance/simd.rs +++ b/crates/ruvector-postgres/src/distance/simd.rs @@ -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 {