This is a functional simplification.
Moves WeakUnopposedPawn to pawns.cpp and remove piece dependency.
STC
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 8699 W: 2000 L: 1853 D: 4846
http://tests.stockfishchess.org/tests/view/
5cf7721b0ebc5925cf08ee79
LTC
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 46605 W: 7969 L: 7890 D: 30746
http://tests.stockfishchess.org/tests/view/
5cf7d5f70ebc5925cf08fa96
constexpr Score ThreatBySafePawn = S(173, 94);
constexpr Score TrappedRook = S( 47, 4);
constexpr Score WeakQueen = S( 49, 15);
- constexpr Score WeakUnopposedPawn = S( 12, 23);
#undef S
score += RestrictedPiece * popcount(b);
- // Bonus for enemy unopposed weak pawns
- if (pos.pieces(Us, ROOK, QUEEN))
- score += WeakUnopposedPawn * pe->weak_unopposed(Them);
-
// Find squares where our pawns can push on the next move
b = shift<Up>(pos.pieces(Us, PAWN)) & ~pos.pieces();
b |= shift<Up>(b & TRank3BB) & ~pos.pieces();
constexpr Score Backward = S( 9, 24);
constexpr Score Doubled = S(11, 56);
constexpr Score Isolated = S( 5, 15);
+ constexpr Score WeakUnopposed = S( 13, 27);
// Connected pawn bonus
constexpr int Connected[RANK_NB] = { 0, 7, 8, 12, 29, 48, 86 };
Bitboard ourPawns = pos.pieces( Us, PAWN);
Bitboard theirPawns = pos.pieces(Them, PAWN);
- e->passedPawns[Us] = e->pawnAttacksSpan[Us] = e->weakUnopposed[Us] = 0;
+ e->passedPawns[Us] = e->pawnAttacksSpan[Us] = 0;
e->kingSquares[Us] = SQ_NONE;
e->pawnAttacks[Us] = pawn_attacks_bb<Us>(ourPawns);
score += make_score(v, v * (r - 2) / 4);
}
else if (!neighbours)
- score -= Isolated, e->weakUnopposed[Us] += !opposed;
+ score -= Isolated + WeakUnopposed * int(!opposed);
else if (backward)
- score -= Backward, e->weakUnopposed[Us] += !opposed;
+ score -= Backward + WeakUnopposed * int(!opposed);
if (doubled && !support)
score -= Doubled;
Bitboard pawn_attacks(Color c) const { return pawnAttacks[c]; }
Bitboard passed_pawns(Color c) const { return passedPawns[c]; }
Bitboard pawn_attacks_span(Color c) const { return pawnAttacksSpan[c]; }
- int weak_unopposed(Color c) const { return weakUnopposed[c]; }
int passed_count() const { return popcount(passedPawns[WHITE] | passedPawns[BLACK]); }
template<Color Us>
Bitboard pawnAttacksSpan[COLOR_NB];
Square kingSquares[COLOR_NB];
Score kingSafety[COLOR_NB];
- int weakUnopposed[COLOR_NB];
int castlingRights[COLOR_NB];
int pawnsOnSquares[COLOR_NB][COLOR_NB]; // [color][light/dark squares]
};