feat(snake): optimize duels and persist customizations
Build and Push Docker Container / build-and-push (push) Successful in 7m29s
Build and Push Docker Container / build-and-push (push) Successful in 7m29s
- Add deadline-aware iterative duel search with bitboards and tuple bodies. - Reuse transposition bounds and move-order hints across search depths. - Persist snake colors, heads, and tails in SQLite and PostgreSQL. - Restore customization metadata when hydrating dashboard replays. - Cover duel deadlines, cache reuse, schema storage, and replay output.
This commit is contained in:
@@ -27,6 +27,7 @@ def hydrate_replay_turns(game_row, turn_rows, snake_rows, decode_json:Callable)
|
||||
api_snakes = []
|
||||
for snake_row in rows_by_turn.get(turn, []):
|
||||
body = decode_json(snake_row["body_json"]) or []
|
||||
customizations = decode_json(snake_row["customizations_json"]) or {}
|
||||
api_snake = {
|
||||
"id": snake_row["snake_id"],
|
||||
"name": snake_row["snake_name"],
|
||||
@@ -34,6 +35,7 @@ def hydrate_replay_turns(game_row, turn_rows, snake_rows, decode_json:Callable)
|
||||
"length": snake_row["length"],
|
||||
"head": {"x": snake_row["head_x"], "y": snake_row["head_y"]},
|
||||
"body": body,
|
||||
"customizations": customizations,
|
||||
}
|
||||
if snake_row["latency"] is not None:
|
||||
api_snake["latency"] = snake_row["latency"]
|
||||
@@ -45,6 +47,7 @@ def hydrate_replay_turns(game_row, turn_rows, snake_rows, decode_json:Callable)
|
||||
"length": snake_row["length"],
|
||||
"head": api_snake["head"],
|
||||
"body": body,
|
||||
"customizations": customizations,
|
||||
"is_you": bool(snake_row["is_you"]),
|
||||
"inferred_move": snake_row["inferred_move"],
|
||||
"latency": snake_row["latency"],
|
||||
|
||||
Reference in New Issue
Block a user