Skip to content

Commit 25c1c83

Browse files
authored
Merge branch 'main' into feat/v0.10.x-kani-codegen-contracts
2 parents f49a312 + ba329f3 commit 25c1c83

84 files changed

Lines changed: 15982 additions & 422 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/bench-nightly.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,13 @@ name: Bench Nightly
88
# Scheduled at 03:30 UTC, offset from other nightly jobs (e.g. fuzzing)
99
# so bench machines aren't contending for runner minutes.
1010

11+
# Each scheduled run is independent baseline data — must complete and
12+
# never cancel its predecessor. Use a per-run group so two scheduled
13+
# runs never queue or cancel each other.
14+
concurrency:
15+
group: ${{ github.workflow }}-${{ github.run_id }}
16+
cancel-in-progress: false
17+
1118
on:
1219
schedule:
1320
- cron: "30 3 * * *"
@@ -21,6 +28,10 @@ jobs:
2128
solver-benchmarks:
2229
name: Solver criterion nightly
2330
runs-on: ubuntu-latest
31+
# Belt-and-braces ceiling. milp/worst_64 is gated at the source level
32+
# (SPAR_BENCH_SLOW_MILP). Keep a hard cap so a future slow-bench
33+
# addition can't silently consume hours of runner budget.
34+
timeout-minutes: 60
2435
steps:
2536
- uses: actions/checkout@v4
2637
- uses: dtolnay/rust-toolchain@nightly

.github/workflows/ci.yml

Lines changed: 52 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
name: CI
22

3+
# Cancel superseded PR runs; never cancel runs on main / tags / scheduled
4+
# events. See docs/ci-concurrency.md (or the org-wide CI concurrency brief)
5+
# for rationale.
6+
concurrency:
7+
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
8+
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
9+
310
on:
411
push:
512
branches: [main]
@@ -14,7 +21,7 @@ jobs:
1421
# ── Fast checks ───────────────────────────────────────────────────────
1522
fmt:
1623
name: Format
17-
runs-on: ubuntu-latest
24+
runs-on: [self-hosted, linux, x64, light]
1825
steps:
1926
- uses: actions/checkout@v4
2027
- uses: dtolnay/rust-toolchain@nightly
@@ -24,7 +31,7 @@ jobs:
2431

2532
clippy:
2633
name: Clippy
27-
runs-on: ubuntu-latest
34+
runs-on: [self-hosted, linux, x64, rust-cpu]
2835
steps:
2936
- uses: actions/checkout@v4
3037
- uses: dtolnay/rust-toolchain@nightly
@@ -36,7 +43,7 @@ jobs:
3643
# ── Tests ─────────────────────────────────────────────────────────────
3744
test:
3845
name: Test
39-
runs-on: ubuntu-latest
46+
runs-on: [self-hosted, linux, x64, rust-cpu]
4047
steps:
4148
- uses: actions/checkout@v4
4249
- uses: dtolnay/rust-toolchain@nightly
@@ -58,7 +65,7 @@ jobs:
5865
# ── Bench compile smoke (fast regression gate) ──────────────────────
5966
bench-smoke:
6067
name: Bench compile smoke
61-
runs-on: ubuntu-latest
68+
runs-on: [self-hosted, linux, x64, rust-cpu]
6269
steps:
6370
- uses: actions/checkout@v4
6471
- uses: dtolnay/rust-toolchain@nightly
@@ -72,6 +79,13 @@ jobs:
7279
# ── Security audits ──────────────────────────────────────────────────
7380
audit:
7481
name: Security Audit (RustSec)
82+
# Stays on ubuntu-latest temporarily: smithy ships cargo-audit
83+
# v0.21.2 whose bundled rustsec parser still rejects RUSTSEC-2026-0037
84+
# ("unsupported CVSS version: 4.0"). v0.22.1 fixes it but the
85+
# `cargo install --locked cargo-audit` build trips over our
86+
# sccache-on-cc setup (aws-lc-sys C compile fails through sccache).
87+
# Follow-up: drop sccache from ralf's profile before bumping the
88+
# toolchains-role version, then move this back to [self-hosted, light].
7589
runs-on: ubuntu-latest
7690
steps:
7791
- uses: actions/checkout@v4
@@ -81,16 +95,29 @@ jobs:
8195

8296
deny:
8397
name: Cargo Deny
84-
runs-on: ubuntu-latest
98+
# Smithy has cargo-deny installed (toolchains role, v0.16.4).
99+
# We avoid EmbarkStudios/cargo-deny-action@v2 because it launches
100+
# a rootless container, which fails on our hardened systemd unit:
101+
# newuidmap is setuid but NoNewPrivileges=true blocks the escalation
102+
# (newuidmap: write to uid_map failed: Operation not permitted).
103+
runs-on: [self-hosted, linux, x64, light]
85104
steps:
86105
- uses: actions/checkout@v4
87-
- uses: EmbarkStudios/cargo-deny-action@v2
106+
- uses: dtolnay/rust-toolchain@stable
107+
- run: cargo deny --version
108+
# Skip the `advisories` check because both cargo-deny and
109+
# cargo-audit share the same rustsec parser, which currently
110+
# rejects RUSTSEC-2026-0037 ("unsupported CVSS version: 4.0").
111+
# bans / licenses / sources still gate. Re-add `advisories`
112+
# once smithy ships an upgraded rustsec; the audit job (still
113+
# on ubuntu-latest) covers vulnerability matching meanwhile.
114+
- run: cargo deny check bans licenses sources
88115

89116
# ── Code coverage ────────────────────────────────────────────────────
90117
coverage:
91118
name: Code Coverage
92119
needs: [test]
93-
runs-on: ubuntu-latest
120+
runs-on: [self-hosted, linux, x64, rust-cpu]
94121
steps:
95122
- uses: actions/checkout@v4
96123
- uses: dtolnay/rust-toolchain@nightly
@@ -122,7 +149,9 @@ jobs:
122149
# ── Miri (undefined behavior, pointer provenance) ───────────────────
123150
miri:
124151
name: Miri
125-
runs-on: ubuntu-latest
152+
# lean-mem class — Miri allocates aggressively and benefits from the 24G
153+
# MemoryHigh ceiling on smithy lean-mem runners over the 12G rust-cpu cap.
154+
runs-on: [self-hosted, linux, x64, lean-mem]
126155
steps:
127156
- uses: actions/checkout@v4
128157
- uses: dtolnay/rust-toolchain@nightly
@@ -145,7 +174,7 @@ jobs:
145174
# parser/scheduler invariants get exercised on every change.
146175
proptest:
147176
name: Proptest (extended)
148-
runs-on: ubuntu-latest
177+
runs-on: [self-hosted, linux, x64, rust-cpu]
149178
steps:
150179
- uses: actions/checkout@v4
151180
- uses: dtolnay/rust-toolchain@nightly
@@ -159,7 +188,10 @@ jobs:
159188
mutants:
160189
name: Mutation Testing
161190
needs: [test]
162-
runs-on: ubuntu-latest
191+
# lean-mem — many parallel cargo invocations, RAM pressure under -j 4.
192+
# The full-workspace exhaustive run lives in mutants-weekly.yml; this
193+
# gating job stays narrow (spar-analysis) with a survivor ratchet.
194+
runs-on: [self-hosted, linux, x64, lean-mem]
163195
steps:
164196
- uses: actions/checkout@v4
165197
- uses: dtolnay/rust-toolchain@nightly
@@ -196,7 +228,7 @@ jobs:
196228
# ── Fuzz smoke (60s per target on PRs) ──────────────────────────────
197229
fuzz-smoke:
198230
name: Fuzz smoke (60s/target)
199-
runs-on: ubuntu-latest
231+
runs-on: [self-hosted, linux, x64, rust-cpu]
200232
# Only run on PRs — pushes to main hit the nightly workflow instead.
201233
if: github.event_name == 'pull_request'
202234
steps:
@@ -222,7 +254,7 @@ jobs:
222254
# ── Supply chain verification ───────────────────────────────────────
223255
supply-chain:
224256
name: Supply Chain (cargo-vet)
225-
runs-on: ubuntu-latest
257+
runs-on: [self-hosted, linux, x64, light]
226258
steps:
227259
- uses: actions/checkout@v4
228260
- uses: dtolnay/rust-toolchain@stable
@@ -239,7 +271,7 @@ jobs:
239271
# in artifacts/, safety/stpa/, and rivet.yaml.
240272
rivet-validate:
241273
name: Rivet validate (artifacts)
242-
runs-on: ubuntu-latest
274+
runs-on: [self-hosted, linux, x64, rust-cpu]
243275
steps:
244276
- uses: actions/checkout@v4
245277
- uses: dtolnay/rust-toolchain@stable
@@ -265,6 +297,9 @@ jobs:
265297
# Time budget: cold cache ≤30 min, warm ≤5 min (per #135).
266298
bazel-test:
267299
name: Bazel test (//...)
300+
# Stays on ubuntu-latest until Bazel is installed on the smithy host.
301+
# Tracked as a follow-up: smithy/group_vars/all.yml could add a
302+
# bazel apt-installable. Until then, hosted handles this.
268303
runs-on: ubuntu-latest
269304
continue-on-error: true
270305
timeout-minutes: 35
@@ -311,6 +346,10 @@ jobs:
311346
# 3. At that point, extend MAX_TASKS from 4 to 8 and re-tune unwinds.
312347
kani:
313348
name: Kani Bounded Model Checking
349+
# Stays on ubuntu-latest because kani-verifier bundles CBMC (~100 MB)
350+
# which we don't pre-install on smithy. Once smithy ships Kani as a
351+
# toolchain, switch to rust-cpu (the verification is RAM-modest but
352+
# CPU-bound; CBMC is single-threaded per harness).
314353
runs-on: ubuntu-latest
315354
continue-on-error: true
316355
steps:

.github/workflows/fuzz-nightly.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
name: Fuzz (nightly)
22

3+
# Each scheduled fuzz run is independent corpus + crash data — must
4+
# complete and never cancel its predecessor. Per-run group so two
5+
# scheduled runs never queue or cancel each other.
6+
concurrency:
7+
group: ${{ github.workflow }}-${{ github.run_id }}
8+
cancel-in-progress: false
9+
310
on:
411
schedule:
512
# Daily 03:00 UTC
@@ -49,7 +56,10 @@ jobs:
4956
- name: Run fuzz target for 1h
5057
env:
5158
TARGET: ${{ matrix.target }}
52-
run: cargo +nightly fuzz run "$TARGET" -- -max_total_time=3600 -timeout=10
59+
# `--target x86_64-unknown-linux-gnu` avoids the cargo-fuzz default
60+
# musl target whose statically-linked libc is incompatible with
61+
# AddressSanitizer. Same fix as the PR-time fuzz smoke (PR #142).
62+
run: cargo +nightly fuzz run --target x86_64-unknown-linux-gnu "$TARGET" -- -max_total_time=3600 -timeout=10
5363

5464
- name: Upload corpus
5565
if: always()
Lines changed: 143 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,143 @@
1+
name: Mutants Weekly
2+
3+
# Heavy-quality counterpart to the gating `mutants:` job in ci.yml.
4+
# That one runs on every PR with a survivor-count ratchet against
5+
# spar-analysis only. THIS one runs across the whole workspace on a
6+
# weekly cadence (and on demand) — no gating, just a long-form
7+
# quality signal you read async.
8+
#
9+
# Resource posture (DD: see smithy/artifacts/design-decisions.yaml):
10+
# - lean-mem runners (24 G MemoryHigh, 24 G usable per job)
11+
# - 12 h timeout cap
12+
# - never cancel an in-flight run; let it finish even when overlapping refs land
13+
# - results land in the run's GITHUB_STEP_SUMMARY + an uploaded artefact
14+
# (90-day retention) — no PR red lights, no Issue auto-filing yet
15+
# (that's a future iteration once the report shape stabilises)
16+
17+
on:
18+
schedule:
19+
- cron: "0 2 * * 0" # 02:00 UTC every Sunday
20+
push:
21+
# TEMPORARY: trigger on push when this file changes, so the workflow
22+
# can be exercised from a PR branch before it lands on main (GitHub's
23+
# workflow_dispatch and schedule both require the file to exist on
24+
# the default branch first). REMOVE this `push:` block before merging
25+
# the PR to main.
26+
paths:
27+
- .github/workflows/mutants-weekly.yml
28+
workflow_dispatch:
29+
inputs:
30+
shard:
31+
description: "Mutant shard, e.g. '0/8' (default), '1/8', or 'all' for the full workspace pass (~hours)."
32+
required: false
33+
default: "0/8"
34+
packages:
35+
description: "Cargo packages to mutate (space-separated -p list, empty = whole workspace)."
36+
required: false
37+
default: ""
38+
39+
concurrency:
40+
group: mutants-weekly
41+
# Quality jobs don't cancel; an interrupted mutation report is worse
42+
# than a delayed one. Two overlapping runs share the lean-mem pool;
43+
# cgroup limits keep each within 24 G.
44+
cancel-in-progress: false
45+
46+
jobs:
47+
mutants:
48+
name: cargo-mutants ${{ github.event.inputs.shard || 'shard 0/8' }}
49+
runs-on: [self-hosted, linux, x64, lean-mem]
50+
timeout-minutes: 720
51+
52+
steps:
53+
- uses: actions/checkout@v4
54+
55+
- uses: dtolnay/rust-toolchain@nightly
56+
57+
- uses: Swatinem/rust-cache@v2
58+
with:
59+
# Distinct cache key from the gating mutants — different mutation
60+
# set, different sccache hit profile.
61+
shared-key: mutants-weekly
62+
63+
- name: Install cargo-mutants
64+
uses: taiki-e/install-action@v2
65+
with:
66+
tool: cargo-mutants
67+
68+
- name: Resolve inputs
69+
id: cfg
70+
run: |
71+
SHARD="${{ github.event.inputs.shard || '0/8' }}"
72+
PACKAGES="${{ github.event.inputs.packages }}"
73+
PKGS_FLAG=""
74+
if [ -n "$PACKAGES" ]; then
75+
for p in $PACKAGES; do
76+
PKGS_FLAG="$PKGS_FLAG -p $p"
77+
done
78+
fi
79+
SHARD_FLAG=""
80+
if [ "$SHARD" != "all" ]; then
81+
SHARD_FLAG="--shard $SHARD"
82+
fi
83+
echo "shard=$SHARD" >> $GITHUB_OUTPUT
84+
echo "shard_flag=$SHARD_FLAG" >> $GITHUB_OUTPUT
85+
echo "pkgs_flag=$PKGS_FLAG" >> $GITHUB_OUTPUT
86+
echo "Effective: cargo mutants ${PKGS_FLAG:-(workspace)} $SHARD_FLAG --timeout 180 --jobs 8 --output mutants-out -- --lib"
87+
88+
- name: Run cargo-mutants
89+
id: run
90+
# `|| true` so the report still uploads even when survivors exist;
91+
# the next step decides exit status from the missed.txt content.
92+
run: |
93+
set -o pipefail
94+
cargo mutants \
95+
${{ steps.cfg.outputs.pkgs_flag }} \
96+
${{ steps.cfg.outputs.shard_flag }} \
97+
--timeout 180 \
98+
--jobs 8 \
99+
--output mutants-out \
100+
--no-shuffle \
101+
-- --lib \
102+
|| echo "cargo-mutants exited non-zero (survivors expected; see report)"
103+
104+
- name: Summarise to job summary
105+
if: always()
106+
run: |
107+
MISSED=0
108+
[ -f mutants-out/missed.txt ] && MISSED=$(wc -l < mutants-out/missed.txt | tr -d ' ')
109+
CAUGHT=0
110+
[ -f mutants-out/caught.txt ] && CAUGHT=$(wc -l < mutants-out/caught.txt | tr -d ' ')
111+
UNVIABLE=0
112+
[ -f mutants-out/unviable.txt ] && UNVIABLE=$(wc -l < mutants-out/unviable.txt | tr -d ' ')
113+
TIMEOUT=0
114+
[ -f mutants-out/timeout.txt ] && TIMEOUT=$(wc -l < mutants-out/timeout.txt | tr -d ' ')
115+
{
116+
echo "## cargo-mutants weekly — ${{ steps.cfg.outputs.shard }}"
117+
echo
118+
echo "Runner: \`$(hostname)\` (${SMITHY_RUNNER_CLASS:-unknown class})"
119+
echo
120+
echo "| Outcome | Count |"
121+
echo "|---------|------:|"
122+
echo "| 🟥 Missed (test suite did not catch) | $MISSED |"
123+
echo "| 🟩 Caught (test suite caught) | $CAUGHT |"
124+
echo "| ⏱ Timeout | $TIMEOUT |"
125+
echo "| ⚪ Unviable (build failed) | $UNVIABLE |"
126+
echo
127+
if [ "$MISSED" -gt 0 ] && [ -f mutants-out/missed.txt ]; then
128+
echo "<details><summary>First 50 missed mutants</summary>"
129+
echo
130+
echo '```'
131+
head -50 mutants-out/missed.txt
132+
echo '```'
133+
echo "</details>"
134+
fi
135+
} >> "$GITHUB_STEP_SUMMARY"
136+
137+
- name: Upload mutants report
138+
if: always()
139+
uses: actions/upload-artifact@v4
140+
with:
141+
name: mutants-out-${{ github.run_id }}
142+
path: mutants-out/
143+
retention-days: 90

0 commit comments

Comments
 (0)