From 29bc1283841c8a935796159c6d3093ec879c246f Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ste=CC=81phane=20Nicolet?= Date: Wed, 21 Feb 2018 01:07:35 +0100 Subject: [PATCH] No Tempo for draw scores given by heuristic functions The current master applies Eval::Tempo even to leaves evaluated as draw by some of the static evaluation functions of endgame.cpp (for instance KNN vs K or stalemates in KP vs K). This results in some lines being reported as +0.07 or -0.07 when the terminal position has reached such endgames (0.07 being about the value of a tempo for Stockfish). This patch does not apply Eval::tempo to these positions. This leads to more nodes being evaluated as VALUE_DRAW during search, giving more opportunities for cut-offs in alpha-beta. STC: LLR: 2.96 (-2.94,2.94) [0.00,4.00] Total: 52602 W: 11776 L: 11403 D: 29423 http://tests.stockfishchess.org/tests/view/5a8cb8f60ebc590297cc8546 LTC: LLR: 2.97 (-2.94,2.94) [0.00,4.00] Total: 156613 W: 26820 L: 26158 D: 103635 http://tests.stockfishchess.org/tests/view/5a8f452d0ebc590297cc865a Bench: 4924749 --- src/evaluate.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 11a6fa27..8e6d827e 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -880,7 +880,8 @@ namespace { Trace::add(TOTAL, score); } - return pos.side_to_move() == WHITE ? v : -v; // Side to move point of view + return (pos.side_to_move() == WHITE ? v : -v) // Side to move point of view + + Eval::Tempo; } } // namespace @@ -890,7 +891,7 @@ namespace { /// evaluation of the position from the point of view of the side to move. Value Eval::evaluate(const Position& pos) { - return Evaluation(pos).value() + Eval::Tempo; + return Evaluation(pos).value(); } @@ -904,7 +905,7 @@ std::string Eval::trace(const Position& pos) { Eval::Contempt = SCORE_ZERO; // Reset any dynamic contempt - Value v = Evaluation(pos).value() + Eval::Tempo; + Value v = Evaluation(pos).value(); v = pos.side_to_move() == WHITE ? v : -v; // Trace scores are from white's point of view -- 2.39.2