Crafty (and others?) time management question
Posted: Tue Apr 14, 2009 3:43 am
Here's my newbie question of the week, specifically relating to code in Crafty, but may be relevant to any number of other engines.
Generally speaking, programs decide to add more time to their search if they experience a drop in score for the current iteration (call it ply N) compared to the score for ply N-1.
When checking to see if the engine should think longer than the originally allotted time, Crafty first (or, rather, very nearly first) checks to see if there is any score at the root of the search for ply N. If there isn't one, then Crafty feels that it's ok to bail on the search. After this check, it goes through several other checks that compare the score for ply N compared to ply N-1, as well the amount of time used, as I expected.
However, isn't this initial check potentially dangerous, depending on the relative scores of ply N-1 and N-2? If ply N-1 showed a horrible drop in score, but the search was completed for that ply, can you really trust that the chosen move is the best? Wouldn't you rather allocate more time for the same reason that you would for comparing ply N against ply N-1?
Or is this method of bailing out safe once you have reached a solid enough search/evaluation implementation (meaning, a lot better than what I have now)?
I hope that made sense....
jm (n00b)
Generally speaking, programs decide to add more time to their search if they experience a drop in score for the current iteration (call it ply N) compared to the score for ply N-1.
When checking to see if the engine should think longer than the originally allotted time, Crafty first (or, rather, very nearly first) checks to see if there is any score at the root of the search for ply N. If there isn't one, then Crafty feels that it's ok to bail on the search. After this check, it goes through several other checks that compare the score for ply N compared to ply N-1, as well the amount of time used, as I expected.
However, isn't this initial check potentially dangerous, depending on the relative scores of ply N-1 and N-2? If ply N-1 showed a horrible drop in score, but the search was completed for that ply, can you really trust that the chosen move is the best? Wouldn't you rather allocate more time for the same reason that you would for comparing ply N against ply N-1?
Or is this method of bailing out safe once you have reached a solid enough search/evaluation implementation (meaning, a lot better than what I have now)?
I hope that made sense....
jm (n00b)