These are the commands sent by cutechess:
Code: Select all
111907 >Pedone(0): go ponder wtime 9675 btime 9833 winc 1000 binc 1000
111907 <stockfish(1): info depth 26 seldepth 30 multipv 1 score cp 0 nodes 1177874 nps 1280297 tbhits 0 time 920 pv a4h4 e3f2 h4h5 b5b6 h5g5 e2a6 b7a6 a1a6 f7b7 e1e8 g5e5 e8c8 e5e7 c8c1 g6g5 f2g3 e7e8 g3f2 e8f8 f2g3
111907 <stockfish(1): bestmove a4h4 ponder e3f2
111907 >Pedone(0): stop
How can such thing happen?
Inside the search I check if there is an input with this function:
Code: Select all
static inline int InputAvailable(void)
{
#ifdef _WIN32
if (Ric.Pipe)
{
DWORD bytes_left;
PeekNamedPipe(Ric.Handle, 0, 0, 0, &bytes_left, 0);
return bytes_left;
}
else return _kbhit();
#else
fd_set readfds;
struct timeval timeout;
FD_ZERO(&readfds);
FD_SET(STDIN_FILENO, &readfds);
timeout.tv_sec = timeout.tv_usec = 0;
select(STDIN_FILENO + 1, &readfds, 0, 0, &timeout);
return FD_ISSET(STDIN_FILENO, &readfds);
#endif
}
It seems that inside the search this function doesn't detect the "stop" sent immediately after "go ponder" but I can't understand why. It happens under linux and under windows.