lucasart / c-chess-cli

Command Line Interface for UCI Chess engines written in C
GNU General Public License v3.0
70 stars 9 forks source link

Wrong "time forfeit" forced #58

Closed francogrex closed 11 months ago

francogrex commented 2 years ago

What is this for (in game.c)

if ((eo[ei]->time || eo[ei]->increment || eo[ei]->movetime) && timeLeft[ei] < 0) {
            g->state = STATE_TIME_LOSS;
            break;
        }

It is forcing an illegal time forfeit on some engines (e.g. berserk, xiphos). I suggest that it is not well implemented and should be revised/removed.

lucasart commented 11 months ago

Time is measured from the UI pov. The OS introduces unpredictable delays from task switching and I/O. The solution is that engines should have a time buffer (generally UCI option to control).