Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem with old xboard engines sending resign w/o result #645

Open
rwbc opened this issue Dec 25, 2020 · 9 comments · May be fixed by #709
Open

Problem with old xboard engines sending resign w/o result #645

rwbc opened this issue Dec 25, 2020 · 9 comments · May be fixed by #709

Comments

@rwbc
Copy link

rwbc commented Dec 25, 2020

While doing some tests for a new tool, I had to check a few old engines with unusual eval output while playing with own books.
Here I noticed that CuteChess GUI doesn't understand 'computer resigns' if it has no result attached with it.
CuteChess then just waits and after a while after the time was run out it reports the usual 'connection stalled'.

With Inbetween I can modify the sent string 'computer resigns' to e.g. 1-0 computer resigns', but of course
it will be a wrong result claim in some cases (I cannot know the colour being played at runtime), but at least it saves
time before the engine will be considered as 'stalled'.

295.092: < computer resigns
295.092: > force
295.092: > result 1-0 {White wins by adjudication: Invalid result claim}
519.062: <    3   -564       0    534 a8b8 b5a5 e7d8
519.062: <    5   -583       0   2441 a8b8 b5a6 b8a8 a6b7 a8a1
519.062: <    6   -661       0   3162 a8b8
519.062: <    6   -661       0   4592 a8b8 b5a5 b8a8 a5b6 e7d7
519.093: <    9   -669       0  32206 a8b8 b5a6 b8a8 a6b6 a8a1 b3b2 a1b1 f3b3
519.140: <   10   -700       0  78151 a8b8 b5a5 b8a8 a5b6 a8b8 b6c7 b8b4 f3c3 g7g8 g4g8
519.187: <   11   -700       0 144632 a8b8 b5a5 b8a8 a5b6 a8b8 b6c7 b8b4 f3c3 g7g8 g4g8
519.920: <   12   -724      10 942867 a8b8 b5a5 b8c8 h3h2 c8a8 a5b6 a8b8
520.388: <   13   -779      10 1445951 a8b8
525.411: <   13   -823      60 6965124 a8b8 b5a5 b8c8 h3h2 c8a8 a5b6 a8a1 g4g7 f8g7 c4f1
529.108: <   16   -878     100 10891163 a8b8
545.785: <   16   -892     270 29032457 a8b8 b5a5 b8a8 c4a6 a8d8 h3h2 d8d1 g4g7 f8g7 f3f1 d1d4 b3b2 e7e6 a6c8 e6e7 h2h1
545.785: < computer resigns
642.817: > ?

According to the specs this is/was allowed once (probably what is called protover1).
It should be easy to fix, as CuteChess already reads the string 'resign'.
(Some of them have resigning hardcoded and it cannot be switched off at all)

To support older engines, certain additional commands from the engine to xboard are also recognized.
(These are commands by themselves, not values to be placed in the comment field of the PGN result code.)
These forms are not recommended for new engines; use the PGN result code commands or the resign command instead. 

Command | Interpreted as
-- | --
White resigns | 0-1 {White resigns}
Black resigns | 1-0 {Black resigns}
White | 1-0 {White mates}
Black | 0-1 {Black mates}
Draw | 1/2-1/2 {Draw}
computer mates | 1-0 {White mates} or 0-1 {Black mates}
opponent mates | 1-0 {White mates} or 0-1 {Black mates}
computer resigns | 0-1 {White resigns} or 1-0 {Black resigns}
game is a draw | 1/2-1/2 {Draw}
checkmate | 1-0 {White mates} or 0-1 {Black mates}

@alwey
Copy link
Contributor

alwey commented Dec 25, 2020

Indeed CuteChess implements only essential support for CECP protocol version 2, but does not support all of its aspects. And in order to add some support for older engines (protocol version 1), some patches have been applied in recent versions of CuteChess. But support for V1 is incomplete.

CECP reference https://www.gnu.org/software/xboard/engine-intf.html
CECP reference http://hgm.nubati.net/CECP.html

@rwbc: Which engine did you use to generate the output above?

@rwbc
Copy link
Author

rwbc commented Dec 25, 2020

Indeed CuteChess implements only essential support for CECP protocol version 2, but does not support all of its aspects. And in order to add some support for older engines (protocol version 1), some patches have been applied in recent versions of CuteChess. But support for V1 is incomplete.

CECP reference https://www.gnu.org/software/xboard/engine-intf.html
CECP reference http://hgm.nubati.net/CECP.html

@rwbc: Which engine did you use to generate the output above?

Hi alwey, first I wish you a happy christmas :)

The output is from Ant 6.06, probably all Ant versions do this.
Ant is also a special case because it outputs +50.00 while in own book :)

BTW in case you are interested, Ferdinand Mosca currently creates a new standalone tool for outputting eval graphs
(and time graphs) automatically from given pgn files. I am helping there with suggestions and testing.

https://github.com/fsmosca/Python-Chess-Scripts

@alwey
Copy link
Contributor

alwey commented Jan 3, 2022

@rwbc : Happy new year ;-). I am working on this topic but I probably will need your help testing with e.g. Ant 6.06.

@rwbc
Copy link
Author

rwbc commented Jan 28, 2022

@alwey: Thanks :) I am late to the party it seems. Just yesterday I realized you started working on CuteChess again
some weeks ago.
If I am not mistaken your current most useful branch for my testing would be now EXPER3?

I am also very grateful that you have done meanwhile some coding on earlier suggestions I had made!
Soon looking at them.

Guenther

@alwey
Copy link
Contributor

alwey commented Jan 28, 2022

@rwbc : Welcome back! I have taken a long break. The latest experimental / expert branch is indeed EXPER-3. Some patches /wrt pausing a game, protocol help for older CECP engines, and version information will be added this weekend.

Apart from getting feedback for my proposed changes (pull requests) in general I have some things (then in EXPER-3) that I cannot test myself:

  • I would appreciate having help to test old engines like Ant 6.06.
  • I coded a small patch 58d2c23 to add the matching command line of a destroyed EngineProcess under MS Windows. I do not have MS Windows myself - so I have not seen it in action. Reference: Specify which engine in EngineProcess destroyed #487.

@rwbc
Copy link
Author

rwbc commented Jan 30, 2022

Can you tell me when you have made all of your changes this weekend, you would like to be tested?
I am ready for compiling, after some remembering how I did what from the past and a stupid first error ;-)
(Accidentally tried to compile 32-bit, which had no updated QT here, unlike the 64-bit libraries, which are 5.15.2 now)

You can mail me at rwbc@gmx.de for not cluttering the 'Issues'.

@alwey
Copy link
Contributor

alwey commented Jan 30, 2022

It is ready for testing.

@rwbc
Copy link
Author

rwbc commented Feb 1, 2022

The Ant case is fixed in EXPER-3 and games run smoothly further on after Ant sends its resigning. :)

[Event "Ant"]
[Site "RWBC-CAPPUCCINO Win7U64 Q8200 2.33Ghz"]
[Date "2022.02.01"]
[Round "1.1.1"]
[White "Ant_606"]
[Black "Abrok_50"]
[Result "0-1"]
[ECO "A09"]
[GameDuration "00:01:07"]
[GameEndTime "2022-02-01T12:27:05.561 Mitteleuropäische Zeit"]
[GameStartTime "2022-02-01T12:25:57.855 Mitteleuropäische Zeit"]
[Opening "Reti"]
[PlyCount "64"]
[TimeControl "40/60"]
[Variation "Advance variation"]

1. Nf3 {book} d5 {book} 2. c4 {book} d4 {book} 3. g3 {book} Nc6 {book}
4. Bg2 {+0.04/6 0.56s} e5 {+0.12/10 1.90s} 5. Qa4 {-0.07/6 0.30s}
f6 {+0.12/10 1.68s} 6. O-O {+0.15/6 0.29s} Kf7 {+0.16/9 1.36s}
7. d3 {+0.69/6 0.28s} Bg4 {-0.04/10 2.35s} 8. Bd2 {+0.81/6 0.28s}
a6 {+0.08/9 1.66s} 9. Na3 {+0.75/5 0.33s} Nge7 {+0.14/9 1.60s}
10. h3 {+0.89/5 0.29s} Be6 {+0.32/10 1.55s} 11. Qb3 {+0.86/5 0.29s}
b5 {+0.62/10 1.90s} 12. Nh4 {+0.55/6 0.28s} g5 {+0.78/9 1.03s}
13. Nf3 {+0.68/6 0.28s} Rb8 {+0.74/10 3.00s} 14. Qc2 {+0.63/6 0.28s}
b4 {+0.52/10 1.63s} 15. Nb1 {+0.50/6 0.26s} Qd6 {+0.56/9 1.44s}
16. Re1 {+0.58/6 0.32s} Bg7 {+0.80/9 1.08s} 17. Kh2 {+0.51/7 0.73s}
h5 {+0.96/9 1.08s} 18. Qa4 {+0.36/8 0.37s} a5 {+0.96/8 1.47s}
19. h4 {+0.28/6 0.27s} g4 {+0.72/9 1.23s} 20. Ng1 {+0.32/7 0.70s}
Kg6 {+0.70/9 1.30s} 21. c5 {+0.66/7 0.60s} Qd7 {+0.74/9 1.00s}
22. a3 {+0.56/6 0.29s} bxa3 {+1.52/9 1.52s} 23. Qxa3 {+0.06/8 0.90s}
Rb3 {+1.82/10 1.52s} 24. Qa4 {-0.53/8 0.71s} Rxb2 {+1.92/10 2.08s}
25. Rf1 {-0.38/6 0.28s} Bh6 {+2.00/8 1.24s} 26. Be1 {-0.93/9 3.89s}
Rhb8 {+2.56/9 2.34s} 27. f3 {-3.34/9 3.98s} gxf3 {+4.42/8 1.44s}
28. Bxf3 {-3.34/7 0.40s} Rxb1 {+4.94/8 0.99s} 29. Bxa5 {-3.43/7 0.46s}
Rxf1 {+7.44/9 1.47s} 30. Rxf1 {-6.53/9 1.47s} Ra8 {+7.88/9 0.98s}
31. Be4+ {-6.62/9 1.21s} Kg7 {+8.16/11 1.52s} 32. Rd1 {-6.93/9 1.48s}
Rxa5 {+9.42/11 1.12s, White resigns} 0-1

[Event "Ant"]
[Site "RWBC-CAPPUCCINO Win7U64 Q8200 2.33Ghz"]
[Date "2022.02.01"]
[Round "1.1.2"]
[White "Abrok_50"]
[Black "Ant_606"]
[Result "1-0"]
[ECO "A09"]
[GameDuration "00:01:39"]
[GameEndTime "2022-02-01T12:28:46.007 Mitteleuropäische Zeit"]
[GameStartTime "2022-02-01T12:27:06.767 Mitteleuropäische Zeit"]
[Opening "Reti"]
[PlyCount "71"]
[TimeControl "40/60"]
[Variation "Advance variation"]

1. Nf3 {book} d5 {book} 2. c4 {book} d4 {book} 3. g3 {book} Nc6 {book}
4. Bg2 {-0.12/12 1.90s} e5 {+0.07/7 0.43s} 5. Qa4 {-0.12/10 1.84s}
Bd6 {0.00/5 0.29s} 6. Nxe5 {+0.62/10 1.78s} Bxe5 {+1.98/8 0.28s}
7. Bxc6+ {-0.88/10 1.72s} bxc6 {-0.84/9 0.28s} 8. Qxc6+ {-1.04/11 1.50s}
Bd7 {-0.84/8 0.28s} 9. Qe4 {-1.26/13 3.04s} f6 {+0.42/9 0.30s}
10. f4 {-1.28/12 1.89s} Ne7 {+1.62/7 0.29s} 11. Qd3 {-1.10/11 1.00s}
Bd6 {+1.68/7 0.28s} 12. Qxd4 {-1.12/11 1.22s} Qc8 {+1.54/5 0.28s}
13. c5 {-0.46/10 1.22s} Qb7 {+1.55/7 0.34s} 14. Rf1 {-0.64/10 1.48s}
Nf5 {+1.49/6 0.28s} 15. Qc4 {-0.72/10 1.01s} Be7 {+1.67/6 0.31s}
16. Nc3 {-0.36/10 1.15s} Qc6 {+1.53/7 0.61s} 17. d4 {-0.20/10 1.20s}
O-O-O {+1.50/6 0.28s} 18. g4 {-0.72/10 2.38s} Nh4 {+1.47/7 0.36s}
19. f5 {-0.48/9 1.49s} Be8 {+1.64/6 0.42s} 20. b4 {-0.08/9 2.32s}
Qd7 {+1.30/9 0.89s} 21. d5 {+0.24/9 1.12s} Kb8 {+1.18/9 0.75s}
22. c6 {+0.68/9 1.14s} Qc8 {+1.28/9 0.86s} 23. Qe4 {+0.30/10 2.33s}
Bd6 {+0.97/7 0.37s} 24. g5 {+0.28/10 1.72s} Be5 {+0.45/8 0.50s}
25. Bb2 {+0.44/10 1.87s} Bxc3+ {+0.93/9 0.28s} 26. Bxc3 {+0.70/10 1.33s}
fxg5 {+0.61/8 0.51s} 27. Bxg7 {+0.68/11 1.39s} Rg8 {+0.25/9 1.02s}
28. Bf6 {+0.82/11 1.38s} Rd6 {+0.11/9 0.92s} 29. Be5 {+0.82/10 1.05s}
Rd8 {0.00/10 0.92s} 30. O-O-O {+1.10/10 1.41s} Bf7 {-0.79/11 3.51s}
31. d6 {+1.64/10 1.41s} Ka8 {-0.46/7 0.39s} 32. dxc7 {+2.22/9 1.20s}
Rde8 {-1.50/10 4.75s} 33. Rd7 {+2.34/10 1.43s} Bxa2 {-2.08/7 0.45s}
34. Kb2 {+4.24/10 1.44s} Bc4 {-2.61/7 0.47s} 35. Qxc4 {+6.46/10 1.31s}
Rgf8 {-5.77/10 8.44s} 36. Bd4 {+9.50/9 1.42s, Black resigns} 1-0

@alwey
Copy link
Contributor

alwey commented Feb 1, 2022

Thank you for testing, I will upload this patch and amend PR #709, so that this functionality will be included.

@alwey alwey linked a pull request Feb 1, 2022 that will close this issue
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 a pull request may close this issue.

2 participants