Remove Reduce Depth

Remove Reduce Depth at PV nodes.

STC:
LLR: 2.94 (-2.94,2.94) {-1.25,0.25}
Total: 56760 W: 6299 L: 6236 D: 44225
Ptnml(0-2): 286, 4843, 18076, 4872, 303
https://tests.stockfishchess.org/tests/view/5f41356087a5c3c63d8f53c9

LTC:
LLR: 2.95 (-2.94,2.94) {-0.75,0.25}
Total: 17496 W: 954 L: 865 D: 15677
Ptnml(0-2): 13, 768, 7098, 855, 14
https://tests.stockfishchess.org/tests/view/5f41bb7687a5c3c63d8f53f9

closes https://github.com/official-stockfish/Stockfish/pull/3055

Bench: 3555051
This commit is contained in:
VoyagerOne
2020-08-23 12:04:50 -04:00
committed by Joost VandeVondele
parent 9b4967071e
commit 95b8f3f800
+9 -15
View File
@@ -940,12 +940,6 @@ namespace {
} }
} }
// Step 11. If the position is not in TT, decrease depth by 2
if ( PvNode
&& depth >= 6
&& !ttMove)
depth -= 2;
moves_loop: // When in check, search starts from here moves_loop: // When in check, search starts from here
const PieceToHistory* contHist[] = { (ss-1)->continuationHistory, (ss-2)->continuationHistory, const PieceToHistory* contHist[] = { (ss-1)->continuationHistory, (ss-2)->continuationHistory,
@@ -969,7 +963,7 @@ moves_loop: // When in check, search starts from here
// Mark this node as being searched // Mark this node as being searched
ThreadHolding th(thisThread, posKey, ss->ply); ThreadHolding th(thisThread, posKey, ss->ply);
// Step 12. Loop through all pseudo-legal moves until no moves remain // Step 11. Loop through all pseudo-legal moves until no moves remain
// or a beta cutoff occurs. // or a beta cutoff occurs.
while ((move = mp.next_move(moveCountPruning)) != MOVE_NONE) while ((move = mp.next_move(moveCountPruning)) != MOVE_NONE)
{ {
@@ -1007,7 +1001,7 @@ moves_loop: // When in check, search starts from here
// Calculate new depth for this move // Calculate new depth for this move
newDepth = depth - 1; newDepth = depth - 1;
// Step 13. Pruning at shallow depth (~200 Elo) // Step 12. Pruning at shallow depth (~200 Elo)
if ( !rootNode if ( !rootNode
&& pos.non_pawn_material(us) && pos.non_pawn_material(us)
&& bestValue > VALUE_TB_LOSS_IN_MAX_PLY) && bestValue > VALUE_TB_LOSS_IN_MAX_PLY)
@@ -1065,7 +1059,7 @@ moves_loop: // When in check, search starts from here
} }
} }
// Step 14. Extensions (~75 Elo) // Step 13. Extensions (~75 Elo)
// Singular extension search (~70 Elo). If all moves but one fail low on a // Singular extension search (~70 Elo). If all moves but one fail low on a
// search of (alpha-s, beta-s), and just one fails high on (alpha, beta), // search of (alpha-s, beta-s), and just one fails high on (alpha, beta),
@@ -1148,10 +1142,10 @@ moves_loop: // When in check, search starts from here
[movedPiece] [movedPiece]
[to_sq(move)]; [to_sq(move)];
// Step 15. Make the move // Step 14. Make the move
pos.do_move(move, st, givesCheck); pos.do_move(move, st, givesCheck);
// Step 16. Reduced depth search (LMR, ~200 Elo). If the move fails high it will be // Step 15. Reduced depth search (LMR, ~200 Elo). If the move fails high it will be
// re-searched at full depth. // re-searched at full depth.
if ( depth >= 3 if ( depth >= 3
&& moveCount > 1 + 2 * rootNode + 2 * (PvNode && abs(bestValue) < 2) && moveCount > 1 + 2 * rootNode + 2 * (PvNode && abs(bestValue) < 2)
@@ -1254,7 +1248,7 @@ moves_loop: // When in check, search starts from here
didLMR = false; didLMR = false;
} }
// Step 17. Full depth search when LMR is skipped or fails high // Step 16. Full depth search when LMR is skipped or fails high
if (doFullDepthSearch) if (doFullDepthSearch)
{ {
value = -search<NonPV>(pos, ss+1, -(alpha+1), -alpha, newDepth, !cutNode); value = -search<NonPV>(pos, ss+1, -(alpha+1), -alpha, newDepth, !cutNode);
@@ -1282,12 +1276,12 @@ moves_loop: // When in check, search starts from here
value = -search<PV>(pos, ss+1, -beta, -alpha, newDepth, false); value = -search<PV>(pos, ss+1, -beta, -alpha, newDepth, false);
} }
// Step 18. Undo move // Step 17. Undo move
pos.undo_move(move); pos.undo_move(move);
assert(value > -VALUE_INFINITE && value < VALUE_INFINITE); assert(value > -VALUE_INFINITE && value < VALUE_INFINITE);
// Step 19. Check for a new best move // Step 18. Check for a new best move
// Finished searching the move. If a stop occurred, the return value of // Finished searching the move. If a stop occurred, the return value of
// the search cannot be trusted, and we return immediately without // the search cannot be trusted, and we return immediately without
// updating best move, PV and TT. // updating best move, PV and TT.
@@ -1364,7 +1358,7 @@ moves_loop: // When in check, search starts from here
return VALUE_DRAW; return VALUE_DRAW;
*/ */
// Step 20. Check for mate and stalemate // Step 19. Check for mate and stalemate
// All legal moves have been searched and if there are no legal moves, it // All legal moves have been searched and if there are no legal moves, it
// must be a mate or a stalemate. If we are in a singular extension search then // must be a mate or a stalemate. If we are in a singular extension search then
// return a fail low score. // return a fail low score.