Hello Harald, yes I think you are right. For default settings it will work as is. The problem is that in all the Checkov settings Toga Extended History pruning that Thomas Gaksch invented is swithched on, but reduced can only be set once. I don't do History pruning in PV nodes but with EHP I can reduce two plies, now the re-search only takes that back by one ply. I do set the 'reduced' flag but there is not yet a different flag for Extended History Pruning.Harald Johnsen wrote:No, the correct code is value > alpha.EdG: value >= alpha seems a correct bugfix here?
Also, testing value > alpha and value >= beta is the same as long as you do not reduce the search in PV nodes (in non PV nodes we have beta == alpha + 1).
Only some versions of Toga are reducing in pv nodes. It is in those reduced pv nodes that there can be a problem.
HJ.
Also I think it is fair to say that if the reduced seach is already close to but not larger than alpha, you should still do a re-search because it can easily cross over. Because I often reduce two plies the condition >= alpha is often better I think, when real value may exceed alpha, and additional reason is I recently did even a third ply reduction if more than five moves were not reduced by a third ply and an approximate search for this node exceeded beta (alpha + 1 as you say so not so rare). I did not have a separate flag for this third reduction so that will make it likely I should see more differences now with >= alpha than regular Toga that only reduces one ply.
I probably should make the reduced flag into a counter!
My History Reductions are, with some left-over codes:
Code: Select all
if (UseHistory && depth >= HistoryDepth && node_type != NodePV) {
if (!in_check && played_nb >= HistoryMoveNb && new_depth < depth ) {
ASSERT(best_value!=ValueNone);
ASSERT(played_nb>0);
ASSERT(sort->pos>0&&move==LIST_MOVE(sort->list,sort->pos-1));
value = sort->value; // history score
if (value < HistoryValue) {
ASSERT(value>=0&&value<16384);
ASSERT(move!=trans_move);
ASSERT(!move_is_tactical(move,board));
ASSERT(!move_is_check(move,board));
new_depth--;
reduced = true;
if (UseExtendedHistory && (value < (HistoryValue * 3 / (depth + depth % 2)) && depth >= 5)){
new_depth--;
}
/*
if (value < (HistoryValue * 4 / (depth + depth % 2)) && depth >= 14) new_depth--;
[EdG 20-01-2008: Experimental extra (third!) reduction, too much]
*/
}
if ((not_history_reduced > 5) && approximate_beta_cutoff) { // The approximate search was > beta but not enough for 'brute pruning' directly, also there was no nullmove cutoff.
new_depth--;
reduced = true;
} else not_history_reduced++;
}
Thanks!
Eelco