fix(botapi): static event queue storage + end-of-battle train wait
The event queue's heap seq was the last GC'd block surviving across rounds: each round runs on a freshly spawned bot thread, so the N+1 thread realloc'd a block grown by dead thread N's allocator mid-round (at the next capacity doubling, ~turn 104) -> rawDealloc SIGSEGV in addEvent (7 gdb-confirmed coredumps). Replace with a static array[MAX_QUEUE_SIZE, BotEvent] + eventsLen: no heap block crosses threads, realloc can never happen. Also fix the harness aborting the final round mid-train: PPO_Bot's onRoundEnded trains synchronously after the runner's RoundEndedEvent, so the counter read right after awaitResults() is the stale pre-train value and System.exit killed the bot inside ppoUpdate. Poll up to 60s for the counter to catch up before declaring the battle incomplete. Verified: 72 consecutive rounds vs Fire, 100% wins, all rounds trained (counter advanced 1:1), zero coredumps since the fix.
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
TRAINING_OPPONENT=Fire
|
||||
TRAINING_ROUNDS=3000
|
||||
PPOB_LOG_FILE=/home/davide/Projects/SirRoboGarage/tools/training_runner/logs/fire_training.jsonl
|
||||
PPOB_LR=0.0003
|
||||
PPOB_CLIP_EPSILON=0.2
|
||||
PPOB_ENTROPY_COEFF=0.01
|
||||
PPOB_VALUE_LOSS_COEFF=0.5
|
||||
PPOB_MAX_GRAD_NORM=0.5
|
||||
PPOB_GAMMA=0.99
|
||||
PPOB_LAM=0.95
|
||||
PPOB_EPOCHS=4
|
||||
PPOB_MINI_BATCH_SIZE=64
|
||||
PPOB_LOG_STD_FLOOR=-3.0
|
||||
PPOB_INITIAL_LOG_STD=0.0
|
||||
|
||||
# PPOB_EVAL_ONLY=1 → freeze training (pure evaluation)
|
||||
Reference in New Issue
Block a user