AsianPlayer/TriDrive / code /eval /run_joint_evals_r2_controls.sh
AsianPlayer's picture
download
raw
4.32 kB
#!/usr/bin/env bash
# cwm3/eval/run_joint_evals_r2_controls.sh — WP3 R2 reviewer-control pairs on the FINAL assembly (pre-registered 2026-09-16T06:46:35Z, docs/decisions.md), CPU.
# bash eval/run_joint_evals_r2_controls.sh ["0 1 2"] [parallel=3] [render=1]
# Per seed k (identical rows; driver populations from the v2 causal kin targets, exactly the flags of the existing finalc_* pairs), A vs B:
# finalc_s<k>_<v>_vs_indep I1_<variant>_s<k>_final vs I1_indep_s<k>_final — the control vs the independent branches
# finalc_s<k>_<v>_vs_allminus I1_<variant>_s<k>_final vs I1_all_minus_road2drv_s<k>_final — the control vs the main model (env2veh + drv2veh)
# for v in: none (fine-tuning, no interaction), env2veh (V+E), drv2veh (V+U), naive (pretrained trunks + default-init fusion),
# naivefreshuw / naivefreshfamo / naivefreshpcgrad (from-scratch fusion + MTL; also _vs_naivefresh = vs plain summation), allminuspcgrad (main + PCGrad; _vs_allminus = vs plain summation)
# Pairs whose runs are unfinished are skipped (rerun later: every tag is idempotent on results/paired_compare.csv). The calls run `parallel` at a time
# through eval/pc_joint_locked.py (private rows, flock-guarded append). render=1 appends the report sections to results/tables/stage_final_ablations.md
# (eval/report_joint.py --append) and writes results/tables/modality_ablation.md (eval/report_modality_table.py).
set -u
cd "$(dirname "$0")/.."
PY=python
export OMP_NUM_THREADS=4 MKL_NUM_THREADS=4
SEEDS="${1:-0 1 2}"; PAR="${2:-3}"; RENDER="${3:-1}"
C="--kin-targets causal_routes --kin-version v2"
have_tag() { grep -q ",$1,$2,test," results/paired_compare.csv 2>/dev/null; }
done_run() { [[ -f results/runs/$1/PRED_DONE && -f results/runs/$1/TRAIN_DONE ]]; }
JOBS=$(mktemp /tmp/r2_controls_jobs.XXXXXX)
add() { # tag a b
local tag="$1" a="$2" b="$3"
done_run "$a" || { echo "skip $tag ($a not finished)"; return; }
done_run "$b" || { echo "skip $tag ($b not finished)"; return; }
for reg in manual engaged; do
have_tag "$tag" "$reg" && continue
echo "$tag $a $b $reg" >> "$JOBS"
done
}
declare -A DIR=( [none]=none [env2veh]=env2veh [drv2veh]=drv2veh [naive]=naive [naivefreshuw]=naive_fresh_uw [naivefreshfamo]=naive_fresh_famo
[naivefreshpcgrad]=naive_fresh_pcgrad [allminuspcgrad]=all_minus_road2drv_pcgrad )
for s in $SEEDS; do
I=I1_indep_s${s}_final; M=I1_all_minus_road2drv_s${s}_final; NF=I1_naive_fresh_s${s}_final
for v in none env2veh drv2veh naive naivefreshuw naivefreshfamo naivefreshpcgrad allminuspcgrad; do
A=I1_${DIR[$v]}_s${s}_final
add "finalc_s${s}_${v}_vs_indep" $A $I
add "finalc_s${s}_${v}_vs_allminus" $A $M
case $v in naivefresh*) add "finalc_s${s}_${v}_vs_naivefresh" $A $NF ;; esac
done
done
n=$(wc -l < "$JOBS" | tr -d ' ')
echo "[$(date -u +%H:%M:%SZ)] $n pairing calls to run ($PAR in parallel)"
if [[ "$n" -gt 0 ]]; then
xargs -P "$PAR" -L 1 bash -c 'tag=$0; a=$1; b=$2; reg=$3; echo "[$(date -u +%H:%M:%SZ)] == $tag $reg"; '"$PY"' eval/pc_joint_locked.py --regime "$reg" --a "results/runs/$a" --b "results/runs/$b" --tag "$tag" '"$C"' 2>&1 | grep -E "locked-append|appended|Error|Traceback|File \"|LAYOUT GUARD|no rows"' < "$JOBS"
fi
rm -f "$JOBS"
if [[ "$RENDER" == "1" ]]; then
$PY eval/report_joint.py --stage finalc --a none --b indep --claim B2 --seeds ${SEEDS// /,} --append \
--extra none:allminus env2veh:indep env2veh:allminus drv2veh:indep drv2veh:allminus naive:indep naive:allminus \
--out results/tables/stage_final_ablations.md 2>&1 | grep -E "written|verdict"
if done_run I1_naive_fresh_uw_s0_final || done_run I1_all_minus_road2drv_pcgrad_s0_final; then
$PY eval/report_joint.py --stage finalc --a naivefreshpcgrad --b naivefresh --claim B2 --seeds ${SEEDS// /,} --append \
--extra naivefreshuw:naivefresh naivefreshfamo:naivefresh naivefreshuw:indep naivefreshfamo:indep naivefreshpcgrad:indep \
naivefreshuw:allminus naivefreshfamo:allminus naivefreshpcgrad:allminus allminuspcgrad:allminus allminuspcgrad:indep \
--out results/tables/stage_final_ablations.md 2>&1 | grep -E "written|verdict"
fi
$PY eval/report_modality_table.py --seeds ${SEEDS// /,} 2>&1 | tail -n 3
fi
echo "[$(date -u +%H:%M:%SZ)] R2_CONTROL_EVALS_DONE"

Xet Storage Details

Size:
4.32 kB
·
Xet hash:
3a98575be12f7939ba77846125d5120fa4955105df99a6cbb9a2b44eeb826758

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.