fsmosca / HeadsUp

A chess engine adapter that can combine 2 engines and play as one. First engine may play in the middle and the other engine may continue to play for the rest of the game.
GNU General Public License v3.0
1 stars 0 forks source link

connection stalls in CuteChess #6

Open tissatussa opened 3 years ago

tissatussa commented 3 years ago

a few times i used HeadsUp to play engine-vs-engine in CuteChess (on Linux) .. HeadsUp seems to work fine, but once stopped with a "White's connection stalls" message .. see game PGN and log below. Could some extra / other settings be needed ? I use a simple cfg.

NOTE: the CuteChess comment of the last move shows the other engine took 108 sec to return its best move Re7 and this is the longest thinking time in this game : was HeadsUp still idle to receive UCI commands ? btw. in the Python code i see a simple infinite "while True" construction .. is this a common / robust way ?

[Event "?"]
[Site "?"]
[Date "2021.08.01"]
[Round "?"]
[White "HeadsUp"]
[Black "SF asmFish"]
[Result "0-1"]
[FEN "2rqr1k1/pp1bbp1p/4p1pB/4P3/1Q1pN3/P4N2/5PP1/3RR1K1 b - - 0 2"]
[GameDuration "00:13:50"]
[PlyCount "39"]
[SetUp "1"]
[Termination "stalled connection"]
[TimeControl "720+5"]

1... Bxb4 {+2.38/30 23s} 2. axb4 {+0.01/39 86s} f5 {+0.13/35 0s}
3. Nf6+ {-0.02/41 35s} Kh8 {0.00/37 4.6s} 4. Rxd4 {+0.01/40 21s}
Re7 {0.00/37 0s} 5. Red1 {+0.01/44 61s} Rc7 {-0.15/39 0s} 6. b5 {0.00/41 23s}
b6 {0.00/33 9.9s} 7. Ng5 {+0.01/39 22s} Qc8 {-0.97/33 26s} 8. Kh2
Rb7 {-1.11/34 52s} 9. Kg1 {1.0s} Rc7 {-1.10/34 21s} 10. Rd6 {/40 1.1s}
Rb7 {-1.30/35 41s} 11. R6d2 {/44 5.1s} Rc7 {-1.62/30 20s}
12. Rd4 {+3.11/30 7.3s} Rb7 {-1.09/30 7.8s} 13. Kh2 {+3.51/31 5.4s}
Rc7 {-1.65/36 61s} 14. f4 {+4.01/40 0.77s} Qd8 {-2.78/39 63s}
15. Nxe6 {+4.99/42 2.9s} Rxe6 {-3.45/40 16s} 16. Rxd7 {+5.07/39 5.5s}
Rxd7 {-3.80/40 22s} 17. Rxd7 {+5.15/40 0.80s} Qxd7 {-3.12/40 14s}
18. Nxd7 {+5.23/38 9.4s} Kg8 {-4.07/39 10s} 19. Nf6+ {+5.30/35 4.5s}
Kf7 {-4.10/41 14s} 20. Nxh7 {+5.31/37 9.7s}
Re7 {-4.56/44 108s, White's connection stalls} 0-1

log_headsup.zip

fsmosca commented 3 years ago

According to the log the engine received position command, but did not received go command. There are still more time left, so something is wrong with the engine-cutechess communication. Do you have the cutechess log? Does it happen when ponder is off?

The move Re7 is done by SF asmFish it has nothing to do with HeadsUp. I believe while True is fine.

tissatussa commented 3 years ago

i have no cutechess log, the pgn is my only cutechess output .. i searched the cutechess install folder for any newly touched file with "log" or "debug" in its name .. and i don't see a way to set logging ON in cutechess ? (did i ever see a log file of my cutechess?) I find https://gist.github.com/zz4032/7af71a696cb2a0f2bc6116a3d27cb0bb as some cutechess debug log, but where on my Linux can i find such file ?

yes, i use ponder .. i almost never have problems with cutechess with the many different engines i use .. exception is Ethereal, many versions : it often breaks the connection, most of the time at the end of the game, when its lost (!?) .. I can try with ponder OFF but i don't want to wait until a connection DOES stall then ..

is there a next step ? is there a problem anyhow ? when it sometimes occurs, suddenly, it can hardly be tested ? Indeed a good log file would help ..

thanks for the other info.

tissatussa commented 3 years ago

We're lucky : i just did another game in cutechess against the same engine and now the error occurs very quickly .. i saved the debug log text from its window pane (should THAT be the only way in cutechess?) .. what do you say ?

[Event "?"]
[Site "?"]
[Date "2021.08.01"]
[Round "?"]
[White "HeadsUp"]
[Black "Andscacs v0.95-123"]
[Result "0-1"]
[FEN "3qr2k/pp1b1p1p/4pNpB/4P3/1PrpR3/5N2/5PP1/3R2K1 b - - 0 3"]
[GameDuration "00:04:28"]
[PlyCount "5"]
[SetUp "1"]
[Termination "stalled connection"]
[TimeControl "720+5"]

1... Ba4 {+1.27/26 57s} 2. Ng5 {+0.01/40 91s} Qc7 {+0.57/30 57s} 3. Rh4 {9.2s}
a6 {+0.01/30 40s, White's connection stalls} 0-1

conn_stalls_andscacs.zip

tissatussa commented 3 years ago

and here's my cfg file .. the SF binary is a newly compiled version 14 with default NNUE, also Berserk .. should i set more options ? btw. i'm now testing with ponder OFF ..

headsup.cfg.zip

fsmosca commented 3 years ago

Cutechess GUI only shows log in view->engine debug.

I see the log on conn_stalls_andscacs.zip. It does not say HeadsUp stalled or White stalled. Which version of Cutechess did you use?

Another way to test is by using cutechess-cli. Here you can save the cutechess log in a file. Also save the HeadsUp log file. Lets see them.

Note I have not tested this in Linux, only tested this in Windows.

tissatussa commented 3 years ago

Cute Chess 1.2.0 Using Qt version 5.12.8 Running on Ubuntu 20.04.2 LTS/x86_64

must be the latest (stable) version .. i know the -cli version exists but i never used it .. what's wrong with the debug log of the GUI ? I think it will be the same as a -cli log ? Can we be sure a stalled message is UCI output by the engine ? Is that normal / optional ?

fsmosca commented 3 years ago

In cutechess-cli log, it should mention the stalled message.