Summary
The runtime SIMD dispatch in lance-core picks the SimdSupport::Avx2 tier when only AVX2 is detected:
// rust/lance-core/src/utils/cpu.rs (main)
} else if is_x86_feature_detected!("avx2") {
SimdSupport::Avx2
but every kernel that tier dispatches to in lance-linalg::distance::{cosine, dot, l2, norm_l2} and simd::dist_table is annotated #[target_feature(enable = "avx,fma")]. AVX2 does not imply FMA in the x86 ISA, so a host that reports AVX2 without FMA takes this tier and executes an FMA instruction (vfmadd…) it cannot run — an illegal-instruction crash.
Impact
Latent, not live. Every AVX2-capable part Intel and AMD have shipped also has FMA, so no real CPU triggers this today. It is a hole in the feature-detection contract, not a crash anyone is currently hitting.
Fix
Found and fixed while working on #6630. The tier now requires both features:
} else if is_x86_feature_detected!("avx2") && is_x86_feature_detected!("fma") {
SimdSupport::Avx2
The tier's contract is documented on the enum variant, and a test asserts that neither the Avx2 nor AvxFma tier can be selected on a host without FMA.
Summary
The runtime SIMD dispatch in
lance-corepicks theSimdSupport::Avx2tier when only AVX2 is detected:but every kernel that tier dispatches to in
lance-linalg::distance::{cosine, dot, l2, norm_l2}andsimd::dist_tableis annotated#[target_feature(enable = "avx,fma")]. AVX2 does not imply FMA in the x86 ISA, so a host that reports AVX2 without FMA takes this tier and executes an FMA instruction (vfmadd…) it cannot run — an illegal-instruction crash.Impact
Latent, not live. Every AVX2-capable part Intel and AMD have shipped also has FMA, so no real CPU triggers this today. It is a hole in the feature-detection contract, not a crash anyone is currently hitting.
Fix
Found and fixed while working on #6630. The tier now requires both features:
The tier's contract is documented on the enum variant, and a test asserts that neither the
Avx2norAvxFmatier can be selected on a host without FMA.