igneum/tools/attack/adv-accept/run-box.sh
igneum-labs caa8564ec1 adv-accept: re-scope to the bypass lane, yield run script, sharded sweep, f8 harness as adv-live
Plan section 2.4 records the re-scope (Q1, Q2, Q5 here; Q3 and Q4 to the sibling lanes) and
the operating changes (both boxes, nice 10, the capacity layer's yield, queued sweeps). The
sweep is shardable (--seed-start), writes every row as it lands, counts the Q5 structure
and draws from the F8 label space so the unmodified f8 harness (src/live.rs, built as
adv-live) measures the live hot set of the same program. Devnet 3 epoch-0 program.json
copied read-only as an input.

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

47 lines
2.1 KiB
Bash

#!/usr/bin/env bash
# Start a long adv-accept run on a build box under this lane's rules (coordinator, 7 October 2026, 19:2x UK):
# nice 10 on every idle core (no core band), and the capacity layer's yield: a 5 s poll of /srv/builds/_locks
# SIGSTOPs the run's own process group while any build-<k>, measure or quiet lock is held and SIGCONTs it when
# they clear (infra/build-server/capacity/run.sh). The run never takes a build slot. Pid files beside the log:
# <log>.pid (the run), <log>.pgid (its process group), <log>.yield.pid (the yield loop). Kill ONLY by pid file:
# kill -- -"$(cat <log>.pgid)"; kill "$(cat <log>.yield.pid)"
# Run ON the box, from anywhere:
# run-box.sh <tag> <bin> <args...>
set -euo pipefail
tag="$1"; bin="$2"; shift 2
dir=/srv/builds/igneum-wt-adv-accept/adv
mkdir -p "$dir"
log="$dir/$tag.log"
[ -x "$bin" ] || { echo "no binary at $bin" >&2; exit 1; }
# own process group via setsid so STOP/CONT reach every thread and child
setsid nice -n 10 "$bin" "$@" > "$log" 2>&1 < /dev/null &
pid=$!
pgid=$(ps -o pgid= -p "$pid" 2>/dev/null | tr -d ' '); [ -n "$pgid" ] || pgid="$pid"
echo "$pid" > "$log.pid"; echo "$pgid" > "$log.pgid"
locks=/srv/builds/_locks
held() { # 0 when any build slot, measure or quiet lock is held
local f
for f in "$locks"/build-[0-9]* "$locks"/measure "$locks"/quiet; do
[ -e "$f" ] || continue
exec 9>>"$f"
if ! flock -n 9; then exec 9>&-; return 0; fi
exec 9>&-
done
return 1
}
(
paused=0
while kill -0 "$pid" 2>/dev/null; do
if held; then
if [ "$paused" = 0 ]; then kill -STOP -- "-$pgid" 2>/dev/null && paused=1; echo "$(date -u +%FT%TZ) pause (a build slot or hold is taken)" >> "$log.yield"; fi
else
if [ "$paused" = 1 ]; then kill -CONT -- "-$pgid" 2>/dev/null; paused=0; echo "$(date -u +%FT%TZ) resume" >> "$log.yield"; fi
fi
sleep 5
done
[ "$paused" = 1 ] && kill -CONT -- "-$pgid" 2>/dev/null
echo "$(date -u +%FT%TZ) run ended" >> "$log.yield"
) > /dev/null 2>&1 < /dev/null &
disown $! 2>/dev/null || true
echo $! > "$log.yield.pid"
echo "started pid $pid pgid $pgid yield-loop pid $(cat "$log.yield.pid"); log $log"