From 01f8a109fc5c6bf0fa63fc7d57efc8c2fe735229 Mon Sep 17 00:00:00 2001 From: igneum-labs <337424239+igneum-labs@users.noreply.github.com> Date: Wed, 7 Oct 2026 19:24:45 +0000 Subject: [PATCH] adv-accept: run-box.sh through lease pool (no sweep.lock); attempts census prints progress Co-Authored-By: Claude Fable 5.1 --- tools/attack/adv-accept/run-box.sh | 26 +++++++++++--------------- tools/attack/adv-accept/src/main.rs | 7 ++++++- 2 files changed, 17 insertions(+), 16 deletions(-) diff --git a/tools/attack/adv-accept/run-box.sh b/tools/attack/adv-accept/run-box.sh index 68981fbac..e3f0328db 100644 --- a/tools/attack/adv-accept/run-box.sh +++ b/tools/attack/adv-accept/run-box.sh @@ -1,22 +1,18 @@ #!/usr/bin/env bash -# Start a long adv-accept run on a build box under this lane's rules (build-server lane and coordinator, 7 October -# 2026, 18:4x UTC): nice 10 on cores 8 to 95 only (cores 0 to 7 belong to release builds, the seed and the observer), -# no SIGSTOP yield (the ruling of 18:4x UTC replaced the capacity layer's yield: the scheduler shares the cores), no build -# slot taken. Pid files beside the log: .pid (the run) and .pgid (its process group). Kill ONLY by pid file: -# kill -- -"$(cat .pgid)" -# Run ON the box, from anywhere: -# run-box.sh +# Start a long adv-accept run on a build box through the build-server lane's lease pool (main, 7 October 2026, 20:17 UK: +# no sweep starts except through `lease pool`): up to free cores of the bounded pool (cores 8 to 95, shared with +# the builds), never fewer than , waiting up to 2 h; then nice 10 pinned to the cores taken. The command's +# "--threads {cores}" becomes the count taken (LEASE_CORES is exported too, for a loop of runs). No sweep.lock flock. +# Logs and pid files OUTSIDE the worktree mirror: /srv/builds/_adv-adv-accept/.log, .pid (the lease), .pgid. +# Kill ONLY by pid file: kill -- -"$(cat .pgid)". +# run-box.sh (cmd may be: bash -c '...' using $LEASE_CORES) set -euo pipefail -tag="$1"; bin="$2"; shift 2 -dir=/srv/builds/_adv-adv-accept # OUTSIDE the worktree mirror (correction 18:5x UTC: the mirror is synced and cleaned by build-remote.sh) +tag="$1"; threads="$2"; min="$3"; shift 3 +dir=/srv/builds/_adv-adv-accept mkdir -p "$dir" log="$dir/$tag.log" -[ -x "$bin" ] || { echo "no binary at $bin" >&2; exit 1; } -# the per-box sweep lock (coordinator, 19:55 BST, 7 October 2026): one bounded run per box at a time, the rest wait in -# order; the lock holder is the recorded pid (kill -- - ends the wait or the run) -printf -v cmd '%q ' nice -n 10 taskset -c 8-95 "$bin" "$@" -setsid flock /srv/builds/_adv/locks/sweep.lock -c "$cmd > $(printf '%q' "$log") 2>&1" < /dev/null > /dev/null 2>&1 & +setsid /srv/builds/_bin/lease pool "$threads" --min "$min" --label "adv-accept $tag" --owner adv-accept -- "$@" > "$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" -echo "$(date -u +%FT%TZ) queued pid $pid pgid $pgid behind the per-box sweep lock; nice 10 cores 8-95; log $log" | tee -a "$log.start" +echo "$(date -u +%FT%TZ) queued on lease pool $threads (min $min) pid $pid pgid $pgid; log $log" | tee -a "$log.start" diff --git a/tools/attack/adv-accept/src/main.rs b/tools/attack/adv-accept/src/main.rs index a94d61144..0cee33df7 100644 --- a/tools/attack/adv-accept/src/main.rs +++ b/tools/attack/adv-accept/src/main.rs @@ -620,6 +620,7 @@ fn attempts_cmd(args: &[String]) { println!("adv-accept attempts: seeds {seed_start}..{} ({seeds}), {threads} threads, cap {MAX_ATTEMPTS_V4}, force-exhaust {force_exhaust}", seed_start + seeds); let t0 = Instant::now(); let next = AtomicUsize::new(0); + let done_n = AtomicUsize::new(0); // per attempt index (0..=MAX): counts of each reject class; the accepted attempt histogram; exhaustions const CLASSES: usize = 11; fn class_of(r: &Reject) -> usize { @@ -641,7 +642,7 @@ fn attempts_cmd(args: &[String]) { let parts: Vec<(Vec<[u64; CLASSES]>, Vec, u64, Vec, Vec<(u64, u32, u64, f64)>)> = std::thread::scope(|sc| { let mut hs = Vec::new(); for _ in 0..threads { - let next = &next; + let (next, done_n) = (&next, &done_n); hs.push(sc.spawn(move || { let mut by_attempt = vec![[0u64; CLASSES]; MAX_ATTEMPTS_V4 as usize + 1]; let mut accepted_at = vec![0u64; MAX_ATTEMPTS_V4 as usize + 1]; @@ -672,6 +673,10 @@ fn attempts_cmd(args: &[String]) { Err(r) => { by_attempt[a as usize][class_of(&r)] += 1; } } } + let d = done_n.fetch_add(1, Ordering::Relaxed) + 1; + if d % 500 == 0 { + println!("progress: {d} of {seeds} seeds in {:.0} s", t0.elapsed().as_secs_f64()); + } if !done { exhausted += 1; let mut lr = candidate_class(&label, &epoch, cap, class);