One of the interesting questions — a reduction factor. Previously I user 4 plies for exact nodes and 10 plies for remaining ones, but IID depth should be at least 1 ply (not quiescent).
But is it really neccessary to use reducted depth here? One of the ideas that working is to add also max depth value — IID subtree depth should not exceed 4 plies for pv node and 2 plies for non-pv. For me it works.
Final variation is something like internal fixed deepening (IFD)
I think someone should try it in SF))
Code: Select all
// IID
if (Depth >= 5 * INCPLY && !TranspositionMove)
{
if (node_type == NODE_TYPE_EXACT)
{
if (static_eval < beta + 50)
{
NextSearch(alpha - 50, beta + 50, 0, FALSE, NODE_TYPE_EXACT);
if (thread_board->stopped) return 0;
}
else
{
thread_tree[threads[CURRENT_THREAD].ply].LastThreatMove = 0;
}
if (!thread_tree[threads[CURRENT_THREAD].ply].LastThreatMove)
{
int iid_depth = MIN(4 * INCPLY, MAX(INCPLY, Depth - 4 * INCPLY));
best = NextSearch(alpha - 50, beta + 50, iid_depth, FALSE, NODE_TYPE_EXACT);
if (thread_board->stopped) return 0;
if (best <= alpha - 50)
{
NextSearch(-INFINITY, beta, iid_depth, FALSE, NODE_TYPE_EXACT);
if (thread_board->stopped) return 0;
}
}
TranspositionMove = thread_tree[threads[CURRENT_THREAD].ply].LastThreatMove;
thread_tree[threads[CURRENT_THREAD].ply].LastThreatMove = 0;
}
else if (static_eval + 50 > alpha)
{
if (static_eval < beta + 50)
{
NextSearch(alpha - 100, beta, 0, FALSE, node_type);
if (thread_board->stopped) return 0;
}
else
{
thread_tree[threads[CURRENT_THREAD].ply].LastThreatMove = 0;
}
if (!thread_tree[threads[CURRENT_THREAD].ply].LastThreatMove)
{
int iid_depth = MIN(2 * INCPLY, MAX(INCPLY, Depth - 10 * INCPLY));
best = NextSearch(alpha - 100, beta, iid_depth, FALSE, node_type);
if (thread_board->stopped) return 0;
if (best <= alpha - 100)
{
NextSearch(-INFINITY, beta, iid_depth, FALSE, node_type);
if (thread_board->stopped) return 0;
}
}
TranspositionMove = thread_tree[threads[CURRENT_THREAD].ply].LastThreatMove;
thread_tree[threads[CURRENT_THREAD].ply].LastThreatMove = 0;
}
}