I was debugging some strange moves made by the engine, and I came up debugging the very popular "fail low at the root" situation.
This is, in my aspiration code, the root search returns a value <= alpha, so none of the moves can improve alpha, and then the search window is widened.
Then, in the middle of the second (or third) search, we reach the end of our time allocation, and a (expected) bad move is returned as best move.
What I'm trying to solve this situation is to extend the allocated time each time I detect a fail low at the root. Something like this:
Code: Select all
int aspiration_count = 1;
bool outside_window = false;
do{
result = search_root( depth, alpha, beta );
if (result <= alpha || result>=beta)
{
outside_window=true;
//time management, for fail low situations
if (result <= alpha) info->solving_fail_low = true;
else info->solving_fail_low = false;
//time management, for fail low situations
if (info->solving_fail_low &&
info->timed_search
&& search_info_elapsed_ms() > (info->allocated_time /2)
)
info->allocated_time = min( ((info->allocated_time*175)/100), info->max_allocated_time);
if (aspiration_count==1) {
alpha = result-ASPIRATION_WINDOW_2;
beta = result+ASPIRATION_WINDOW_2;
}else {
alpha = -INF;
beta = INF;
}
}else {
outside_window = false;
alpha = result-ASPIRATION_WINDOW;
beta = result+ASPIRATION_WINDOW;
}
aspiration_count++;
}while (outside_window);
I wonder what others are doing so solve this problem.
Any input would be appreciated.