From: Alfredo Menezes Date: Fri, 9 Dec 2022 15:11:43 +0000 (-0300) Subject: Extend all moves at low depth if ttMove is doubly extended X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=9d3fd011f1bc9ef6f3a3091aae10634b31e0032c Extend all moves at low depth if ttMove is doubly extended If ttMove is doubly extended, we allow a depth growth of the remaining moves. The idea is to get a more realistic score comparison, because of the depth difference. We take some care to avoid this extension for high depths, in order to avoid the cost, since the search result is supposed to be more accurate in this case. This pull request includes some small cleanups. STC: LLR: 2.95 (-2.94,2.94) <0.00,2.00> Total: 60256 W: 16189 L: 15848 D: 28219 Ptnml(0-2): 182, 6546, 16330, 6889, 181 https://tests.stockfishchess.org/tests/view/639109a1792a529ae8f27777 LTC: LLR: 2.95 (-2.94,2.94) <0.50,2.50> Total: 106232 W: 28487 L: 28053 D: 49692 Ptnml(0-2): 46, 10224, 32145, 10652, 49 https://tests.stockfishchess.org/tests/view/63914cba792a529ae8f282ee closes https://github.com/official-stockfish/Stockfish/pull/4271 Bench: 3622368 --- diff --git a/src/search.cpp b/src/search.cpp index 04f73e1c..ec7cff54 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -1067,7 +1067,10 @@ moves_loop: // When in check, search starts here if ( !PvNode && value < singularBeta - 25 && ss->doubleExtensions <= 9) + { extension = 2; + depth += depth < 12; + } } // Multi-cut pruning @@ -1296,7 +1299,7 @@ moves_loop: // When in check, search starts here && depth < 6 && beta < VALUE_KNOWN_WIN && alpha > -VALUE_KNOWN_WIN) - depth -= 1; + depth -= 1; assert(depth > 0); } @@ -1521,7 +1524,6 @@ moves_loop: // When in check, search starts here && futilityBase > -VALUE_KNOWN_WIN && type_of(move) != PROMOTION) { - if (moveCount > 2) continue; diff --git a/src/types.h b/src/types.h index c2087c6c..29c16ce7 100644 --- a/src/types.h +++ b/src/types.h @@ -186,6 +186,9 @@ enum Value : int { VALUE_MATE_IN_MAX_PLY = VALUE_MATE - MAX_PLY, VALUE_MATED_IN_MAX_PLY = -VALUE_MATE_IN_MAX_PLY, + // In the code, we make the assumption that these values + // are such that non_pawn_material() can be used to uniquely + // identify the material on the board. PawnValueMg = 126, PawnValueEg = 208, KnightValueMg = 781, KnightValueEg = 854, BishopValueMg = 825, BishopValueEg = 915,