numeris 0.5.14

Pure-Rust numerical algorithms library — high performance with SIMD support while also supporting no-std for embedded and WASM targets.
Documentation
name: CI

on:
  push:
    branches: [main]
  pull_request:

env:
  CARGO_TERM_COLOR: always
  # Exercise the x86 AVX SIMD dispatch path deterministically. Scoped to the
  # x86_64 Linux target only (per-target env, not blanket RUSTFLAGS) so it never
  # touches the aarch64 macOS runner or the thumbv7em no_std cross-build. We use
  # the portable `x86-64-v3` microarch level (SSE2..AVX2+FMA) rather than
  # `target-cpu=native`: `native` lets LLVM enable AVX-512 that some virtualized
  # runners then trap at runtime (SIGILL, even in dependency build scripts).
  # AVX-512 kernels are compile-checked locally, not run in CI.
  CARGO_TARGET_X86_64_UNKNOWN_LINUX_GNU_RUSTFLAGS: "-C target-cpu=x86-64-v3"

jobs:
  fmt:
    name: rustfmt
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
        with:
          components: rustfmt
      - run: cargo fmt --check

  clippy:
    name: clippy
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
        with:
          components: clippy
      - uses: Swatinem/rust-cache@v2
      # Broadest config plus the no_std baseline (some lints, e.g. dead_code,
      # are feature-specific).
      - run: cargo clippy --all-features --tests -- -D warnings
      - run: cargo clippy --no-default-features -- -D warnings

  # Build + test across feature combinations on both SIMD architectures
  # (ubuntu = x86_64 SSE2/AVX, macos = aarch64 NEON). The combos are the ones
  # that can break independently; `all` on both runners exercises the SIMD paths.
  test:
    name: test / ${{ matrix.os }} / ${{ matrix.features.name }}
    runs-on: ${{ matrix.os }}
    strategy:
      fail-fast: false
      matrix:
        os: [ubuntu-latest, macos-latest]
        features:
          - { name: default, flags: "" }
          - { name: all, flags: "--features all" }
          - { name: optim, flags: "--no-default-features --features std,optim" }
          - { name: imageproc-rayon, flags: "--no-default-features --features std,imageproc,rayon" }
          - { name: optim-rayon, flags: "--no-default-features --features std,optim,rayon" }
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
      - uses: Swatinem/rust-cache@v2
      - run: cargo test ${{ matrix.features.flags }}

  # Verify the crate truly builds for a bare-metal no_std target (catches
  # accidental `std` usage that a std host would not, e.g. `f64::powi`).
  # Build-only: the default test harness needs `std`. Two feature sets: the bare
  # core-only baseline, and the full no_std-compatible surface (everything except
  # `rayon`/`nalgebra`, which pull in `std`) so the higher-level modules
  # (estimate, control, stats, …) are exercised without `std`, not just matrix.
  no-std:
    name: no_std (thumbv7em) / ${{ matrix.features.name }}
    runs-on: ubuntu-latest
    strategy:
      fail-fast: false
      matrix:
        features:
          - { name: core, flags: "--no-default-features" }
          - { name: full, flags: "--no-default-features --features libm,alloc,ode,optim,quad,control,estimate,interp,imageproc,special,stats,complex" }
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
        with:
          targets: thumbv7em-none-eabi
      - uses: Swatinem/rust-cache@v2
      - run: cargo build ${{ matrix.features.flags }} --target thumbv7em-none-eabi

  # Guard the declared MSRV (1.80 — the floor required by `[T]::as_flattened`
  # in core matrix code, and by rayon). Build everything on the floor toolchain.
  msrv:
    name: MSRV 1.80
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@1.80
      - uses: Swatinem/rust-cache@v2
      - run: cargo build --all-features