From: Joona Kiiski Date: Wed, 24 Feb 2010 10:26:36 +0000 (+0200) Subject: Separate razoring from null move X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=89b4ad6433fbe04acbd8e9f6f45ddf33ec2d7fd7 Separate razoring from null move I cannot see connection between the two. Also add one FIXME for illogical behaviour No functional change Signed-off-by: Marco Costalba --- diff --git a/src/search.cpp b/src/search.cpp index ebd004d3..7f64cd94 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -1316,6 +1316,21 @@ namespace { update_gains(pos, ss[ply - 1].currentMove, ss[ply - 1].eval, ss[ply].eval); } + // Step 6. Razoring + if ( !value_is_mate(beta) + && !isCheck + && depth < RazorDepth + && staticValue < beta - (0x200 + 16 * depth) + && ss[ply - 1].currentMove != MOVE_NULL + && ttMove == MOVE_NONE + && !pos.has_pawn_on_7th(pos.side_to_move())) + { + Value rbeta = beta - (0x200 + 16 * depth); + Value v = qsearch(pos, ss, rbeta-1, rbeta, Depth(0), ply, threadID); + if (v < rbeta) + return v; //FIXME: Logically should be: return (v + 0x200 + 16 * depth); + } + // Static null move pruning. We're betting that the opponent doesn't have // a move that will reduce the score by more than FutilityMargins[int(depth)] // if we do a null move. @@ -1374,20 +1389,6 @@ namespace { return beta - 1; } } - // Null move search not allowed, try razoring - else if ( !value_is_mate(beta) - && !isCheck - && depth < RazorDepth - && staticValue < beta - (NullMoveMargin + 16 * depth) - && ss[ply - 1].currentMove != MOVE_NULL - && ttMove == MOVE_NONE - && !pos.has_pawn_on_7th(pos.side_to_move())) - { - Value rbeta = beta - (NullMoveMargin + 16 * depth); - Value v = qsearch(pos, ss, rbeta-1, rbeta, Depth(0), ply, threadID); - if (v < rbeta) - return v; - } // Go with internal iterative deepening if we don't have a TT move if (UseIIDAtNonPVNodes && ttMove == MOVE_NONE && depth >= 8*OnePly &&