Skip to content

Commit efd4ca2

Browse files
candirufishsnicolet
authored andcommitted
Another set of tuned values after one million games
Another set of tuned values, obtained by a long session of one million games. STC: LLR: 2.95 (-2.94,2.94) [0.00,4.00] Total: 15810 W: 3687 L: 3458 D: 8665 http://tests.stockfishchess.org/tests/view/5b2d32f60ebc5902b2e55d9e LTC: LLR: 2.95 (-2.94,2.94) [0.00,4.00] Total: 102118 W: 18146 L: 17651 D: 66321 http://tests.stockfishchess.org/tests/view/5b2d372c0ebc5902b2e55e0a Closes #1658 Bench: 4557946
1 parent 34321fc commit efd4ca2

File tree

2 files changed

+27
-26
lines changed

2 files changed

+27
-26
lines changed

src/evaluate.cpp

Lines changed: 15 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -142,32 +142,32 @@ namespace {
142142

143143
// ThreatByKing[on one/on many] contains bonuses for king attacks on
144144
// pawns or pieces which are not pawn-defended.
145-
constexpr Score ThreatByKing[] = { S(25, 57), S(4, 139) };
145+
constexpr Score ThreatByKing[] = { S(30, 62), S(-9, 160) };
146146

147147
// PassedRank[Rank] contains a bonus according to the rank of a passed pawn
148148
constexpr Score PassedRank[RANK_NB] = {
149-
S(0, 0), S(7, 10), S(7, 26), S(14, 31), S(42, 63), S(178, 167), S(279, 244)
149+
S(0, 0), S(4, 17), S(7, 20), S(14, 36), S(42, 62), S(165, 171), S(279, 252)
150150
};
151151

152152
// PassedFile[File] contains a bonus according to the file of a passed pawn
153153
constexpr Score PassedFile[FILE_NB] = {
154-
S( 17, 6), S(-4, 7), S( 2,-12), S(-17,-14),
155-
S(-17,-14), S( 2,-12), S(-4, 7), S( 17, 6)
154+
S( 11, 14), S( 0, -5), S(-2, -8), S(-25,-13),
155+
S(-25,-13), S(-2, -8), S( 0, -5), S( 11, 14)
156156
};
157157

158158
// PassedDanger[Rank] contains a term to weight the passed score
159-
constexpr int PassedDanger[RANK_NB] = { 0, 0, 0, 3, 6, 12, 21 };
159+
constexpr int PassedDanger[RANK_NB] = { 0, 0, 0, 2, 7, 12, 19 };
160160

161161
// KingProtector[PieceType-2] contains a penalty according to distance from king
162-
constexpr Score KingProtector[] = { S(3, 5), S(5, 3), S(3, 0), S(0, -2) };
162+
constexpr Score KingProtector[] = { S(4, 6), S(6, 3), S(1, 0), S(0, -2) };
163163

164164
// Assorted bonuses and penalties
165165
constexpr Score BishopPawns = S( 3, 5);
166166
constexpr Score CloseEnemies = S( 8, 0);
167167
constexpr Score Connectivity = S( 3, 1);
168168
constexpr Score CorneredBishop = S( 50, 50);
169169
constexpr Score Hanging = S( 52, 30);
170-
constexpr Score HinderPassedPawn = S( 5, 2);
170+
constexpr Score HinderPassedPawn = S( 5, -1);
171171
constexpr Score KnightOnQueen = S( 21, 11);
172172
constexpr Score LongDiagonalBishop = S( 22, 0);
173173
constexpr Score MinorBehindPawn = S( 16, 0);
@@ -177,10 +177,10 @@ namespace {
177177
constexpr Score SliderOnQueen = S( 42, 21);
178178
constexpr Score ThreatByPawnPush = S( 49, 30);
179179
constexpr Score ThreatByRank = S( 16, 3);
180-
constexpr Score ThreatBySafePawn = S(186,140);
180+
constexpr Score ThreatBySafePawn = S(165,133);
181181
constexpr Score TrappedRook = S( 92, 0);
182182
constexpr Score WeakQueen = S( 50, 10);
183-
constexpr Score WeakUnopposedPawn = S( 14, 19);
183+
constexpr Score WeakUnopposedPawn = S( 5, 26);
184184

185185
#undef S
186186

@@ -428,7 +428,7 @@ namespace {
428428
// Main king safety evaluation
429429
if (kingAttackersCount[Them] > 1 - pos.count<QUEEN>(Them))
430430
{
431-
int kingDanger = -mg_value(score);
431+
int kingDanger = 0;
432432
unsafeChecks = 0;
433433

434434
// Attacked squares defended at most once by our queen or king
@@ -475,10 +475,11 @@ namespace {
475475

476476
kingDanger += kingAttackersCount[Them] * kingAttackersWeight[Them]
477477
+ 64 * kingAttacksCount[Them]
478-
+ 182 * popcount(kingRing[Us] & weak)
479-
+ 128 * popcount(pos.blockers_for_king(Us) | unsafeChecks)
480-
- 857 * !pos.count<QUEEN>(Them)
481-
+ 31 ;
478+
+ 183 * popcount(kingRing[Us] & weak)
479+
+ 122 * popcount(pos.blockers_for_king(Us) | unsafeChecks)
480+
- 860 * !pos.count<QUEEN>(Them)
481+
- 7 * mg_value(score) / 8
482+
+ 17 ;
482483

483484
// Transform the kingDanger units into a Score, and subtract it from the evaluation
484485
if (kingDanger > 0)

src/pawns.cpp

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -32,35 +32,35 @@ namespace {
3232
#define S(mg, eg) make_score(mg, eg)
3333

3434
// Pawn penalties
35-
constexpr Score Isolated = S( 6, 16);
36-
constexpr Score Backward = S(15, 21);
37-
constexpr Score Doubled = S( 8, 44);
35+
constexpr Score Isolated = S( 4, 20);
36+
constexpr Score Backward = S(21, 22);
37+
constexpr Score Doubled = S(12, 54);
3838

3939
// Connected pawn bonus by opposed, phalanx, #support and rank
4040
Score Connected[2][2][3][RANK_NB];
4141

4242
// Strength of pawn shelter for our king by [distance from edge][rank].
4343
// RANK_1 = 0 is used for files where we have no pawn, or pawn is behind our king.
4444
constexpr Value ShelterStrength[int(FILE_NB) / 2][RANK_NB] = {
45-
{ V( 28), V(79), V( 75), V( 46), V( 14), V( 31), V(-14) },
46-
{ V(-48), V(50), V( 29), V(-21), V(-41), V(-23), V(-45) },
47-
{ V(-25), V(50), V( 17), V(-33), V( -5), V( 9), V(-35) },
48-
{ V(-29), V(57), V(-25), V(-48), V( -4), V(-46), V(-64) }
45+
{ V( 16), V(82), V( 83), V( 47), V( 19), V( 44), V( 4) },
46+
{ V(-51), V(56), V( 33), V(-58), V(-57), V(-50), V(-39) },
47+
{ V(-20), V(71), V( 16), V(-10), V( 13), V( 19), V(-30) },
48+
{ V(-29), V(12), V(-21), V(-40), V(-15), V(-77), V(-91) }
4949
};
5050

5151
// Danger of enemy pawns moving toward our king by [distance from edge][rank].
5252
// RANK_1 = 0 is used for files where the enemy has no pawn, or their pawn
5353
// is behind our king.
5454
constexpr Value UnblockedStorm[int(FILE_NB) / 2][RANK_NB] = {
55-
{ V( 34), V( 58), V(113), V( 61), V(37), V( 24), V( 21) },
56-
{ V( 23), V( 46), V( 93), V( 10), V( 2), V(-20), V( 6) },
57-
{ V( -6), V( 22), V(106), V( 28), V( 6), V(-33), V( -1) },
58-
{ V(-17), V( 33), V( 71), V( 14), V(-9), V(-21), V(-16) }
55+
{ V(54), V( 48), V( 99), V(91), V(42), V( 32), V( 31) },
56+
{ V(34), V( 27), V(105), V(38), V(32), V(-19), V( 3) },
57+
{ V(-4), V( 28), V( 87), V(18), V(-3), V(-14), V(-11) },
58+
{ V(-5), V( 22), V( 75), V(14), V( 2), V( -5), V(-19) }
5959
};
6060

6161
// Danger of blocked enemy pawns storming our king, by rank
6262
constexpr Value BlockedStorm[RANK_NB] =
63-
{ V(0), V(0), V( 58), V(-13), V(-22), V(-3), V(-5) };
63+
{ V(0), V(0), V( 81), V(-9), V(-5), V(-1), V(26) };
6464

6565
#undef S
6666
#undef V

0 commit comments

Comments
 (0)