#!/usr/bin/env bash # M6: plays bot-only matches in which every other bot builds, under nice, and compares # builders with the rest. One JSON line per match goes to build/bot_builds/matches.jsonl. # See tools/bot_builds.gd for what is checked. # # tools/bot_builds.sh seeds 501 to 540 # BOT_BUILDS_SEEDS=5 BOT_BUILDS_FIRST=40 tools/bot_builds.sh set -uo pipefail cd "$(dirname "${BASH_SOURCE[0]}")/.." count="${BOT_BUILDS_SEEDS:-40}" first="${BOT_BUILDS_FIRST:-501}" out="build/bot_builds" mkdir -p "$out" raw="$(nice -n 15 tools/godot.sh --script res://tools/bot_builds.gd -- --seeds="$count" --first="$first" --out="$PWD/$out/matches.jsonl" 2>&1)" code=$? grep -E '^bot-builds' <<<"$raw" if grep -qE 'SCRIPT ERROR|^ERROR' <<<"$raw"; then echo "bot-builds FAIL: engine or script errors" grep -E -A3 'SCRIPT ERROR|^ERROR' <<<"$raw" | head -n 20 code=1 fi if [[ "$code" -ne 0 ]] && ! grep -q '^bot-builds' <<<"$raw"; then echo "bot-builds FAIL: the run exited $code" tail -n 15 <<<"$raw" fi exit "$code"