Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,9 +18,10 @@ This is a Rust library crate (ndarray fork with HPC extensions). No external ser

### Environment notes

- **Rust 1.94.0** is pinned via `rust-toolchain.toml`; rustup auto-selects it in `/workspace`.
- **No AVX-512 hardware** in Cloud Agent VMs — SIMD kernel tests using `#[target_feature(enable = "avx512f")]` are compile-gated and will be skipped at runtime. This is expected behavior.
- **Rust 1.94.1** is pinned via `rust-toolchain.toml`; rustup auto-selects it in `/workspace`.
- **No AVX-512 hardware** in Cloud Agent VMs — all test modules in `src/simd_avx512.rs` are gated with `#[cfg(all(test, target_feature = "avx512f"))]` and compile away entirely on non-AVX-512 targets. This is intentional: raw AVX-512 intrinsic tests must never run on CI/Cloud (x86-64-v3). The `simd.rs` LazyLock polyfill dispatches to `simd_avx2.rs` on these machines.
- **Feature gates**: `intel-mkl` and `openblas` are mutually exclusive and require system libraries not installed by default. The default build uses `native` (pure Rust SIMD) which needs no extra libs.
- **Build time**: ~18s cold, <1s incremental. Tests (~1819) take ~70s.
- **Build time**: ~18s cold, <1s incremental. Tests (~1776 on non-AVX-512) take ~70s.
- The workspace has sub-crates under `crates/` and `ndarray-rand/`. Default members exclude `blas-tests` and `blas-mock-tests` (they activate the `blas` feature which needs cblas-sys linking).
- `libssl-dev` is needed as a build dependency for some transitive crates.
- **`cargo fmt`**: `rustfmt.toml` uses 13+ nightly-only options (`brace_style`, `imports_granularity`, etc.). Stable rustfmt ignores them and reports massive diffs. This is a known pre-existing issue — do not attempt to fix formatting drift without coordinating with the project owner.
10 changes: 5 additions & 5 deletions src/simd_avx512.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2619,7 +2619,7 @@ unsafe fn convert_f32_to_bf16_avx512f_rne(input: &[f32], output: &mut [u16]) {
}
}

#[cfg(test)]
#[cfg(all(test, target_feature = "avx512f"))]
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Keep BF16/F16 correctness tests in default test builds

This cfg gate now compiles out the entire bf16_tests module unless AVX-512 is enabled at compile time, but that module contains scalar and runtime-dispatched checks (for example scalar_roundtrip and batch_conversion_matches_scalar) that should still run on non-AVX-512 hosts. In normal cargo test runs (without -C target-feature=+avx512f), these core conversion tests disappear, so CI no longer validates BF16/F16 correctness on the default x86_64 path.

Useful? React with 👍 / 👎.

mod bf16_tests {
use super::*;

Expand Down Expand Up @@ -3260,7 +3260,7 @@ pub fn f32_to_f16_batch_ieee754_rne(input: &[f32], output: &mut [u16]) {
}
}

#[cfg(test)]
#[cfg(all(test, target_feature = "avx512f"))]
mod f16_tests {
use super::*;

Expand Down Expand Up @@ -3351,7 +3351,7 @@ mod f16_tests {
}
}

#[cfg(test)]
#[cfg(all(test, target_feature = "avx512f"))]
mod u8x64_rasterizer_tests {
use super::U8x64;

Expand Down Expand Up @@ -3467,7 +3467,7 @@ mod u8x64_rasterizer_tests {
}
}

#[cfg(test)]
#[cfg(all(test, target_feature = "avx512f"))]
mod tier3_tests {
use super::{U8x64, U16x32};

Expand Down Expand Up @@ -3590,7 +3590,7 @@ mod tier3_tests {
// whichever path the linker selected.
// ────────────────────────────────────────────────────────────────────────

#[cfg(test)]
#[cfg(all(test, target_feature = "avx512f"))]
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Re-enable int SIMD tests for non-AVX512 dispatch path

Gating int_simd_tests on compile-time target_feature="avx512f" removes these tests from the default x86-64-v3/CI environment, even though the module tests crate::simd types that intentionally dispatch to AVX2/scalar implementations when AVX-512 is unavailable. That means regressions in the non-AVX512 path are no longer exercised by standard test runs.

Useful? React with 👍 / 👎.

mod int_simd_tests {
use crate::simd::{I8x32, I8x64, I16x16, I16x32};

Expand Down
Loading