X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fevaluate.cpp;h=8c1b0b086d30d87f0a943756908d9f072462a3ae;hb=434b2c72a44ba255c14957f519e3993ea3d5d6bc;hp=86f73563ef262a9e2914597320b0adfef8818e59;hpb=c645587270c2b08d327d290d0ae3c3f5e0a30eee;p=stockfish diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 86f73563..8c1b0b08 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -74,7 +74,7 @@ using namespace Trace; 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 @@ -661,13 +661,9 @@ namespace { // assign a smaller bonus if the block square isn't attacked. int k = !unsafeSquares ? 20 : !(unsafeSquares & blockSq) ? 9 : 0; - // If the path to the queen is fully defended, assign a big bonus. - // Otherwise assign a smaller bonus if the block square is defended. - if (defendedSquares == squaresToQueen) - k += 6; - - else if (defendedSquares & blockSq) - k += 4; + // Assign a larger bonus if the block square is defended. + if (defendedSquares & blockSq) + k += 5; bonus += make_score(k * w, k * w); } @@ -813,7 +809,7 @@ namespace { // 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