#!/usr/bin/env bash # SPDX-License-Identifier: MIT # The single gate (family charter: scripts/ladder.sh in the Rust tiers): every rung in # order, stopping at the first that fails. docs/status.md has each rung's command and count. # # scripts/ladder.sh rungs 0-5 and the speed report (the gate on every kept commit) # FAULTS=1 scripts/ladder.sh and rung 6, the seeded faults # FULL=1 scripts/ladder.sh rung 2 with the four full MAME replays (129 M instructions, about # ten minutes on one core); the fork's default is FULL=0, the # 2,000,000-instruction bus lockstep prefix of each trace only # # The reference (sh2-python at its pin, scripts/env.sh) writes its traces once into # external/reference-cache//; later runs re-run only the Rust side. Everything runs # under nice; PYPY_GC_NURSERY=1M for the reference. fmt and clippy run when the rustup # stable toolchain is present. set -euo pipefail ROOT=$(cd "$(dirname "$0")/.." && pwd) source "$ROOT/scripts/env.sh" require_reference export FULL=${FULL:-0} if [ -x "$STABLE/cargo-clippy" ]; then PATH="$STABLE:$PATH" cargo fmt --check --manifest-path "$ROOT/Cargo.toml" PATH="$STABLE:$PATH" nice -n 19 cargo clippy -q --release --all-targets -j "$JOBS" --manifest-path "$ROOT/Cargo.toml" -- -D warnings echo "fmt and clippy: clean" fi build nice -n 19 cargo test --release -q -j "$JOBS" --manifest-path "$ROOT/Cargo.toml" > /dev/null echo "cargo test: passed" for rung in 0 1 2 3 4; do echo "== rung $rung" "$ROOT/scripts/rung$rung.sh" | tail -12 done echo "== rung 5" for seed in 1 2; do SEED=$seed "$ROOT/scripts/rung5.sh" | tail -2; done if [ "${FAULTS:-0}" = 1 ]; then echo "== rung 6" python3 "$ROOT/scripts/seeded_faults.py" --jobs "${FAULT_JOBS:-4}" | tail -4 fi echo "== speed (reported, not a gate)" "$ROOT/scripts/speed.sh" echo "ladder: passed"