From 6960f41e03b0d5fdbc74e60eae27f4adb8091058 Mon Sep 17 00:00:00 2001 From: Tom Vijlbrief Date: Sat, 13 Jul 2013 11:46:59 +0200 Subject: [PATCH] Retire enoughMaterial + lower trapped rook threshold Here speed up is the name of the game. Speed up is gained: - Removing the useless enoughMaterial code - Limiting trapped rook evaluation to where it counts Tested at long TC: LLR: 2.97 (-2.94,2.94) Total: 10061 W: 1948 L: 1790 D: 6323 bench: 4558173 --- src/evaluate.cpp | 2 +- src/search.cpp | 5 +---- 2 files changed, 2 insertions(+), 5 deletions(-) diff --git a/src/evaluate.cpp b/src/evaluate.cpp index c5af2f89..d171eb9b 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -554,7 +554,7 @@ Value do_evaluate(const Position& pos, Value& margin) { if (ei.pi->semiopen(Us, file_of(s))) score += ei.pi->semiopen(Them, file_of(s)) ? RookOpenFile : RookSemiopenFile; - if (mob > 6 || ei.pi->semiopen(Us, file_of(s))) + if (mob > 3 || ei.pi->semiopen(Us, file_of(s))) continue; Square ksq = pos.king_square(Us); diff --git a/src/search.cpp b/src/search.cpp index be9f108a..d36e978b 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -1126,7 +1126,7 @@ moves_loop: // When in check and at SpNode search starts from here Key posKey; Move ttMove, move, bestMove; Value bestValue, value, ttValue, futilityValue, futilityBase, oldAlpha; - bool givesCheck, enoughMaterial, evasionPrunable; + bool givesCheck, evasionPrunable; Depth ttDepth; // To flag BOUND_EXACT a node with eval above alpha and no available moves @@ -1168,7 +1168,6 @@ moves_loop: // When in check and at SpNode search starts from here { ss->staticEval = ss->evalMargin = VALUE_NONE; bestValue = futilityBase = -VALUE_INFINITE; - enoughMaterial = false; } else { @@ -1196,7 +1195,6 @@ moves_loop: // When in check and at SpNode search starts from here alpha = bestValue; futilityBase = ss->staticEval + ss->evalMargin + Value(128); - enoughMaterial = pos.non_pawn_material(pos.side_to_move()) > RookValueMg; } // Initialize a MovePicker object for the current position, and prepare @@ -1218,7 +1216,6 @@ moves_loop: // When in check and at SpNode search starts from here && !InCheck && !givesCheck && move != ttMove - && enoughMaterial && type_of(move) != PROMOTION && !pos.is_passed_pawn_push(move)) {