google-deepmind / google-deepmind/game_arena

Parser fails to recognize standard chess castling notation (O-O and O-O-O)

Open
#2 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
111
Forks
24
PR merge metrics
No merged PRs in 30d

Description

### Description
The current move parser fails to recognize and process the standard algebraic notation for castling. When the AI model correctly outputs a castling move, the parser returns `None`, which incorrectly terminates the game.

This issue specifically affects the notation for both kingside and queenside castling, which are special moves in chess with unique notation.

### The Standard Notation Not Being Recognized
In Standard Algebraic Notation (SAN), castling is an exception to the typical piece-square format and has its own unique representation:

- `O-O`: Represents Kingside Castling.

- `O-O-O`: Represents Queenside Castling.

The current regex or parsing logic appears to lack the rules to handle these essential cases.

### Steps to Reproduce

1. Initiate a game of chess against the AI model.

2. Play until a position where castling is a logical and strong move for one of the players.

3. The AI model generates a decision that concludes with a castling move. For example, using the following model output:

```
Decision:
Comparing the main candidates, `8. O-O` is the most direct and principled way to achieve king safety and develop. While Black can trade bishops on e3, the resulting pawn structure is often manageable, and White gains an open f-file and a safer king. Prioritizing king safety in the opening is paramount. The tempo gain from `8. b3` is tempting, but leaving the king in the center for an extra move might be riskier.

Therefore, `8. O-O` is the strongest move, as it ensures king safety and aligns with sound opening principles.

The final answer is O-O
```

4. The parser attempts to process the final move, `O-O`.

### Current Behavior
The parser fails to identify `O-O` as a valid move. The log shows that the parser's output is None, leading to the game ending prematurely.

`Parser output is None, ending game.`

### Expected Behavior
The parser should correctly identify and validate:

- `O-O` as a valid kingside castling move.

- `O-O-O` as a valid queenside castling move.

Upon receiving one of these notations, the parser should process it correctly, update the board state according to the rules of castling, and allow the game to continue.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.