Delete mcvs_vs_uct.py
Browse files- mcvs_vs_uct.py +0 -352
mcvs_vs_uct.py
DELETED
|
@@ -1,352 +0,0 @@
|
|
| 1 |
-
import torch
|
| 2 |
-
import chess
|
| 3 |
-
import numpy as np
|
| 4 |
-
import os
|
| 5 |
-
import time
|
| 6 |
-
import threading
|
| 7 |
-
import queue
|
| 8 |
-
import random
|
| 9 |
-
from datetime import datetime
|
| 10 |
-
from chess_mcvs import (
|
| 11 |
-
Chess,
|
| 12 |
-
PolicyNetworkCNN,
|
| 13 |
-
ValueNetworkCNN,
|
| 14 |
-
HilbertOrderedZoneDatabase,
|
| 15 |
-
MCVSSearcher,
|
| 16 |
-
UCTSearcher,
|
| 17 |
-
train_networks
|
| 18 |
-
)
|
| 19 |
-
|
| 20 |
-
class DetailedMoveLogger:
|
| 21 |
-
"""Logs detailed move generation statistics to move_log.txt"""
|
| 22 |
-
|
| 23 |
-
def __init__(self, filepath="move_log.txt"):
|
| 24 |
-
self.filepath = filepath
|
| 25 |
-
self.file_handle = None
|
| 26 |
-
|
| 27 |
-
def open(self):
|
| 28 |
-
self.file_handle = open(self.filepath, 'w', encoding='utf-8')
|
| 29 |
-
self._write_header()
|
| 30 |
-
|
| 31 |
-
def _write_header(self):
|
| 32 |
-
self.file_handle.write("=" * 100 + "\n")
|
| 33 |
-
self.file_handle.write("CHESS TOURNAMENT - MOVE GENERATION LOG (ZONE-ONLY ABLATION)\n")
|
| 34 |
-
self.file_handle.write(f"Started: {datetime.now().strftime('%Y-%m-%d %H:%M:%S')}\n")
|
| 35 |
-
self.file_handle.write("=" * 100 + "\n\n")
|
| 36 |
-
self.file_handle.flush()
|
| 37 |
-
|
| 38 |
-
def log_move(self, game_num, move_num, player_name, agent_type,
|
| 39 |
-
simulations, time_taken, move):
|
| 40 |
-
msg = (
|
| 41 |
-
f"[Game {game_num:3d}] [Move {move_num:3d}] "
|
| 42 |
-
f"Player: {player_name:5s} ({agent_type:4s}) | "
|
| 43 |
-
f"Sims: {simulations:5d} | "
|
| 44 |
-
f"Time: {time_taken:6.3f}s | "
|
| 45 |
-
f"Move: {move}\n"
|
| 46 |
-
)
|
| 47 |
-
self.file_handle.write(msg)
|
| 48 |
-
self.file_handle.flush()
|
| 49 |
-
|
| 50 |
-
def log_game_summary(self, game_num, winner, total_moves, mcvs_stats, uct_stats):
|
| 51 |
-
self.file_handle.write("\n" + "-" * 100 + "\n")
|
| 52 |
-
self.file_handle.write(f"GAME {game_num} SUMMARY - Winner: {winner}\n")
|
| 53 |
-
self.file_handle.write(f"Total moves: {total_moves}\n\n")
|
| 54 |
-
|
| 55 |
-
self.file_handle.write(f"MCVS (Zone-only) Statistics:\n")
|
| 56 |
-
self.file_handle.write(f" Total simulations: {mcvs_stats['total_sims']:,}\n")
|
| 57 |
-
self.file_handle.write(f" Avg sims/move: {mcvs_stats['avg_sims']:.1f}\n")
|
| 58 |
-
self.file_handle.write(f" Total time: {mcvs_stats['total_time']:.2f}s\n")
|
| 59 |
-
self.file_handle.write(f" Avg time/move: {mcvs_stats['avg_time']:.3f}s\n\n")
|
| 60 |
-
|
| 61 |
-
self.file_handle.write(f"UCT Statistics:\n")
|
| 62 |
-
self.file_handle.write(f" Total simulations: {uct_stats['total_sims']:,}\n")
|
| 63 |
-
self.file_handle.write(f" Avg sims/move: {uct_stats['avg_sims']:.1f}\n")
|
| 64 |
-
self.file_handle.write(f" Total time: {uct_stats['total_time']:.2f}s\n")
|
| 65 |
-
self.file_handle.write(f" Avg time/move: {uct_stats['avg_time']:.3f}s\n")
|
| 66 |
-
self.file_handle.write("-" * 100 + "\n\n")
|
| 67 |
-
self.file_handle.flush()
|
| 68 |
-
|
| 69 |
-
def close(self):
|
| 70 |
-
if self.file_handle:
|
| 71 |
-
self.file_handle.write("\n" + "=" * 100 + "\n")
|
| 72 |
-
self.file_handle.write(f"Completed: {datetime.now().strftime('%Y-%m-%d %H:%M:%S')}\n")
|
| 73 |
-
self.file_handle.write("=" * 100 + "\n")
|
| 74 |
-
self.file_handle.close()
|
| 75 |
-
|
| 76 |
-
class ChessTournament:
|
| 77 |
-
def __init__(self, num_games=200, time_per_move=3.0, max_moves_per_game=200, device='cpu',
|
| 78 |
-
output_file="chess_zone_only_results.txt", ablation_no_nets=True):
|
| 79 |
-
self.num_games = num_games
|
| 80 |
-
self.time_per_move = time_per_move
|
| 81 |
-
self.max_moves_per_game = max_moves_per_game
|
| 82 |
-
self.device = device
|
| 83 |
-
self.output_file = output_file
|
| 84 |
-
self.ablation_no_nets = ablation_no_nets
|
| 85 |
-
|
| 86 |
-
self.move_logger = DetailedMoveLogger()
|
| 87 |
-
self.move_logger.open()
|
| 88 |
-
|
| 89 |
-
self.zone_db = HilbertOrderedZoneDatabase("chess_zone_db.npz")
|
| 90 |
-
|
| 91 |
-
# ABLATION: Zone-only (no networks)
|
| 92 |
-
self.agent_mcvs = MCVSSearcher(
|
| 93 |
-
policy_net=None, value_net=None, zone_db=self.zone_db,
|
| 94 |
-
device=device, lambda_zone=1.0, use_nets=False
|
| 95 |
-
)
|
| 96 |
-
self.agent_uct = UCTSearcher()
|
| 97 |
-
|
| 98 |
-
self.report_lines = []
|
| 99 |
-
|
| 100 |
-
self.results = {
|
| 101 |
-
"MCVS": {"wins": 0, "as_white": 0, "as_black": 0, "moves": []},
|
| 102 |
-
"UCT": {"wins": 0, "as_white": 0, "as_black": 0, "moves": []},
|
| 103 |
-
"Draw": {"count": 0, "moves": []}
|
| 104 |
-
}
|
| 105 |
-
|
| 106 |
-
def log_line(self, text):
|
| 107 |
-
print(text)
|
| 108 |
-
self.report_lines.append(text)
|
| 109 |
-
|
| 110 |
-
def extract_training_and_zone_data(self, moves_made, pi_records, outcome):
|
| 111 |
-
game = Chess()
|
| 112 |
-
W_states = []
|
| 113 |
-
policies = []
|
| 114 |
-
values = []
|
| 115 |
-
|
| 116 |
-
winner_color = outcome.winner if outcome and outcome.winner is not None else None
|
| 117 |
-
|
| 118 |
-
for step, move in enumerate(moves_made):
|
| 119 |
-
W = game.get_weighted_adjacency_matrix().copy()
|
| 120 |
-
W_states.append(W)
|
| 121 |
-
|
| 122 |
-
legal_moves = game.get_legal_moves()
|
| 123 |
-
pi = np.zeros(4096, dtype=np.float32)
|
| 124 |
-
|
| 125 |
-
visits = pi_records[step]
|
| 126 |
-
if visits is not None and sum(visits.values()) > 0:
|
| 127 |
-
total = sum(visits.values())
|
| 128 |
-
for m, count in visits.items():
|
| 129 |
-
idx = m.from_square * 64 + m.to_square
|
| 130 |
-
pi[idx] = count / total
|
| 131 |
-
else:
|
| 132 |
-
if legal_moves:
|
| 133 |
-
p = 1.0 / len(legal_moves)
|
| 134 |
-
for m in legal_moves:
|
| 135 |
-
idx = m.from_square * 64 + m.to_square
|
| 136 |
-
pi[idx] = p
|
| 137 |
-
|
| 138 |
-
policies.append(pi)
|
| 139 |
-
|
| 140 |
-
if winner_color is None:
|
| 141 |
-
v = 0.0
|
| 142 |
-
else:
|
| 143 |
-
ptm_white = (step % 2 == 0)
|
| 144 |
-
ptm = chess.WHITE if ptm_white else chess.BLACK
|
| 145 |
-
v = 1.0 if winner_color == ptm else -1.0
|
| 146 |
-
values.append(v)
|
| 147 |
-
|
| 148 |
-
game.apply_move(move)
|
| 149 |
-
|
| 150 |
-
return W_states, policies, values
|
| 151 |
-
|
| 152 |
-
def play_game(self, agent_white, agent_black, game_idx):
|
| 153 |
-
game = Chess()
|
| 154 |
-
moves = 0
|
| 155 |
-
moves_made = []
|
| 156 |
-
pi_records = []
|
| 157 |
-
mcvs_stats = {"total_sims": 0, "total_time": 0.0, "moves": 0}
|
| 158 |
-
uct_stats = {"total_sims": 0, "total_time": 0.0, "moves": 0}
|
| 159 |
-
|
| 160 |
-
while not game.is_terminal() and moves < self.max_moves_per_game:
|
| 161 |
-
moves += 1
|
| 162 |
-
is_white = game.board.turn
|
| 163 |
-
searcher = agent_white if is_white else agent_black
|
| 164 |
-
agent_type = "MCVS" if searcher is self.agent_mcvs else "UCT"
|
| 165 |
-
|
| 166 |
-
if agent_type == "MCVS":
|
| 167 |
-
mcvs_stats["moves"] += 1
|
| 168 |
-
else:
|
| 169 |
-
uct_stats["moves"] += 1
|
| 170 |
-
|
| 171 |
-
start_t = time.time()
|
| 172 |
-
visits, sims = searcher.search_with_time_budget(game.copy(), self.time_per_move)
|
| 173 |
-
t_taken = time.time() - start_t
|
| 174 |
-
|
| 175 |
-
if agent_type == "MCVS":
|
| 176 |
-
mcvs_stats["total_sims"] += sims
|
| 177 |
-
mcvs_stats["total_time"] += t_taken
|
| 178 |
-
else:
|
| 179 |
-
uct_stats["total_sims"] += sims
|
| 180 |
-
uct_stats["total_time"] += t_taken
|
| 181 |
-
|
| 182 |
-
chosen_move = max(visits, key=visits.get) if visits else random.choice(game.get_legal_moves())
|
| 183 |
-
|
| 184 |
-
player_name = "White" if is_white else "Black"
|
| 185 |
-
self.move_logger.log_move(game_idx, moves, player_name, agent_type, sims, t_taken, chosen_move.uci())
|
| 186 |
-
|
| 187 |
-
game.apply_move(chosen_move)
|
| 188 |
-
moves_made.append(chosen_move)
|
| 189 |
-
pi_records.append(visits if agent_type == "MCVS" else None)
|
| 190 |
-
|
| 191 |
-
if mcvs_stats["moves"] > 0:
|
| 192 |
-
mcvs_stats["avg_sims"] = mcvs_stats["total_sims"] / mcvs_stats["moves"]
|
| 193 |
-
mcvs_stats["avg_time"] = mcvs_stats["total_time"] / mcvs_stats["moves"]
|
| 194 |
-
if uct_stats["moves"] > 0:
|
| 195 |
-
uct_stats["avg_sims"] = uct_stats["total_sims"] / uct_stats["moves"]
|
| 196 |
-
uct_stats["avg_time"] = uct_stats["total_time"] / uct_stats["moves"]
|
| 197 |
-
|
| 198 |
-
if moves >= self.max_moves_per_game:
|
| 199 |
-
winner = "Draw"
|
| 200 |
-
outcome = None
|
| 201 |
-
self.move_logger.log_game_summary(game_idx, "Draw (move limit)", moves, mcvs_stats, uct_stats)
|
| 202 |
-
else:
|
| 203 |
-
outcome = game.board.outcome(claim_draw=True)
|
| 204 |
-
if outcome is None or outcome.winner is None:
|
| 205 |
-
winner = "Draw"
|
| 206 |
-
elif outcome.winner == chess.WHITE:
|
| 207 |
-
winner = "MCVS" if agent_white is self.agent_mcvs else "UCT"
|
| 208 |
-
else:
|
| 209 |
-
winner = "MCVS" if agent_black is self.agent_mcvs else "UCT"
|
| 210 |
-
self.move_logger.log_game_summary(game_idx, winner, moves, mcvs_stats, uct_stats)
|
| 211 |
-
|
| 212 |
-
return winner, moves, moves_made, pi_records, outcome
|
| 213 |
-
|
| 214 |
-
def run_tournament(self):
|
| 215 |
-
start_time = time.time()
|
| 216 |
-
self.log_line("Starting 200-game Chess ablation tournament (zone guidance only vs UCT)")
|
| 217 |
-
|
| 218 |
-
for game_idx in range(1, self.num_games + 1):
|
| 219 |
-
if game_idx % 2 == 1:
|
| 220 |
-
winner, moves, moves_made, pi_records, outcome = self.play_game(self.agent_mcvs, self.agent_uct, game_idx)
|
| 221 |
-
white_name = "MCVS"
|
| 222 |
-
else:
|
| 223 |
-
winner, moves, moves_made, pi_records, outcome = self.play_game(self.agent_uct, self.agent_mcvs, game_idx)
|
| 224 |
-
white_name = "UCT"
|
| 225 |
-
|
| 226 |
-
if winner == "Draw":
|
| 227 |
-
self.results["Draw"]["count"] += 1
|
| 228 |
-
self.results["Draw"]["moves"].append(moves)
|
| 229 |
-
else:
|
| 230 |
-
self.results[winner]["wins"] += 1
|
| 231 |
-
self.results[winner]["moves"].append(moves)
|
| 232 |
-
if winner == white_name:
|
| 233 |
-
self.results[winner]["as_white"] += 1
|
| 234 |
-
else:
|
| 235 |
-
self.results[winner]["as_black"] += 1
|
| 236 |
-
|
| 237 |
-
W_states, policies, values = self.extract_training_and_zone_data(moves_made, pi_records, outcome)
|
| 238 |
-
|
| 239 |
-
# Sample positions for zone DB (always, even in ablation)
|
| 240 |
-
selected = [0]
|
| 241 |
-
if len(W_states) > 1:
|
| 242 |
-
selected.append(len(W_states)-1)
|
| 243 |
-
for i in range(1, len(W_states)-1):
|
| 244 |
-
if random.random() < 0.3:
|
| 245 |
-
selected.append(i)
|
| 246 |
-
|
| 247 |
-
# Label zone DB entries by the GAME-LEVEL ENGINE OUTCOME (which engine
|
| 248 |
-
# won the game), NOT by the per-position training value. Training
|
| 249 |
-
# targets (`values`) are still used for policy/value training, but
|
| 250 |
-
# the zone DB should represent whether this position came from a
|
| 251 |
-
# trajectory belonging to an engine win/loss/draw (see paper).
|
| 252 |
-
old_w = len(self.zone_db.winning_matrices)
|
| 253 |
-
old_l = len(self.zone_db.losing_matrices)
|
| 254 |
-
old_d = len(self.zone_db.draw_matrices)
|
| 255 |
-
|
| 256 |
-
for i in selected:
|
| 257 |
-
W = W_states[i]
|
| 258 |
-
if winner == "MCVS":
|
| 259 |
-
# This game's winner was MCVS → label these positions as winning
|
| 260 |
-
self.zone_db.add_winning_matrix(W)
|
| 261 |
-
elif winner == "UCT":
|
| 262 |
-
# This game's winner was UCT → label these positions as losing
|
| 263 |
-
self.zone_db.add_losing_matrix(W)
|
| 264 |
-
else:
|
| 265 |
-
# Draw
|
| 266 |
-
self.zone_db.add_draw_matrix(W)
|
| 267 |
-
|
| 268 |
-
# Sanity check: ensure we added exactly `len(selected)` matrices to
|
| 269 |
-
# the zone corresponding to the game-level outcome.
|
| 270 |
-
new_w = len(self.zone_db.winning_matrices)
|
| 271 |
-
new_l = len(self.zone_db.losing_matrices)
|
| 272 |
-
new_d = len(self.zone_db.draw_matrices)
|
| 273 |
-
if winner == "MCVS":
|
| 274 |
-
assert new_w == old_w + len(selected), f"Zone DB labeling mismatch: expected {len(selected)} winning matrices added, got {new_w - old_w}"
|
| 275 |
-
elif winner == "UCT":
|
| 276 |
-
assert new_l == old_l + len(selected), f"Zone DB labeling mismatch: expected {len(selected)} losing matrices added, got {new_l - old_l}"
|
| 277 |
-
else:
|
| 278 |
-
assert new_d == old_d + len(selected), f"Zone DB labeling mismatch: expected {len(selected)} draw matrices added, got {new_d - old_d}"
|
| 279 |
-
|
| 280 |
-
# SAVE ZONE DB AFTER EVERY GAME
|
| 281 |
-
self.zone_db.save()
|
| 282 |
-
|
| 283 |
-
# Progress logging
|
| 284 |
-
elapsed = time.time() - start_time
|
| 285 |
-
remaining = elapsed / game_idx * (self.num_games - game_idx)
|
| 286 |
-
db_size = len(self.zone_db.winning_matrices) + len(self.zone_db.losing_matrices) + len(self.zone_db.draw_matrices)
|
| 287 |
-
self.log_line(
|
| 288 |
-
f"Game {game_idx:3d}/{self.num_games} | {winner:10s} (moves={moves:3d}) | "
|
| 289 |
-
f"MCVS wins: {self.results['MCVS']['wins']:3d} | Draws: {self.results['Draw']['count']:3d} | "
|
| 290 |
-
f"DB size: {db_size:,} | ETA: {remaining/60:.1f} min"
|
| 291 |
-
)
|
| 292 |
-
|
| 293 |
-
# Final summary
|
| 294 |
-
self.log_line("\n" + "=" * 80)
|
| 295 |
-
self.log_line("ABLATION TOURNAMENT SUMMARY (Zone-only vs UCT)")
|
| 296 |
-
self.log_line("=" * 80)
|
| 297 |
-
|
| 298 |
-
mcvs_wins = self.results["MCVS"]["wins"]
|
| 299 |
-
uct_wins = self.results["UCT"]["wins"]
|
| 300 |
-
draws = self.results["Draw"]["count"]
|
| 301 |
-
|
| 302 |
-
self.log_line(f"\nMCVS (Zone-only λ-PUCT): {mcvs_wins} wins")
|
| 303 |
-
self.log_line(f"UCT (Standard): {uct_wins} wins")
|
| 304 |
-
self.log_line(f"Draws: {draws}")
|
| 305 |
-
self.log_line(f"Total: {self.num_games}")
|
| 306 |
-
|
| 307 |
-
if mcvs_wins + uct_wins > 0:
|
| 308 |
-
win_rate = (mcvs_wins / (mcvs_wins + uct_wins)) * 100
|
| 309 |
-
self.log_line(f"\nMCVS Win Rate (excluding draws): {win_rate:.1f}%")
|
| 310 |
-
|
| 311 |
-
if self.results["MCVS"]["moves"]:
|
| 312 |
-
avg_moves_mcvs = np.mean(self.results["MCVS"]["moves"])
|
| 313 |
-
self.log_line(f"Avg moves (MCVS wins): {avg_moves_mcvs:.1f}")
|
| 314 |
-
if self.results["UCT"]["moves"]:
|
| 315 |
-
avg_moves_uct = np.mean(self.results["UCT"]["moves"])
|
| 316 |
-
self.log_line(f"Avg moves (UCT wins): {avg_moves_uct:.1f}")
|
| 317 |
-
|
| 318 |
-
self.log_line(f"\nMCVS White: {self.results['MCVS']['as_white']}, Black: {self.results['MCVS']['as_black']}")
|
| 319 |
-
self.log_line(f"UCT White: {self.results['UCT']['as_white']}, Black: {self.results['UCT']['as_black']}")
|
| 320 |
-
|
| 321 |
-
total_db = len(self.zone_db.winning_matrices) + len(self.zone_db.losing_matrices) + len(self.zone_db.draw_matrices)
|
| 322 |
-
self.log_line(f"\nZone Database Statistics:")
|
| 323 |
-
self.log_line(f" Winning positions: {len(self.zone_db.winning_matrices)}")
|
| 324 |
-
self.log_line(f" Losing positions: {len(self.zone_db.losing_matrices)}")
|
| 325 |
-
self.log_line(f" Draw positions: {len(self.zone_db.draw_matrices)}")
|
| 326 |
-
self.log_line(f" Total positions: {total_db:,}")
|
| 327 |
-
|
| 328 |
-
total_time = time.time() - start_time
|
| 329 |
-
self.log_line("\n" + "=" * 80)
|
| 330 |
-
self.log_line(f"Tournament Duration: {total_time/60:.1f} minutes")
|
| 331 |
-
self.log_line(f"Avg time per game: {total_time/self.num_games:.1f}s")
|
| 332 |
-
self.log_line("=" * 80 + "\n")
|
| 333 |
-
|
| 334 |
-
with open(self.output_file, 'w', encoding='utf-8') as f:
|
| 335 |
-
f.write('\n'.join(self.report_lines))
|
| 336 |
-
|
| 337 |
-
self.move_logger.close()
|
| 338 |
-
|
| 339 |
-
if __name__ == "__main__":
|
| 340 |
-
DEVICE = 'cuda' if torch.cuda.is_available() else 'cpu'
|
| 341 |
-
print(f"Using device: {DEVICE}")
|
| 342 |
-
|
| 343 |
-
print("\n=== RUNNING ABLATION: Zone guidance ONLY (no neural networks) ===")
|
| 344 |
-
tournament_ablation = ChessTournament(
|
| 345 |
-
num_games=100,
|
| 346 |
-
time_per_move=1.0,
|
| 347 |
-
max_moves_per_game=200,
|
| 348 |
-
device=D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