mothcdc 0.7.1

mothcdc (formerly mincatcdc): a fork of MinCDC adding a caterpillar layer: metadata-efficient content-defined chunking on redundant data.
Documentation
name: CI

on:
  push:
    branches: [main]
  pull_request:

env:
  CARGO_TERM_COLOR: always

jobs:
  test:
    name: test (${{ matrix.os }})
    strategy:
      fail-fast: false
      matrix:
        # ubuntu = x86_64 (exercises the SSE4.1/AVX2 SIMD paths, the prefetch
        # fix, and the cross-SIMD-width determinism test); macos = arm64 (NEON).
        os: [ubuntu-latest, macos-latest]
    runs-on: ${{ matrix.os }}
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
        with:
          components: clippy, rustfmt
      - name: formatting
        run: cargo fmt --all -- --check
      - name: clippy (all targets and features)
        run: cargo clippy --all-targets --all-features -- -D warnings
      - name: build (all targets)
        run: cargo build --all-targets --all-features
      - name: test
        run: cargo test --release --all-features

  msrv:
    name: MSRV (Rust 1.89)
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@1.89
      - run: cargo check --all-targets --all-features

  portable:
    name: 32-bit portability
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
        with:
          targets: i686-unknown-linux-gnu
      - run: cargo check --target i686-unknown-linux-gnu --lib --all-features

  # Run the cross-SIMD-width determinism tests under Intel SDE so the AVX-512
  # argmin and AVX-512BW packed-scan paths actually execute (and are checked
  # against the scalar oracle) even though GitHub runners may lack AVX-512
  # hardware. The `widths_agree` filter matches both
  # test_simd_widths_agree_with_scalar and test_packed_scan_widths_agree_with_scalar.
  avx512:
    name: avx512 (SDE emulation)
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: dtolnay/rust-toolchain@stable
      # v5.0 installs SDE 10.8.0. SDE 9.33 (the v2.4 default) predates current
      # rustc codegen and SIGSEGVs on binaries that run fine on real AVX-512
      # hardware and under SDE 10.8.0 (verified on an Intel Xeon w/ avx512bw).
      - uses: petarpetrovt/setup-sde@v5.0
      - name: Build tests
        run: cargo test --release --all-features --no-run
      - name: cross-impl determinism under emulated AVX-512 (Sapphire Rapids)
        run: ${SDE_PATH}/sde64 -spr -- cargo test --release --all-features widths_agree -- --nocapture