X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fevaluate.cpp;h=d211db645f383678330b3b13be842169d85daab0;hp=d1a8ffd31fb4ab954ed3849bfa927d58bde5c3bf;hb=3edf0e6b37df9c81ea1a4cd3affd11548547815b;hpb=a8abba0b4d127f608e8e8dde4583d6389b3c2339 diff --git a/src/evaluate.cpp b/src/evaluate.cpp index d1a8ffd3..d211db64 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 @@ -357,8 +357,8 @@ namespace { score += RookOnPawn * popcount(pos.pieces(Them, PAWN) & PseudoAttacks[ROOK][s]); // Bonus for rook on an open or semi-open file - if (pos.is_semiopen_file(Us, file_of(s))) - score += RookOnFile[bool(pos.is_semiopen_file(Them, file_of(s)))]; + if (pos.is_on_semiopen_file(Us, s)) + score += RookOnFile[bool(pos.is_on_semiopen_file(Them, s))]; // Penalty when trapped by the king, even more if the king cannot castle else if (mob <= 3) @@ -649,7 +649,7 @@ namespace { // in the pawn's path attacked or occupied by the enemy. defendedSquares = unsafeSquares = squaresToQueen = forward_file_bb(Us, s); - bb = forward_file_bb(Them, s) & pos.pieces(ROOK, QUEEN) & pos.attacks_from(s); + bb = forward_file_bb(Them, s) & pos.pieces(ROOK, QUEEN); if (!(pos.pieces(Us) & bb)) defendedSquares &= attackedBy[Us][ALL_PIECES]; @@ -813,7 +813,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