Speed up the simulator 5-7x with identical games (6.10)
Precompute board adjacency and square sets, look up opponents once per move, and cache walks that exclude only the start square. Every game is unchanged for the same seed, checked with agents/scripts/fingerprint_games.py. Plan: skip catch-up 6.9 (D44), stop running the random lineup (D45). Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -48,3 +48,14 @@ def test_boxed_in_pawn_moves_as_far_as_possible() -> None:
|
||||
paths = walks(corridor, Pos(0, 0), 5, {Pos(0, 0)}, can_enter_dojo=False)
|
||||
|
||||
assert paths == [(Pos(0, 1), Pos(0, 2))]
|
||||
|
||||
|
||||
def test_reused_walks_match_a_fresh_search_and_are_independent_copies() -> None:
|
||||
start = Pos(4, 4)
|
||||
off_board = Pos(-1, -1)
|
||||
|
||||
walks(BOARD, start, 6, {start}, can_enter_dojo=True).clear()
|
||||
reused = walks(BOARD, start, 6, {start}, can_enter_dojo=True)
|
||||
|
||||
assert reused
|
||||
assert reused == walks(BOARD, start, 6, {start, off_board}, can_enter_dojo=True)
|
||||
|
||||
Reference in New Issue
Block a user