speed up loading and saving to redis that the move request are getting a answer when switching workers, strip data that neats to get recomuted every turn
Build and Push Docker Container / build-and-push (push) Successful in 4m49s

This commit is contained in:
2026-04-07 12:13:11 +02:00
parent f479541c04
commit f6e19e18e6
6 changed files with 58 additions and 7 deletions
+11
View File
@@ -100,6 +100,17 @@ class UltimateBattleSnake(TemplateSnake):
# RL bootstrap dataset recorder
self.rl_bootstrap = RLBootstrapDataset()
def __getstate__(self):
state = super().__getstate__()
# strip per-turn precomputed state — all re-assigned at the top of choose_move
state['_enemy_dmaps'] = []
state['_enemy_heads'] = []
state['_base_blocked'] = set()
state['_is_snail'] = False
state['_bfs_cache'] = {}
state['_bfs_cache_turn'] = -1
return state
# ── Env helpers ──────────────────────────────────────────────────────────────
def _get_timeout_buffer_ms(self) -> int: