igneum/tools/attack/adv-cache-2/run-box.sh
igneum-labs 95f031487c adv-cache-2: harness crate (lines, days, warps, steer, windows censuses, plants, self-test), run-box.sh, queue files and drain (internal adversarial pass, not an independent review)
Built on both boxes against igneum-pow identical to c3d32437 (base build/master 5e412177). Self-test: day 20730 cache FNV 448274a57f508cbc, day 20733 7334fa46e5d972eb, program ids a785001687d8688a (attempt 1) and fce15bf61030be57 (attempt 0) all OK; plants quarter-lines, half-lines, const-item, t-low, all-quarter all fire.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
2026-10-07 18:49:01 +00:00

21 lines
1.2 KiB
Bash
Executable file

#!/usr/bin/env bash
# adv-cache-2 sweep runner, run ON a build box (internal adversarial pass, not an independent review).
# run-box.sh <name> <bin> <args...>
# Starts `nice -n 10 taskset -c 8-95 <bin> <args>` detached in its own session, log and pid file under
# /srv/builds/_adv-adv-cache-2/ (outside the worktree mirror, which build-remote.sh's sync would wipe), result files
# in the same directory. Cores 0 to 7 are never used (reserved for release builds, the seed and the observer).
# Rule history: the plan's SIGSTOP yield-to-builds loop was dropped by the coordinator's order at 19:3x BST on
# 7 October 2026 (a build slot is held nearly all the time on both boxes, so a yielding sweep never ran); the sweep
# runs at nice 10 and the scheduler arbitrates. Kill by pid file only: `kill -- -$(cat <pidfile>)`.
set -uo pipefail
NAME="$1"; shift
BIN="$1"; shift
ROOT=/srv/builds/_adv-adv-cache-2
mkdir -p "$ROOT"
LOG="$ROOT/$NAME.log"
PID="$ROOT/$NAME.pid"
if [ -f "$PID" ] && kill -0 "$(cat "$PID")" 2>/dev/null; then echo "already running: $NAME pid $(cat "$PID")"; exit 1; fi
setsid nohup nice -n 10 taskset -c 8-95 "$BIN" "$@" --out "$ROOT" > "$LOG" 2>&1 &
P=$!
echo "$P" > "$PID"
echo "started $NAME pid $P log $LOG"