With this idea, Onno made one of its biggest leaps. I did not find
this idea in Stockfish. But of course it is possible that the
Stockfish search does implicitly something somewhere. Then Stockfish
might not profit from this idea as Onno did. Try it out!
The idea is not to search bad looking moves. To determine what a bad
looking move is, we search the move with reduced depth and reduced
alpha/beta. That is, if a search at depth d-3 says that you lose more
then a pawn, do not search the move with current depth d.
Here is the code from Onno:
Code: Select all
// bad pruning
// ------------------------------------------------------------
if (SearchInnerRc::bad_enable && node->type==NodeType::all && node->beta>=-ValueNode::max_eval )
{
// setup child
child->depth = node->depth - SearchInnerRc::bad_reduction;
child->height = node->height;
child->alpha = node->alpha - SearchInnerRc::bad_margin;
child->beta = node->beta - SearchInnerRc::bad_margin;
child->type = NodeType::cut;
child->ret_addr = Label::after_bad_pruning;
// goto child
node->move = Move::none;
++node;
++child;
goto recurse;
// evaluate
after_bad_pruning:
if (child->pv.value() < node->beta - SearchInnerRc::bad_margin)
{
node->pv = child->pv;
log_finish (1, "bad pruning");
goto node_done;
}
}
child before ++child and is node after++node), stores the result in
child->pv, decrements node and child, and finally has a huge case switch on
child->ret_addr to jump back to after_bad_pruning.
Note that Move::none is different from Move::null.
Useful values are 150 centipawns for bad_margin and 3 for bad_reduction.
Obviously the downside of bad pruning is Onno's well known tactical
blindness, especially for double sacrifices. Bug over all bad pruning
made Onno much stronger.