]> git.sesse.net Git - stockfish/commitdiff
Scale lazy threshold according to material. (#2170)
authorprotonspring <mike@whiteley.org>
Fri, 31 May 2019 12:35:39 +0000 (06:35 -0600)
committerMarco Costalba <mcostalba@users.noreply.github.com>
Fri, 31 May 2019 12:35:39 +0000 (14:35 +0200)
STC
LLR: 2.95 (-2.94,2.94) [0.50,4.50]
Total: 58543 W: 13238 L: 12782 D: 32523
http://tests.stockfishchess.org/tests/view/5cef3efa0ebc5925cf081f07

LTC
LLR: 3.70 (-2.94,2.94) [0.00,3.50]
Total: 82232 W: 14281 L: 13825 D: 54126
http://tests.stockfishchess.org/tests/view/5cef595d0ebc5925cf082441

bench 3807737

src/evaluate.cpp

index 86f73563ef262a9e2914597320b0adfef8818e59..d211db645f383678330b3b13be842169d85daab0 100644 (file)
@@ -74,7 +74,7 @@ using namespace Trace;
 namespace {
 
   // Threshold for lazy and space evaluation
 namespace {
 
   // Threshold for lazy and space evaluation
-  constexpr Value LazyThreshold  = Value(1500);
+  constexpr Value LazyThreshold  = Value(1400);
   constexpr Value SpaceThreshold = Value(12222);
 
   // KingAttackWeights[PieceType] contains king attack weights by piece type
   constexpr Value SpaceThreshold = Value(12222);
 
   // KingAttackWeights[PieceType] contains king attack weights by piece type
@@ -813,7 +813,7 @@ namespace {
 
     // Early exit if score is high
     Value v = (mg_value(score) + eg_value(score)) / 2;
 
     // Early exit if score is high
     Value v = (mg_value(score) + eg_value(score)) / 2;
-    if (abs(v) > LazyThreshold)
+    if (abs(v) > (LazyThreshold + pos.non_pawn_material() / 64))
        return pos.side_to_move() == WHITE ? v : -v;
 
     // Main evaluation begins here
        return pos.side_to_move() == WHITE ? v : -v;
 
     // Main evaluation begins here