From 45072612d4ddc1483581eb7799d270778e71d5e3 Mon Sep 17 00:00:00 2001 From: Alain SAVARD Date: Mon, 23 Apr 2018 15:49:34 -0400 Subject: [PATCH] No Queen in the MobilityArea Queen was recently excluded from the mobility area of friendly minor pieces. Exclude queen also from the mobility area of friendly majors too. Run as a simplification: STC http://tests.stockfishchess.org/tests/view/5ade396f0ebc59602d053742 LLR: 2.96 (-2.94,2.94) [-3.00,1.00] Total: 46972 W: 9511 L: 9437 D: 28024 LTC http://tests.stockfishchess.org/tests/view/5ade64b50ebc5949f20a24d3 LLR: 2.95 (-2.94,2.94) [-3.00,1.00] Total: 66855 W: 10157 L: 10105 D: 46593 How to continue from there? The mobilityArea is used in various places of the evaluation as a soft proxy for "not attacked by the opponent pawns". Now that the mobility area is getting smaller and smaller, it may be worth to hunt for Elo gains by trying the more direct ~attackedBy[Them][PAWN] instead of mobilityArea[Us] in these places. Bench: 4650572 --- src/evaluate.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 1505bf67..ad63e216 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -258,9 +258,9 @@ namespace { // Find our pawns that are blocked or on the first two ranks Bitboard b = pos.pieces(Us, PAWN) & (shift(pos.pieces()) | LowRanks); - // Squares occupied by those pawns, by our king, or controlled by enemy pawns + // Squares occupied by those pawns, by our king or queen, or controlled by enemy pawns // are excluded from the mobility area. - mobilityArea[Us] = ~(b | pos.square(Us) | pe->pawn_attacks(Them)); + mobilityArea[Us] = ~(b | pos.pieces(Us, KING, QUEEN) | pe->pawn_attacks(Them)); // Initialise attackedBy bitboards for kings and pawns attackedBy[Us][KING] = pos.attacks_from(pos.square(Us)); @@ -301,7 +301,6 @@ namespace { Bitboard b, bb; Square s; Score score = SCORE_ZERO; - int mob; attackedBy[Us][Pt] = 0; @@ -326,8 +325,7 @@ namespace { kingAttacksCount[Us] += popcount(b & attackedBy[Them][KING]); } - mob = (Pt == KNIGHT || Pt == BISHOP) ? popcount(b & mobilityArea[Us] & ~pos.pieces(Us, QUEEN)) - : popcount(b & mobilityArea[Us]); + int mob = popcount(b & mobilityArea[Us]); mobility[Us] += MobilityBonus[Pt - 2][mob]; -- 2.39.2