Score unopposed weak pawns only if majors

Do not use the opposed flag for scoring backward and isolated pawns
in pawns.cpp, instead give a S(5,25) bonus for each opponent unopposed
weak pawns when we have a rook or a queen on the board.

STC run stopped after 113188 games:
LLR: 1.63 (-2.94,2.94) [0.00,5.00]
Total: 113188 W: 20804 L: 20251 D: 72133
http://tests.stockfishchess.org/tests/view/59b58e4d0ebc5916ff64b12e

LTC:
LLR: 2.95 (-2.94,2.94) [0.00,5.00]
Total: 66673 W: 8672 L: 8341 D: 49660
http://tests.stockfishchess.org/tests/view/59b902580ebc5916ff64b231

This is Alain Savard's idea, just with a different bonus.
Original patch there:

green STC, http://tests.stockfishchess.org/tests/view/597dcd2b0ebc5916ff64a09b
yellow LTC, http://tests.stockfishchess.org/tests/view/597ea69e0ebc5916ff64a0e6

Bench: 6259498
This commit is contained in:
Stéphane Nicolet
2017-09-16 14:07:41 +02:00
committed by Marco Costalba
parent 21926ce2d8
commit 043a469f83
4 changed files with 17 additions and 10 deletions

View File

@@ -31,11 +31,11 @@ namespace {
#define V Value
#define S(mg, eg) make_score(mg, eg)
// Isolated pawn penalty by opposed flag
const Score Isolated[] = { S(27, 30), S(13, 18) };
// Isolated pawn penalty
const Score Isolated = S(13, 18);
// Backward pawn penalty by opposed flag
const Score Backward[] = { S(40, 26), S(24, 12) };
// Backward pawn penalty
const Score Backward = S(24, 12);
// Connected pawn bonus by opposed, phalanx, #support and rank
Score Connected[2][2][3][RANK_NB];
@@ -109,7 +109,7 @@ namespace {
Bitboard ourPawns = pos.pieces( Us, PAWN);
Bitboard theirPawns = pos.pieces(Them, PAWN);
e->passedPawns[Us] = e->pawnAttacksSpan[Us] = 0;
e->passedPawns[Us] = e->pawnAttacksSpan[Us] = e->weakUnopposed[Us] = 0;
e->semiopenFiles[Us] = 0xFF;
e->kingSquares[Us] = SQ_NONE;
e->pawnAttacks[Us] = shift<Right>(ourPawns) | shift<Left>(ourPawns);
@@ -177,10 +177,10 @@ namespace {
score += Connected[opposed][!!phalanx][popcount(supported)][relative_rank(Us, s)];
else if (!neighbours)
score -= Isolated[opposed];
score -= Isolated, e->weakUnopposed[Us] += !opposed;
else if (backward)
score -= Backward[opposed];
score -= Backward, e->weakUnopposed[Us] += !opposed;
if (doubled && !supported)
score -= Doubled;