adv-accept: run-box.sh through lease pool (no sweep.lock); attempts census prints progress
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
This commit is contained in:
parent
fde905de46
commit
01f8a109fc
2 changed files with 17 additions and 16 deletions
|
|
@ -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: <log>.pid (the run) and <log>.pgid (its process group). Kill ONLY by pid file:
|
||||
# kill -- -"$(cat <log>.pgid)"
|
||||
# Run ON the box, from anywhere:
|
||||
# run-box.sh <tag> <bin> <args...>
|
||||
# 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 <threads> free cores of the bounded pool (cores 8 to 95, shared with
|
||||
# the builds), never fewer than <min>, 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/<tag>.log, .pid (the lease), .pgid.
|
||||
# Kill ONLY by pid file: kill -- -"$(cat <log>.pgid)".
|
||||
# run-box.sh <tag> <threads> <min> <cmd...> (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 -- -<pgid> 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"
|
||||
|
|
|
|||
|
|
@ -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>, u64, Vec<String>, 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);
|
||||
|
|
|
|||
Loading…
Reference in a new issue