From: Fabian Fichter Date: Fri, 1 Mar 2019 18:39:49 +0000 (+0100) Subject: Generalize passed pawn evaluation X-Git-Url: http://winboard.nl/cgi-bin?a=commitdiff_plain;h=a62f034047531a64e1082ab865ce0f888c3961d0;p=fairystockfish.git Generalize passed pawn evaluation losalamos LLR: 2.99 (-2.94,2.94) [-10.00,5.00] Total: 140 W: 56 L: 13 D: 71 ai-wok LLR: 3.04 (-2.94,2.94) [-10.00,5.00] Total: 194 W: 112 L: 53 D: 29 --- diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 95ea180..2b0d228 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -741,7 +741,7 @@ namespace { assert(!(pos.pieces(Them, PAWN) & forward_file_bb(Us, s + Up))); - int r = relative_rank(Us, s, pos.max_rank()); + int r = std::max(RANK_8 - std::max(pos.promotion_rank() - relative_rank(Us, s, pos.max_rank()), 0), 0); int w = PassedDanger[r]; Score bonus = PassedRank[r]; @@ -758,7 +758,7 @@ namespace { - king_proximity(Us, blockSq) * 2) * w); // If blockSq is not the queening square then consider also a second push - if (r != RANK_7) + if (r != pos.promotion_rank() - 1) bonus -= make_score(0, king_proximity(Us, blockSq + Up) * w); }