1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
# Continuous integration: the same gates used locally before every
# commit — formatting, lints as errors across all targets (which also
# compile the benchmarks), and the test suite including doctests. The
# test steps name their targets: `--all-targets` implies `--benches`,
# which would execute every Criterion binary in test mode regardless
# of the targets' `test = false`.
name: CI
on:
push:
branches:
pull_request:
env:
CARGO_TERM_COLOR: always
jobs:
check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: rustfmt, clippy
- uses: Swatinem/rust-cache@v2
- run: cargo fmt --check
- run: cargo clippy --all-targets -- -D warnings
- run: cargo test --lib --tests --examples
# Named targets omit doctests, so they get their own run.
- run: cargo test --doc
# The simd and cuda backends are real on Linux — simd executes
# its grid here, and cuda (no GPU on this runner) proves its
# decline paths and skip guards live, falling through to simd.
- run: cargo test --lib --tests --examples --features cuda,simd
- run: cargo test --doc --features cuda,simd
# The Apple backend features compile to safe stubs off macOS;
# this keeps the stubs honest.
- run: cargo clippy --all-targets --all-features -- -D warnings
# The declared floor is a contract, so it is tested as one: the
# default gate on exactly the `rust-version` toolchain. Backend
# features may need newer toolchains and are not part of the floor.
msrv:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@1.88
- uses: Swatinem/rust-cache@v2
- run: cargo test --lib --tests --examples
- run: cargo test --doc
# The Apple backends are real only on macOS; this job runs the
# accelerate and metal grids, determinism, end-to-end training,
# and the triple-feature chain order on Apple hardware. The
# macos-26 image exposes the paravirtualized GPU (macos-14
# reported no Metal device); the GPU tests skip cleanly wherever
# the device is missing.
check-macos:
runs-on: macos-26
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
with:
components: clippy
- uses: Swatinem/rust-cache@v2
- run: cargo clippy --all-targets --features accelerate,metal,simd -- -D warnings
- run: cargo test --lib --tests --examples --features accelerate,metal,simd
- run: cargo test --doc --features accelerate,metal,simd
# Emission conformance runs for real: without a toolchain the
# round-trip and execution tests pass vacuously, so this job
# installs `jax` (whose bundled MLIR bindings carry the StableHLO
# parser and reference interpreter) and points the suite's two
# evaluator seams at the tools scripts. Every emitted module must
# parse through an external parser and execute to the plan's own
# results within the envelope.
conformance:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- run: pip install jax
- run: cargo test emission
env:
TOPOS_STABLEHLO_VALIDATOR: python3 tools/validate-stablehlo.py
TOPOS_STABLEHLO_EVALUATOR: python3 tools/eval-stablehlo.py