bdmendes / camel

Bitboard-based UCI-compatible chess/chess960 engine written from scratch in Rust.
https://lichess.org/@/camel_bot
GNU General Public License v3.0
24 stars 0 forks source link

handle negative time #219

Closed tissatussa closed 6 months ago

tissatussa commented 6 months ago

while playing a game with Camel v1.5.0 (compiled on Xubuntu 22.04) it received an "invalid command" and lost .. this was due to negative remaining time of the opponent, being a human : CuteChess allows negative time for humans. You probably didn't know this fact about CuteChess .. i guess you can easily adjust the concerning code part to anticipate this "behaviour". NOTE: whenever an engine runs out of time, CuteChess ends the game after 15 seconds.

invalid-command-negative-time

here's the CuteChess log tail :

[...]
<Camel v1.5.0(0): info depth 12 score cp 143 time 973 nodes 833005 nps 856035 hashfull 492 pv d5b3 g8f6 f1e1 e7e6 d1d3 e8g8 c1e3 b8d7 b1c3 c8b7 e4e5 d6e5
<Camel v1.5.0(0): info depth 13 score cp 143 time 1446 nodes 1278642 nps 883673 hashfull 508 pv d5b3 g8f6 f1e1 e7e6 d1d3 e8g8 c1e3 b8d7 b1c3 c8b7 e4e5 d6e5 d4e5
<Camel v1.5.0(0): bestmove d5b3 ponder g8f6
>Camel v1.5.0(0): position startpos moves g1f3 g7g6 d2d4 f8g7 e2e4 d7d6 f1c4 a7a6 e1g1 b7b5 c4d5 c7c6 d5b3 c8b7
>Camel v1.5.0(0): isready
<Camel v1.5.0(0): readyok
>Camel v1.5.0(0): go wtime 165661 btime -170671 winc 2000 binc 2000
<Camel v1.5.0(0): Invalid command. Type 'help' to know more.
>Camel v1.5.0(0): stop
bdmendes commented 6 months ago

Dear @tissatussa, that is extremely helpful. The fix should be in fact simple, will have a look. Thank you.

tissatussa commented 6 months ago

indeed v1.5.1 solved this Issue.

bdmendes commented 6 months ago

indeed v1.5.1 solved this Issue.

Awesome, let me know if you find any other issues and I'll issue a patch. Thank you.