BimmerBass / Loki

C++17 chess engine
GNU General Public License v3.0
9 stars 2 forks source link

Big negative numbers while searching #31

Closed BimmerBass closed 3 years ago

BimmerBass commented 3 years ago

When Loki is searching, it outputs the nps for every depth in iterative deepening. Example:

go depth 1 info score cp 57 depth 1 seldepth 1 nodes 47 nps 47000 time 2 pv g1f3 bestmove g1f3

This only works for depth = 1 though since the proportion of time used at this depth when going higher is so small, that a division by zero occurs. Depth 5 as an example:

go depth 5 info score cp 57 depth 1 seldepth 1 nodes 42 nps -9223372036854775808 time 1 pv g1f3 info score cp 18 depth 2 seldepth 2 nodes 141 nps 70500 time 2 pv g1f3 g8f6 info score cp 42 depth 3 seldepth 3 nodes 465 nps 155000 time 3 pv g1f3 g8f6 b1c3 info score cp 18 depth 4 seldepth 5 nodes 987 nps 246750 time 5 pv g1f3 g8f6 d2d4 d7d5 info score cp 44 depth 5 seldepth 7 nodes 2297 nps 382833 time 7 pv g1f3 g8f6 d2d4 d7d5 b1c3 bestmove g1f3

The nps number at depth 1 (-9223372036854775808) indicates an overflow caused by division of zero, and needs to be fixed.

BimmerBass commented 3 years ago

This issue has been fixed as of commit eab62cc1c3f09c951c1605f4bef7d1ddf6959da2