candle-mi 0.1.13

Mechanistic interpretability for language models in Rust, built on candle
Documentation
name: CI

on:
  push:
    branches: [main]
  pull_request:
    branches: [main]
  schedule:
    # Weekly canary: catches rolling-stable lint breakage between pushes,
    # so a new compiler emails you instead of ambushing a feature push.
    - cron: "0 6 * * 1" # Mondays 06:00 UTC
  workflow_dispatch: # run the canary on demand

env:
  CARGO_TERM_COLOR: always

jobs:
  check:
    name: ${{ matrix.name }}
    runs-on: ubuntu-latest
    strategy:
      matrix:
        include:
          - name: "MSRV (1.88)"
            toolchain: "1.88"
          - name: "Stable"
            toolchain: "stable"
    steps:
      - uses: actions/checkout@v5

      - uses: dtolnay/rust-toolchain@master
        with:
          toolchain: ${{ matrix.toolchain }}
          components: clippy, rustfmt

      - name: Record toolchain versions
        run: |
          { echo "### Toolchain — ${{ matrix.name }}";
            echo '```';
            rustc --version; cargo clippy --version;
            echo '```'; } >> "$GITHUB_STEP_SUMMARY"

      - uses: Swatinem/rust-cache@v2

      - name: Check formatting
        run: cargo fmt --check

      - name: Build (no default features — CPU only on CI)
        run: cargo build --no-default-features --features transformer

      - name: Clippy (pedantic)
        run: cargo clippy --no-default-features --features transformer -- -W clippy::pedantic

      - name: Tests
        run: cargo test --no-default-features --features transformer

      - name: Build (RWKV)
        run: cargo build --no-default-features --features "rwkv,rwkv-tokenizer"

      - name: Clippy (RWKV, pedantic)
        run: cargo clippy --no-default-features --features "rwkv,rwkv-tokenizer" -- -W clippy::pedantic

      - name: Tests (RWKV)
        run: cargo test --no-default-features --features "rwkv,rwkv-tokenizer"

      - name: Build (Stoicheia)
        run: cargo build --no-default-features --features stoicheia

      - name: Clippy (Stoicheia, pedantic)
        run: cargo clippy --no-default-features --features stoicheia -- -W clippy::pedantic

      - name: Tests (Stoicheia)
        run: cargo test --no-default-features --features stoicheia --lib --test stoicheia_analysis --test validate_stoicheia

      # CLT feature is opt-in and pairs with `transformer` in every example.
      # Without a dedicated lane, clt-only regressions (e.g. the hf-fetch-model
      # 0.9.6 signature change that broke list_repo_files_with_metadata on the
      # clt code path) escape the transformer + rwkv lanes entirely.
      - name: Build (CLT)
        run: cargo build --no-default-features --features "clt,transformer"

      - name: Clippy (CLT, pedantic)
        run: cargo clippy --no-default-features --features "clt,transformer" -- -W clippy::pedantic

      - name: Tests (CLT)
        run: cargo test --no-default-features --features "clt,transformer" --lib

      # Check 5 (Rule 15): Bare no-default-features build
      - name: Build (no default features)
        run: cargo build --no-default-features

      # Check 6 (Rule 15): All software features build
      # Note: cuda/metal features require hardware; test all software features instead
      - name: Build (all software features)
        run: cargo build --no-default-features --features "transformer,rwkv,rwkv-tokenizer,clt,sae,stoicheia,probing"