#!/usr/bin/env bash # # Gated self-play match against a baseline binary. Historically this # always compared the live working-tree build against head_reference/ # -- generalized (2026-09-14) to take both binary paths as args so two # arbitrary builds (e.g. a file-storm-only worktree build vs. the # current working tree, to isolate one change at a time when several # have landed together -- see king_safety_data/HANDOFF.md's session # notes on not measuring two eval changes in one match) can be compared # without hand-rolling a match_play.py invocation each time. # # Usage: test_vs_head.sh [head_binary] [candidate_binary] [label] # # head_binary Baseline engine. Defaults to head_reference/typhoon # (the usual "is this better than last checkpoint" # question). # candidate_binary Candidate engine. Defaults to a fresh copy of the # live working-tree build (../typhoon) into # /tmp/typhoon/typhoon_match_play_candidate -- pass # an explicit path (already built) to skip that # copy/freeze step entirely, e.g. when comparing # two prebuilt worktree binaries. # label Distinguishes scratch dir/log/pgn-out so multiple # matches can run concurrently without colliding. # Defaults to "match". # # Examples: # test_vs_head.sh # old default behavior # test_vs_head.sh /tmp/typhoon/filestorm_only /tmp/typhoon/candidate queenprox_backflight set -e HEAD="${1:-../../head_reference/typhoon}" LABEL="${3:-match}" if [ -n "$2" ]; then CANDIDATE="$2" else cd .. gmake clean gmake release MP=1 PERF_COUNTERS=1 cd eval_tune CANDIDATE=/tmp/typhoon/typhoon_match_play_candidate cp -f ../typhoon ${CANDIDATE} fi python3 ./match_play.py \ ${HEAD} \ ${CANDIDATE} \ --pgn ../../pgn/twic_filtered.pgn \ --games 10000 \ --workers 12 \ --st 4 \ --sprt --elo0 0 --elo1 5 \ --scratch /usr/local/tmp/typhoon_match_${LABEL} \ --log ${LABEL}.log \ --pgn-out ../${LABEL}_games.pgn