#!/bin/bash
# ⓑ 발주 런 드라이버 — 서로 다른 그래프로 번갈아 제출(노드 출력 재사용 함정 회피)
OUT=$HOME/ai/experiments/h3-fast-wf-repro
TSV=$OUT/runs.tsv
printf 'tag\tsteps\taccel\tres\tthermal\tstart_epoch\tend_epoch\twall_s\n' > "$TSV"
run () {  # tag steps accel res thermal
  local tag=$1 steps=$2 accel=$3 res=$4 thermal=$5
  local s=$(date +%s)
  echo "=== RUN $tag (steps=$steps accel=$accel res=$res thermal=$thermal) start=$s ==="
  DOCKAIQ_BYPASS=1 python3 "$HOME/work/dock/scripts/h3-r2v-submit.py" --workflow /tmp/h3-r2v-$tag.json
  local rc=$? e=$(date +%s)
  printf '%s\t%s\t%s\t%s\t%s\t%s\t%s\t%s\n' "$tag" "$steps" "$accel" "$res" "$thermal" "$s" "$e" "$((e-s))" >> "$TSV"
  echo "=== END $tag rc=$rc wall=$((e-s))s ==="
  [ $rc -ne 0 ] && echo "❌ $tag 실패 — 계속 진행하되 표에서 제외 판정"
}
run off4      4 off 512x896 cold
run on4       4 on  512x896 warm
run off6      6 off 512x896 warm
run off4      4 off 512x896 warm
run off8      8 off 512x896 warm
run off4-480  4 off 480x832 warm
echo "=== ALL DONE ==="
cat "$TSV"
