#!/usr/bin/env bash
# Probe matrix against one trained base.
# harness/run_matrix.sh [probe seed]
# R* = replication of upstream's four arms; E* = extensions.
set -u
BASE=$1; OUT=$2; SEED=${3:-0}
CFG=configs/rep_s.yaml
PY=.venv/bin/python
mkdir -p "$OUT"
run() { # name, args...
local name=$1; shift
[ -f "$OUT/$name/probe.json" ] && { echo "skip $name"; return; }
echo "== $name $*"
OMP_NUM_THREADS=6 $PY harness/probe.py --config $CFG --base "$BASE" --out "$OUT/$name" \
--seed "$SEED" "$@" > "$OUT/$name.log" 2>&1 || echo "FAILED $name"
}
# replication: upstream's four arms, 524,288 characters
run R1_frozen_t1 --arm frozen --trunk-mult 1.0 --lanes chess
run R2_swap_t1 --arm swap --trunk-mult 1.0 --lanes chess --recover-chars 1048576
run R3_swap_t0.1 --arm swap --trunk-mult 0.1 --lanes chess
run R4_control_all --arm swap --trunk-mult 0.1 --lanes all
# extension: is it the trunk split, or just a lower rate?
run E1_swap_all0.1 --arm swap --trunk-mult 0.1 --pool-mult 0.1 --lanes chess
# extension: stability-plasticity frontier over the trunk multiplier
run E2_swap_t0.3 --arm swap --trunk-mult 0.3 --lanes chess
run E3_swap_t0.03 --arm swap --trunk-mult 0.03 --lanes chess
run E4_swap_t0 --arm swap --trunk-mult 0.0 --lanes chess
run E5_swap_t1_p0.1 --arm swap --trunk-mult 1.0 --pool-mult 0.1 --lanes chess
# extension: does forgetting stay flat for 8x longer?
run E6_swap_t0.1_4M --arm swap --trunk-mult 0.1 --lanes chess --chars 4194304 --eval-every 524288
run E7_control_4M --arm swap --trunk-mult 0.1 --lanes all --chars 4194304 --eval-every 524288
echo "matrix done: $OUT"