Engine playing twice the same move in a CuteChess tournament

Discussion of chess software programming and technical issues.

Moderators: Harvey Williamson, bob, hgm

Forum rules
This textbox is used to restore diagrams posted with the [d] tag before the upgrade.
Post Reply
User avatar
Roland Chastain
Posts: 415
Joined: Sat Jun 08, 2013 8:07 am
Location: France
Full name: Roland Chastain
Contact:

Engine playing twice the same move in a CuteChess tournament

Post by Roland Chastain » Sun Oct 18, 2020 8:48 am

Hello!

Sometimes, with CuteChess, I have games ending by illegal move, and when I look into the PGN, I see that the engine seems to have played twice the same move consecutively. It happens with several engines, some engines of mine, and some other. Until now I didn't manage to understand what happens. Have someone else yet experienced the same thing?

In case my explanation wouldn't be clear enough, I attach the PGN of a game in which the problem happened.

Regards.

Roland
Attachments
iota-01-illegal-move.zip
(660 Bytes) Downloaded 11 times
Qui trop embrasse mal étreint.

User avatar
hgm
Posts: 25049
Joined: Fri Mar 10, 2006 9:06 am
Location: Amsterdam
Full name: H G Muller
Contact:

Re: Engine playing twice the same move in a CuteChess tournament

Post by hgm » Sun Oct 18, 2020 8:59 am

This typically happens when the engine's search doesn't find any move to play at all (in other words, considers itself check- or stalemated), while the GUI disagrees (and thus has not declared game end already, but sets the engine thinking). Usually this means the engine has a move bug, and GUIs tend to be infallible. But it can also happen when legality testing or mate detection in the GUI has been switched off, and the opponent did not claim the game (which only CECP engines can do) after it delivered the death blow.

The root search then never saves anything as best move, so that the corresponding variable still holds the move of the previous turn (or perhaps that of the opponent, depending on how you have coded this).
Get rid of the shit: vote for SHID!

User avatar
Roland Chastain
Posts: 415
Joined: Sat Jun 08, 2013 8:07 am
Location: France
Full name: Roland Chastain
Contact:

Re: Engine playing twice the same move in a CuteChess tournament

Post by Roland Chastain » Sun Oct 18, 2020 9:20 am

@H.G.Muller

Thank you. I will search in those directions.
Qui trop embrasse mal étreint.

Terje
Posts: 257
Joined: Tue Nov 19, 2019 3:34 am
Location: https://github.com/TerjeKir/weiss
Full name: Terje Kirstihagen

Re: Engine playing twice the same move in a CuteChess tournament

Post by Terje » Sun Oct 18, 2020 10:28 am

Can also happen if the last moves before this were discarded for any reason (input buffer too small, incorrect validation of moves..), as the engine would think it was playing the same position again.

User avatar
Roland Chastain
Posts: 415
Joined: Sat Jun 08, 2013 8:07 am
Location: France
Full name: Roland Chastain
Contact:

Re: Engine playing twice the same move in a CuteChess tournament

Post by Roland Chastain » Sun Oct 18, 2020 10:49 am

Terje wrote:
Sun Oct 18, 2020 10:28 am
Can also happen if the last moves before this were discarded for any reason (input buffer too small, incorrect validation of moves..), as the engine would think it was playing the same position again.
Ah, yes, there is also that possibility. I didn't think of it. Thank you.
Last edited by Roland Chastain on Sun Oct 18, 2020 11:15 am, edited 1 time in total.
Qui trop embrasse mal étreint.

Ras
Posts: 1471
Joined: Tue Aug 30, 2016 6:19 pm
Full name: Rasmus Althoff
Contact:

Re: Engine playing twice the same move in a CuteChess tournament

Post by Ras » Sun Oct 18, 2020 10:51 am

hgm wrote:
Sun Oct 18, 2020 8:59 am
The root search then never saves anything as best move, so that the corresponding variable still holds the move of the previous turn (or perhaps that of the opponent, depending on how you have coded this).
That's why I maintain a validity flag after evaluating the "position" command (UCI). If the FEN or the move list is illegal, I write out the problem's cause with "info string error (problem description)". A subsequent "go" command will be answered with "bestmove 0000". Then it's easy to evaluate log files and see what went wrong.
Rasmus Althoff
https://www.ct800.net

User avatar
lucasart
Posts: 3141
Joined: Mon May 31, 2010 11:29 am
Full name: lucasart
Contact:

Re: Engine playing twice the same move in a CuteChess tournament

Post by lucasart » Sun Oct 18, 2020 11:11 am

Roland Chastain wrote:
Sun Oct 18, 2020 8:48 am
Hello!

Sometimes, with CuteChess, I have games ending by illegal move, and when I look into the PGN, I see that the engine seems to have played twice the same move consecutively. It happens with several engines, some engines of mine, and some other. Until now I didn't manage to understand what happens. Have someone else yet experienced the same thing?

In case my explanation wouldn't be clear enough, I attach the PGN of a game in which the problem happened.

Regards.

Roland
Your engine has a bug, which I pointed out in another thread (about c-chess-cli). When receiving "position fen ... moves ...", it discards the moves. Have you fixed it ?
Theory and practice sometimes clash. And when that happens, theory loses. Every single time.

User avatar
Roland Chastain
Posts: 415
Joined: Sat Jun 08, 2013 8:07 am
Location: France
Full name: Roland Chastain
Contact:

Re: Engine playing twice the same move in a CuteChess tournament

Post by Roland Chastain » Sun Oct 18, 2020 11:24 am

lucasart wrote:
Sun Oct 18, 2020 11:11 am
Your engine has a bug, which I pointed out in another thread (about c-chess-cli). When receiving "position fen ... moves ...", it discards the moves. Have you fixed it ?
Yes, it's true, but I don't believe this be the same problem. For traditional chess, CuteChess uses "position startpos ..." syntax. And, in that case, the engine that seems to play illegal move is not mine (it's Iota 0.1).

And yes, I fixed the bug, but not yet released the new version. :wink:
Qui trop embrasse mal étreint.

User avatar
Roland Chastain
Posts: 415
Joined: Sat Jun 08, 2013 8:07 am
Location: France
Full name: Roland Chastain
Contact:

Re: Engine playing twice the same move in a CuteChess tournament

Post by Roland Chastain » Sun Oct 18, 2020 11:29 am

Ras wrote:
Sun Oct 18, 2020 10:51 am
That's why I maintain a validity flag after evaluating the "position" command (UCI). If the FEN or the move list is illegal, I write out the problem's cause with "info string error (problem description)". A subsequent "go" command will be answered with "bestmove 0000". Then it's easy to evaluate log files and see what went wrong.
Good idea. I should do something like that.
Qui trop embrasse mal étreint.

Post Reply