marekpiotradamczyk / bestiazwroclawia

7 stars 7 forks source link

Implement iterative deepening #19

Open mateusz2173 opened 1 month ago

mateusz2173 commented 1 month ago

Instead of running search on depth d once we want to run search sequentially on depths 1, 2, ... d Why? Running search on lower depths is relatively cheap and will populate our Transposition Table, thus making search on depth d faster.

Additionally, on finish of every iteration print UCI info info score cp <score> depth <depth> time <time> or info score mate <mate> depth <depth> time <time>

sample output of command go depth 5 (dont mind informations other than score depth and time)

info score cp 0 depth 1 nodes 31 nps 124666 time 3 pv g1f3
info score cp 0 depth 2 nodes 374 nps 124666 time 3 pv g1f3 g8f6 
info score cp 35 depth 3 nodes 893 nps 223250 time 4 pv b1c3 g8f6 g1f3 
info score cp 0 depth 4 nodes 1480 nps 370000 time 4 pv b1c3 b8c6 g1f3 g8f6 
info score cp 41 depth 5 nodes 8036 nps 1004500 time 8 pv g1f3 g8f6 d2d3 b8c6 c1e3 
bestmove g1f3
mateusz2173 commented 1 month ago

To be effective should be done after this: #17 but in practice can be done anytime.