Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions azlite_portfolio_clean.py
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ def score_moves(self, state_embed: torch.Tensor,
return logits


# ----------------------------- MCTS -----------------------------------------
# ----------------------------- MCTS -------------------------------

@dataclass
class MCTSNode:
Expand Down Expand Up @@ -344,8 +344,8 @@ def _simulate(self, board: chess.Board, root: MCTSNode) -> float:
if mv.promotion is None:
promo_idxs.append(0)
else:
PROMOTION_MAP.get(mv.promotion, 0)
promo_idxs.append(PROMOTION_MAP.get(mv.promotion, 0))
promo_value = PROMOTION_MAP.get(mv.promotion, 0)
promo_idxs.append(promo_value)
Comment on lines +347 to +348

Copilot AI Sep 16, 2025

Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The removed line 347 in the original code suggests there was a redundant PROMOTION_MAP.get(mv.promotion, 0) call that wasn't assigned to any variable. The refactor correctly fixes this by storing the result in promo_value and using it, eliminating the wasteful computation.

Copilot uses AI. Check for mistakes.

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if adequate approve

logits = self.net.score_moves(
state_embed.squeeze(0),
torch.tensor(from_idxs, dtype=torch.long,
Expand Down
Loading