]> git.sesse.net Git - stockfish/commitdiff
Razor at depth one, but do razoring only when not in check
authorJoona Kiiski <joona.kiiski@gmail.com>
Thu, 14 Jan 2010 20:58:38 +0000 (22:58 +0200)
committerMarco Costalba <mcostalba@gmail.com>
Sun, 17 Jan 2010 10:46:40 +0000 (11:46 +0100)
This way razoring is always based on exact evaluation and
follows simple formula.

Joona's test results are positive:

32-bit 1CPU:

Mod - Orig: 1073 - 993

64-bit 4CPU:

Mod - Orig: 759 - 721

Functionality Signature: 11448962

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/search.cpp

index 76db6d69217f4d53c3d007d808a0b1b952554111..40808c6adfc77797484fb196cb8c14310d16837e 100644 (file)
@@ -1447,8 +1447,9 @@ namespace {
     }
     // Null move search not allowed, try razoring
     else if (   !value_is_mate(beta)
+             && !isCheck
              && depth < RazorDepth
-             && staticValue < beta - (depth > OnePly ? NullMoveMargin + 16 * depth : 2*NullMoveMargin)
+             && staticValue < beta - (NullMoveMargin + 16 * depth)
              && ss[ply - 1].currentMove != MOVE_NULL
              && ttMove == MOVE_NONE
              && !pos.has_pawn_on_7th(pos.side_to_move()))