From: Moez Jellouli <37274752+MJZ1977@users.noreply.github.com> Date: Sun, 20 Dec 2020 21:28:23 +0000 (+0100) Subject: Correct Outflanking calculations in classical eval X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=b06ef36ae5f23fa2d4188c9fe6d95c4f551ab035 Correct Outflanking calculations in classical eval Take signed value of rank difference between kings squares instead absolute value in outflanking calculation. This change correct evaluation of endgames with one king invading opponent last ranks. Passed STC: LLR: 2.94 (-2.94,2.94) {-0.25,1.25} Total: 122240 W: 24326 L: 23896 D: 74018 Ptnml(0-2): 2101, 14139, 28236, 14517, 2127 https://tests.stockfishchess.org/tests/view/5fdfc33a3932f79192d394b8 Passed LTC: LLR: 2.97 (-2.94,2.94) {0.25,1.25} Total: 157416 W: 20870 L: 20292 D: 116254 Ptnml(0-2): 973, 13954, 48333, 14418, 1030 https://tests.stockfishchess.org/tests/view/5fe07a453932f79192d39502 closes https://github.com/official-stockfish/Stockfish/pull/3271 Bench: 4162769 --- diff --git a/src/evaluate.cpp b/src/evaluate.cpp index c945cf53..7671f605 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -867,7 +867,7 @@ namespace { Value Evaluation::winnable(Score score) const { int outflanking = distance(pos.square(WHITE), pos.square(BLACK)) - - distance(pos.square(WHITE), pos.square(BLACK)); + + int(rank_of(pos.square(WHITE)) - rank_of(pos.square(BLACK))); bool pawnsOnBothFlanks = (pos.pieces(PAWN) & QueenSide) && (pos.pieces(PAWN) & KingSide);