sheng 0.1.0

Register-resident refutation sieves for regex. Builds Hartmanis-Stearns SP-quotients of a pattern's automaton small enough to live in a SIMD register, and uses them to prove a document match-free before a real engine ever walks it. Sound by construction: a sieve may pass a non-matching document, never reject a matching one.
Documentation
name: CI

on:
  push:
    branches: [main]
  pull_request:

permissions:
  contents: read

concurrency:
  group: ci-${{ github.workflow }}-${{ github.ref }}
  cancel-in-progress: true

env:
  CARGO_TERM_COLOR: always
  RUSTFLAGS: -D warnings

jobs:
  fmt:
    name: fmt
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
      - uses: dtolnay/rust-toolchain@2c7215f132e9ebf062739d9130488b56d53c060c # master
        with:
          toolchain: stable
          components: rustfmt
      - run: cargo fmt --all --check

  # Clippy and the release-mode test suite both run on real x86_64 (SSSE3) and real
  # macOS arm64 (NEON) hardware — this matrix *is* the cross-architecture SIMD
  # differential the crate's soundness rests on, not a stand-in for it. Vector
  # kernels that only ever run on emulated or cross-compiled targets have never
  # actually executed the intrinsics this crate ships.
  clippy:
    name: clippy (${{ matrix.label }})
    strategy:
      fail-fast: false
      matrix:
        include:
          - os: ubuntu-latest
            label: x86_64-ssse3
          - os: macos-14
            label: aarch64-neon
    runs-on: ${{ matrix.os }}
    steps:
      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
      - uses: dtolnay/rust-toolchain@2c7215f132e9ebf062739d9130488b56d53c060c # master
        with:
          toolchain: stable
          components: clippy
      - uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
      - run: cargo clippy --workspace --all-targets --all-features --locked -- -D warnings

  test:
    name: test (${{ matrix.label }}, release)
    strategy:
      fail-fast: false
      matrix:
        include:
          - os: ubuntu-latest
            label: x86_64-ssse3
          - os: macos-14
            label: aarch64-neon
    runs-on: ${{ matrix.os }}
    steps:
      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
      - uses: dtolnay/rust-toolchain@2c7215f132e9ebf062739d9130488b56d53c060c # master
        with:
          toolchain: stable
      - uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
      # Release, not dev: the SIMD kernels are the whole point of the crate and the
      # soundness/kernel-agreement suites are the tests that matter here, so they run
      # under the profile a real caller links against.
      - run: cargo test --workspace --release --all-features --locked
      - run: cargo run --release --example survey

  doc:
    name: rustdoc
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
      - uses: dtolnay/rust-toolchain@2c7215f132e9ebf062739d9130488b56d53c060c # master
        with:
          toolchain: stable
      - uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
      - env:
          RUSTDOCFLAGS: -D warnings
        run: cargo doc --no-deps --all-features --locked

  # The floor `rust-version` in Cargo.toml is a promise, not an aspiration — this is
  # what checks it every push instead of on the day a caller's pinned toolchain
  # discovers it first.
  msrv:
    name: msrv
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
      - id: msrv
        run: echo "version=$(sed -n 's/^rust-version = "\(.*\)"/\1/p' Cargo.toml)" >> "$GITHUB_OUTPUT"
      - uses: dtolnay/rust-toolchain@2c7215f132e9ebf062739d9130488b56d53c060c # master
        with:
          toolchain: ${{ steps.msrv.outputs.version }}
      - uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
      - run: cargo check --workspace --all-targets --all-features --locked

  deny:
    name: cargo-deny
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
      - uses: taiki-e/install-action@67729d5c413db75907f0ad1e39bb04b9c868ff60 # v2.85.7
        with:
          tool: cargo-deny
      - run: cargo deny check

  # `cargo publish --dry-run` builds the package exactly as crates.io would receive
  # it and fails on anything the real publish would reject — the guarded release
  # workflow trusts this job rather than repeating the check under time pressure.
  package:
    name: package
    needs: [fmt, clippy, test, doc, msrv, deny]
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
      - uses: dtolnay/rust-toolchain@2c7215f132e9ebf062739d9130488b56d53c060c # master
        with:
          toolchain: stable
      - uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1
      - run: cargo package --locked
      - run: cargo publish --dry-run --locked