Artifact e763027f8d730a55ddbcb6acec4f73ecfe9f22c525ca775a4f233506b22e509a:
- File
test/budget.sh
— part of check-in
[6d70dcc76a]
at
2026-11-12 19:36:41
on branch trunk
— Phase 1: the config parser, the no-change run and the speed bench
suit check parses suit.conf strictly and prints a canonical dump. Any unknown kind or key, duplicate, cycle or dangling name rejects the whole file with its line number.
suit run compares a stamp against the files it names and exits without writing, allocating or printing when nothing changed.
suit bench times suit run against an empty program built the same way and against /usr/bin/true, interleaved, and fails the build when the no-change run costs more than 1 ms over the empty program or 1 MiB more memory. It measured 0.65 to 0.94 ms over, quiet and under load. A system binary starts 0.6 to 1.5 ms faster than any built binary on macOS, so it is shown for information and is not the baseline.
94 unit checks, 100 shell cases and a libFuzzer target for the parser. (user: dmestas, size: 1381) [annotate] [blame] [check-ins using]
#!/bin/sh # The speed test: a no-change "suit run" may cost at most 1 ms and 1 MiB more # than an empty program built the same way (build/empty, next to the binary). Run once on a quiet machine, then again under CPU # load from loadgen, whose workers carry their own deadline. # SUIT names the binary (default build/suit). SUIT=${SUIT:-build/suit} case $SUIT in /*) ;; *) SUIT=$PWD/$SUIT ;; esac LOADGEN=${LOADGEN:-$HOME/.claude/bin/loadgen} LOAD_SECONDS=30 LOAD_WORKERS=8 ROUNDS=600 mkdir -p build/tmp T=$(mktemp -d "$PWD/build/tmp/budget.XXXXXX") || exit 1 trap 'rm -rf "$T"' EXIT INT TERM mkdir -p "$T/files" i=0 while [ $i -lt 100 ]; do echo "file $i" > "$T/files/f$i" i=$((i + 1)) done export SUIT_HOME="$T/home" "$SUIT" stamp "$T"/files/f* || exit 1 "$SUIT" run || { echo "budget: scratch stamp does not read back as unchanged"; exit 1; } failed=0 echo "== quiet (load average: $(uptime | sed 's/.*load averages*: //'))" "$SUIT" bench -n "$ROUNDS" || failed=1 [ -x "$LOADGEN" ] || { echo "budget: $LOADGEN not found"; exit 1; } echo "== under load: loadgen $LOAD_SECONDS $LOAD_WORKERS" "$LOADGEN" "$LOAD_SECONDS" "$LOAD_WORKERS" & load=$! sleep 2 echo "load average: $(uptime | sed 's/.*load averages*: //')" "$SUIT" bench -n "$ROUNDS" || failed=1 wait "$load" if [ "$failed" -eq 0 ]; then echo "budget: pass"; else echo "budget: FAIL"; fi [ "$failed" -eq 0 ]