perf(snake): cache survival rollout state
Build and Push Docker Container / build-and-push (push) Successful in 6m1s

- Cache occupancy bitboards for repeated multiplayer rollout positions.
- Memoize position evaluations to avoid duplicate flood-fill calculations.
- Reuse shared values while ranking simultaneous enemy responses.
- Include evaluation hits in Prism rollout telemetry.
- Document the optimization and bump Prism to version 1.4.0.
This commit is contained in:
2026-08-01 20:39:56 +02:00
parent 3a9af3f54d
commit 9b99b526e4
5 changed files with 33 additions and 11 deletions
+4 -2
View File
@@ -1,4 +1,4 @@
"""PrismBattleSnake_GPT_5_6_Sol v1.3.0
"""PrismBattleSnake_GPT_5_6_Sol v1.4.0
Built on ApexBattleSnake v1.0.0. All strategic logic is inherited.
Performance improvement: all spatial primitives (flood fill, territory,
@@ -30,6 +30,7 @@ Key speedups:
S16: Compact adversarial multiplayer rollout advances plausible enemy replies.
S17: Rollout memoization and adaptive depth spend time on ambiguous positions.
S18: Prism uses a deeper tactical horizon while retaining Apex's timeout reserve.
S19: Rollout occupancy and evaluation caches avoid repeated flood-fill work.
"""
from __future__ import annotations
@@ -53,7 +54,7 @@ class PrismBattleSnake_GPT_5_6_Sol(
BitboardSpatialMixin,
ApexBattleSnake,
):
VERSION = "1.3.0"
VERSION = "1.4.0"
def __init__(self) -> None:
super().__init__()
@@ -162,6 +163,7 @@ class PrismBattleSnake_GPT_5_6_Sol(
thinking["prism_rollout_nodes"] = self._survival_search_context.nodes
thinking["prism_rollout_cache_hits"] = (
self._survival_search_context.cache_hits
+ self._survival_search_context.evaluation_cache_hits
)
thinking["prism_rollout_deadline_exits"] = (
self._survival_search_context.deadline_exits