feat(SAC_LSTM_Bot): mirror-twin sparring partner + readiness check (#54)

- make_twin.sh: generates self-contained SacTwin dir in the sample-bots
  archive (own json/sh identity, own weights dir seeded from a frozen
  sac_best.zip copy, own round_counter) so RunTraining.java resolves it
  like any sample bot; re-running resets the twin to the frozen baseline.
- src/SAC_LSTM_Bot.nim: SACLSTM_BOT_JSON env overrides the baked-in bot
  json (loadBotInfo gives json total precedence, #49) so the same binary
  boots under the twin's name.
- sac_train.sh: chunk loop is a while, not for-over-seq — a crash on the
  FINAL chunk previously fell through ((chunk--);continue on an exhausted
  seq list) and exited 0 with budget incomplete; observed live vs SacTwin.

Readiness dry-run (#54): weighted pool Corners:1,SacTwin:3 picked the twin
in 3/4 chunks; all battles counter-checked; deterministic eval parsed;
main sac_best.zip/counter untouched by twin (twin counter advanced
independently); crash-restart proven end-to-end incl. final-chunk retry.
This commit is contained in:
2026-08-21 23:19:27 +02:00
parent edf26aa45d
commit 6a294ad7ad
3 changed files with 67 additions and 2 deletions
+6 -1
View File
@@ -101,7 +101,11 @@ eval_checkpoint() {
NUM_CHUNKS=$(( (TOTAL_ROUNDS + CHUNK_SIZE - 1) / CHUNK_SIZE ))
fails=0
for chunk in $(seq 1 "$NUM_CHUNKS"); do
chunk=1
# while, not `for chunk in $(seq ...)`: a crash on the FINAL chunk must rerun
# it (#54 — seq list is exhausted by then, so ((chunk--));continue fell through
# and the harness exited 0 with the budget incomplete).
while (( chunk <= NUM_CHUNKS )); do
ROUNDS=$CHUNK_SIZE
(( TOTAL_ROUNDS - (chunk - 1) * CHUNK_SIZE < CHUNK_SIZE )) && \
ROUNDS=$(( TOTAL_ROUNDS - (chunk - 1) * CHUNK_SIZE ))
@@ -120,6 +124,7 @@ for chunk in $(seq 1 "$NUM_CHUNKS"); do
fi
fails=0
(( chunk % EVAL_INTERVAL == 0 )) && eval_checkpoint
((chunk += 1))
done
echo ">>> training complete: $NUM_CHUNKS chunks. Logs:"