From c7194bd924a606ab75d582d30cb41749312ea94e Mon Sep 17 00:00:00 2001 From: =?utf8?q?Ste=CC=81phane=20Nicolet?= Date: Sun, 28 Jun 2020 22:24:57 +0200 Subject: [PATCH] Scale down eval for queen imbalance We lower the endgame value of the evaluation when we detect that there is only one queen left on the board (more precisely, we use a scale factor of 37/64, or about 0.58, for the endgame part of the evaluation). Hopefully this helps a little bit for the assessment of positions with queen imbalance, which are one of the well-known Stockfish weaknesses. STC: LLR: 2.94 (-2.94,2.94) {-0.50,1.50} Total: 21600 W: 4176 L: 3955 D: 13469 Ptnml(0-2): 351, 2457, 5003, 2598, 391 https://tests.stockfishchess.org/tests/view/5ef871b6020eec13834a94e8 LTC: LLR: 2.97 (-2.94,2.94) {0.25,1.75} Total: 248328 W: 30596 L: 29720 D: 188012 Ptnml(0-2): 1544, 22345, 75665, 22911, 1699 https://tests.stockfishchess.org/tests/view/5ef87aec020eec13834a94fe Closes https://github.com/official-stockfish/Stockfish/pull/2781 Bench: 4441323 --- src/evaluate.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 65f7bddc..d19cf34e 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -767,7 +767,6 @@ namespace { eg += v; // Compute the scale factor for the winning side - Color strongSide = eg > VALUE_DRAW ? WHITE : BLACK; int sf = me->scale_factor(pos, strongSide); @@ -782,13 +781,15 @@ namespace { else sf = 22 + 3 * pos.count(strongSide); } - else if( pos.non_pawn_material(WHITE) == RookValueMg + else if ( pos.non_pawn_material(WHITE) == RookValueMg && pos.non_pawn_material(BLACK) == RookValueMg && !pe->passed_pawns(strongSide) && pos.count(strongSide) - pos.count(~strongSide) <= 1 && bool(KingSide & pos.pieces(strongSide, PAWN)) != bool(QueenSide & pos.pieces(strongSide, PAWN)) && (attacks_bb(pos.square(~strongSide)) & pos.pieces(~strongSide, PAWN))) sf = 36; + else if (pos.count() == 1) + sf = 37; else sf = std::min(sf, 36 + 7 * pos.count(strongSide)); } -- 2.39.2