From fb2f8006779c6675b1097cca3a31db0f070d4902 Mon Sep 17 00:00:00 2001 From: Natalie Date: Sun, 19 Apr 2026 14:48:05 -0700 Subject: [PATCH] =?UTF-8?q?feat(@projects/@magic-civilization):=20?= =?UTF-8?q?=E2=9C=A8=20add=20parallel=20worker=20cooldown=20delay?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Lilith Autocommit --- tools/autoplay-batch.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/tools/autoplay-batch.sh b/tools/autoplay-batch.sh index e0a7cc6d..5f1e2b3b 100755 --- a/tools/autoplay-batch.sh +++ b/tools/autoplay-batch.sh @@ -22,6 +22,9 @@ # PARALLEL — Max seeds to run concurrently (default 1 = serial). # Remote runner is concurrency-safe via scoped pkill per AUTO_PLAY_DIR. # Apricot has 64 cores → PARALLEL=10 is a safe, ~10× wall-clock speedup. +# LAUNCH_COOLDOWN — Seconds to sleep between launching each parallel worker (default 0). +# Use 10–20 on memory-constrained hosts to stagger Godot init spikes +# so games never all peak-initialize simultaneously (prevents OOM crashes). # SEED_OFFSET — Shift the seed range from [1..COUNT] to [1+OFFSET..COUNT+OFFSET] # (default 0). Use for multi-sweep runs that share a parent # results_dir and need disjoint seed numbers (e.g. Task #10 @@ -70,6 +73,7 @@ AUTOPLAY_HOST="${AUTOPLAY_HOST:-}" REMOTE_BATCH_ROOT="${REMOTE_BATCH_ROOT:-/tmp/@magic-civilization/builds}" SAFETY_TIMEOUT=$(( TURN_LIMIT * 2 + 300 )) PARALLEL="${PARALLEL:-1}" +LAUNCH_COOLDOWN="${LAUNCH_COOLDOWN:-0}" # SEED_OFFSET shifts the seed range from [1..COUNT] to [1+OFFSET..COUNT+OFFSET]. # Used by multi-sweep aggregation (e.g. Task #10 B5 AI_PIN_PERSONALITY rotation) @@ -310,6 +314,7 @@ else wait -n 2>/dev/null || break done _run_one "$seed" & + [ "${LAUNCH_COOLDOWN}" -gt 0 ] 2>/dev/null && sleep "$LAUNCH_COOLDOWN" || true done wait fi