Skip to content

fix: dont attach illegal moves to pgn#943

Merged
Disservin merged 2 commits intomasterfrom
942-fastchess-writes-illegal-moves-to-pgn
Nov 20, 2025
Merged

fix: dont attach illegal moves to pgn#943
Disservin merged 2 commits intomasterfrom
942-fastchess-writes-illegal-moves-to-pgn

Conversation

@Disservin
Copy link
Copy Markdown
Owner

fixes #942

@robertnurnberg
Copy link
Copy Markdown
Contributor

Hm, I get this:

[Event "Fastchess Tournament"]
[Site "?"]
[Date "2025.11.16"]
[Round "1"]
[White "e2e4"]
[Black "a1a1"]
[Result "1-0"]
[GameDuration "00:00:00"]
[GameStartTime "2025-11-16T16:35:38 +0100"]
[GameEndTime "2025-11-16T16:35:38 +0100"]
[PlyCount "2"]
[Termination "illegal move"]
[TimeControl "1"]
[ECO "B00"]
[Opening "King's Pawn Game"]

1. e4 {0.00/1 0.000s, Black makes an illegal move: a1a1} 1-0

[Event "Fastchess Tournament"]
[Site "?"]
[Date "2025.11.16"]
[Round "1"]
[White "a1a1"]
[Black "e2e4"]
[Result "0-1"]
[GameDuration "00:00:00"]
[GameStartTime "2025-11-16T16:35:38 +0100"]
[GameEndTime "2025-11-16T16:35:38 +0100"]
[PlyCount "1"]
[Termination "illegal move"]
[TimeControl "1"]

1. Rxa1 {0.00/1 0.000s, White makes an illegal move} 0-1

So may need special treatment for first move being illegal. See also cutechess/cutechess#572.

@Disservin
Copy link
Copy Markdown
Owner Author

so the body is just supposed to be
{0.00/1 0.000s, White makes an illegal move: a1a1} 0-1 ?

@robertnurnberg
Copy link
Copy Markdown
Contributor

I would leave the eval and time details out. Like you did for the case when it's not the first move. Apart from that, yes.

@Disservin
Copy link
Copy Markdown
Owner Author

okay now should look like this if the first move was also illegal

[Event "Fastchess Tournament"]
[Site "localhost"]
[Round "1"]
[White "engine1"]
[Black "engine2"]
[Result "0-1"]
[SetUp "1"]
[FEN "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 17"]
[PlyCount "1"]
[Termination "normal"]
[TimeControl "-"]

{White makes an illegal move: a1a1} 0-1

@robertnurnberg
Copy link
Copy Markdown
Contributor

lgtm

@Disservin
Copy link
Copy Markdown
Owner Author

okay nice i haven't tested with your test engines but instead just used the unit test to create the expected version

@Disservin Disservin merged commit 8ef4291 into master Nov 20, 2025
18 checks passed
@Disservin Disservin deleted the 942-fastchess-writes-illegal-moves-to-pgn branch November 20, 2025 06:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fastchess writes illegal moves to pgn

2 participants