Skip to content

Commit 37698b0

Browse files
Rocky640snicolet
authored andcommitted
Outpost Endgame values
Remove the recent rank based Outpost array by using a weighted average value computed using a frequency analysis by rank from a large set of middle game positions. The higher eg values introduced by the new Outpost array (which were about twice the previous masters) are thus preserved. STC http://tests.stockfishchess.org/tests/view/5dd05c870ebc5902579e1f7f LLR: 2.96 (-2.94,2.94) [-3.00,1.00] Total: 42466 W: 9232 L: 9151 D: 24083 LTC http://tests.stockfishchess.org/tests/view/5dd146e342928ff08153dab1 LLR: 2.95 (-2.94,2.94) [-3.00,1.00] Total: 66968 W: 10921 L: 10873 D: 45174 Closes #2418 Bench: 5103360
1 parent e0f42aa commit 37698b0

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

src/evaluate.cpp

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -126,11 +126,6 @@ namespace {
126126
S(0, 0), S(10, 28), S(17, 33), S(15, 41), S(62, 72), S(168, 177), S(276, 260)
127127
};
128128

129-
// OutpostRank[Rank] contains a bonus according to the rank of the outpost
130-
constexpr Score OutpostRank[RANK_NB] = {
131-
S(0, 0), S(0, 0), S(0, 0), S(28, 18), S(30, 24), S(32, 19)
132-
};
133-
134129
// Assorted bonuses and penalties
135130
constexpr Score BishopPawns = S( 3, 7);
136131
constexpr Score CorneredBishop = S( 50, 50);
@@ -140,10 +135,11 @@ namespace {
140135
constexpr Score KnightOnQueen = S( 16, 12);
141136
constexpr Score LongDiagonalBishop = S( 45, 0);
142137
constexpr Score MinorBehindPawn = S( 18, 3);
143-
constexpr Score Outpost = S( 32, 10);
138+
constexpr Score Outpost = S( 30, 21);
144139
constexpr Score PassedFile = S( 11, 8);
145140
constexpr Score PawnlessFlank = S( 17, 95);
146141
constexpr Score RestrictedPiece = S( 7, 7);
142+
constexpr Score ReachableOutpost = S( 32, 10);
147143
constexpr Score RookOnQueenFile = S( 7, 6);
148144
constexpr Score SliderOnQueen = S( 59, 18);
149145
constexpr Score ThreatByKing = S( 24, 89);
@@ -242,7 +238,7 @@ namespace {
242238
// Init our king safety tables
243239
Square s = make_square(clamp(file_of(ksq), FILE_B, FILE_G),
244240
clamp(rank_of(ksq), RANK_2, RANK_7));
245-
kingRing[Us] = s | PseudoAttacks[KING][s];
241+
kingRing[Us] = PseudoAttacks[KING][s] | s;
246242

247243
kingAttackersCount[Them] = popcount(kingRing[Us] & pe->pawn_attacks(Them));
248244
kingAttacksCount[Them] = kingAttackersWeight[Them] = 0;
@@ -296,11 +292,11 @@ namespace {
296292
{
297293
// Bonus if piece is on an outpost square or can reach one
298294
bb = OutpostRanks & attackedBy[Us][PAWN] & ~pe->pawn_attacks_span(Them);
299-
if (s & bb)
300-
score += OutpostRank[relative_rank(Us, s)] * (Pt == KNIGHT ? 2 : 1);
295+
if (bb & s)
296+
score += Outpost * (Pt == KNIGHT ? 2 : 1);
301297

302298
else if (Pt == KNIGHT && bb & b & ~pos.pieces(Us))
303-
score += Outpost;
299+
score += ReachableOutpost;
304300

305301
// Knight and Bishop bonus for being right behind a pawn
306302
if (shift<Down>(pos.pieces(PAWN)) & s)

0 commit comments

Comments
 (0)