Remove lazy evaluation
authorianfab <ianfab@users.noreply.github.com>
Thu, 23 Aug 2018 20:26:20 +0000 (22:26 +0200)
committerFabian Fichter <ianfab@users.noreply.github.com>
Mon, 27 Aug 2018 18:59:03 +0000 (20:59 +0200)
STC racing kings
LLR: 2.96 (-2.94,2.94) [0.00,10.00]
Total: 160 W: 117 L: 26 D: 17
http://35.161.250.236:6543/tests/view/5b7f9fca6e23db0fbab0dcc3

STC crazyhouse
ELO: 17.91 +-15.1 (95%) LOS: 99.0%
Total: 2000 W: 1037 L: 934 D: 29
http://35.161.250.236:6543/tests/view/5b7f18a36e23db0fbab0dcb9

STC chess
ELO: -2.61 +-10.0 (95%) LOS: 30.5%
Total: 2000 W: 426 L: 441 D: 1133
http://35.161.250.236:6543/tests/view/5b805f6b6e23db0fbab0dcca

bench: 5056893

src/evaluate.cpp

index 52c12d8..37106a3 100644 (file)
@@ -84,8 +84,7 @@ namespace {
     KingSide,    KingSide,  KingSide
   };
 
-  // Threshold for lazy and space evaluation
-  constexpr Value LazyThreshold  = Value(1500);
+  // Threshold for space evaluation
   constexpr Value SpaceThreshold = Value(12222);
 
   // KingAttackWeights[PieceType] contains king attack weights by piece type
@@ -940,11 +939,6 @@ namespace {
     pe = Pawns::probe(pos);
     score += pe->pawn_score(WHITE) - pe->pawn_score(BLACK);
 
-    // Early exit if score is high
-    Value v = (mg_value(score) + eg_value(score)) / 2;
-    if (abs(v) > LazyThreshold)
-       return pos.side_to_move() == WHITE ? v : -v;
-
     // Main evaluation begins here
 
     initialize<WHITE>();
@@ -967,8 +961,8 @@ namespace {
 
     // Interpolate between a middlegame and a (scaled by 'sf') endgame score
     ScaleFactor sf = scale_factor(eg_value(score));
-    v =  mg_value(score) * int(me->game_phase())
-       + eg_value(score) * int(PHASE_MIDGAME - me->game_phase()) * sf / SCALE_FACTOR_NORMAL;
+    Value v =  mg_value(score) * int(me->game_phase())
+             + eg_value(score) * int(PHASE_MIDGAME - me->game_phase()) * sf / SCALE_FACTOR_NORMAL;
 
     v /= int(PHASE_MIDGAME);