Skip to content

Commit

Permalink
No Queen in the MobilityArea
Browse files Browse the repository at this point in the history
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
  • Loading branch information
Rocky640 authored and snicolet committed Apr 24, 2018
1 parent c794c8c commit 4507261
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/evaluate.cpp
Expand Up @@ -258,9 +258,9 @@ namespace {
// Find our pawns that are blocked or on the first two ranks
Bitboard b = pos.pieces(Us, PAWN) & (shift<Down>(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<KING>(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<KING>(pos.square<KING>(Us));
Expand Down Expand Up @@ -301,7 +301,6 @@ namespace {
Bitboard b, bb;
Square s;
Score score = SCORE_ZERO;
int mob;

attackedBy[Us][Pt] = 0;

Expand All @@ -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];

Expand Down

0 comments on commit 4507261

Please sign in to comment.