From 28faa31a8e837fb41d8c470fa4ed1c4a712c0c43 Mon Sep 17 00:00:00 2001 From: ianfab Date: Thu, 23 Aug 2018 22:26:20 +0200 Subject: [PATCH] Remove lazy evaluation 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 | 12 +++--------- 1 files changed, 3 insertions(+), 9 deletions(-) diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 52c12d8..37106a3 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -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(); @@ -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); -- 1.7.0.4