Files

44 lines
2.5 KiB
Bash

#!/usr/bin/env bash
# Run ON the server: bash gen_stubs.sh PREFIX writes the queue stubs of the full comparison (setup + 9 blocks + report) and appends them to jobs/PRIORITY (backup first).
# Every stub sets ALL CMP_* variables itself (a restarted holder used to pass a window's variables on to later stubs). Finished cells are skipped by the job, so a pass only runs what is missing.
set -e
P=${1:?prefix}
H=$HOME/work/gpu-runs/holder2/jobs
cp $H/PRIORITY $H/PRIORITY.bak-$P
PRE='unset CMP_ARM CMP_TASKS CMP_OPTIONAL CMP_REPS CMP_VANILLA_LOSSY CMP_WALL CMP_ROUNDS CMP_RUN CMP_TARBALL'
cat > $H/$P-setup.sh <<'S'
#!/usr/bin/env bash
# codex-compare: CPU-only setup: shared node_modules of nestng-crm (idempotent) and the proof in the Codex sandbox (writes toolchain/NESTNG_OK)
set -e
export PATH=$(ls -d /data/leleka-e2e/codex-compare/toolchain/node-v*-linux-x64/bin | tail -1):$PATH
exec bash /data/leleka-e2e/codex-compare/tools/install-nestng-deps.sh
S
mk() { n=$P-$1; arm=$2; rep=$3; lossy=$4
if [ $arm = ours ]; then
cat > $H/$n.sh <<S
#!/usr/bin/env bash
# codex-compare: Leleka (release package, KAR, shipped), repetition $rep, ttt + nestng-crm (finished cells are skipped); nestng-crm REQUIRED
$PRE
export CMP_ARM=ours CMP_TASKS="ttt nestng-crm" CMP_REPS="$rep"
exec bash /data/leleka-e2e/codex-compare/tools/cmp_codex_job.sh
S
else
cat > $H/$n.sh <<S
#!/usr/bin/env bash
# codex-compare: vanilla Strata 0.2.6 (lossy defaults $([ $lossy = 1 ] && echo ON || echo OFF)), repetition $rep, ttt + nestng-crm (finished cells are skipped); holder-free window
$PRE
eval "exec \${LELEKA_STRA169_KAR_FD:-9}>&-"
touch "\$HOME/work/gpu-runs/holder2/jobs/STOP"
export CMP_ARM=vanilla CMP_VANILLA_LOSSY=$lossy CMP_TASKS="ttt nestng-crm" CMP_REPS="$rep"
setsid nohup bash /data/leleka-e2e/codex-compare/tools/cmp_window.sh $n > /data/leleka-e2e/codex-compare/window-$n.launch 2>&1 < /dev/null &
echo "$n: window launched"
S
fi; chmod +x $H/$n.sh; }
mk lel-r1 ours 1; mk van-r1 vanilla 1 1; mk vanl-r1 vanilla 1 0
mk vanl-r2 vanilla 2 0; mk van-r2 vanilla 2 1; mk lel-r2 ours 2
mk lel-r3 ours 3; mk vanl-r3 vanilla 3 0; mk van-r3 vanilla 3 1
sed "s/cmp-report/$P-report/" $H/cmp-report.sh > $H/$P-report.sh
chmod +x $H/$P-setup.sh $H/$P-report.sh
for n in setup lel-r1 van-r1 vanl-r1 vanl-r2 van-r2 lel-r2 lel-r3 vanl-r3 van-r3 report; do echo $P-$n; done >> $H/PRIORITY
echo "[$(date -u +%FT%TZ)] [DEV codex-compare] queued pass $P (setup, 9 blocks, report); backup PRIORITY.bak-$P" >> /data/leleka-e2e/decode/notes.md