Skip to content

Commit 883367d

Browse files
Kurtbuschsnicolet
authored andcommitted
Asymmetrical 8x8 Pawn PSQT
STC: LLR: 2.96 (-2.94,2.94) [0.00,5.00] Total: 13323 W: 3015 L: 2818 D: 7490 http://tests.stockfishchess.org/tests/view/5c00a2520ebc5902bcedd41b LTC: LLR: 2.96 (-2.94,2.94) [0.00,5.00] Total: 52294 W: 9093 L: 8756 D:34445 http://tests.stockfishchess.org/tests/view/5c00b2c40ebc5902bcedd596 Some obvious followups to this are to further tune this PSQT, or try 8x8 for other pieces. As of now I don't plan on trying this for other pieces as I think the majority of the ELO it brings is for pawns and kings. Looking at the new values, the differences between kingside and queenside are quite significant. I am very hopeful that this a llows SF to understand and plan pawn structures even better than it already does. Cheers! Closes #1839 Bench: 3569243
1 parent e917bd5 commit 883367d

File tree

2 files changed

+15
-11
lines changed

2 files changed

+15
-11
lines changed

src/psqt.cpp

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,15 +37,7 @@ namespace PSQT {
3737
// second half of the files.
3838
constexpr Score Bonus[][RANK_NB][int(FILE_NB) / 2] = {
3939
{ },
40-
{ // Pawn
41-
{ S( 0, 0), S( 0, 0), S( 0, 0), S( 0, 0) },
42-
{ S(-11,-3), S( 7, -1), S( 7, 7), S(17, 2) },
43-
{ S(-16,-2), S( -3, 2), S( 23, 6), S(23,-1) },
44-
{ S(-14, 7), S( -7, -4), S( 20,-8), S(24, 2) },
45-
{ S( -5,13), S( -2, 10), S( -1,-1), S(12,-8) },
46-
{ S(-11,16), S(-12, 6), S( -2, 1), S( 4,16) },
47-
{ S( -2, 1), S( 20,-12), S(-10, 6), S(-2,25) }
48-
},
40+
{ },
4941
{ // Knight
5042
{ S(-169,-105), S(-96,-74), S(-80,-46), S(-79,-18) },
5143
{ S( -79, -70), S(-39,-56), S(-24,-15), S( -9, 6) },
@@ -98,6 +90,17 @@ constexpr Score Bonus[][RANK_NB][int(FILE_NB) / 2] = {
9890
}
9991
};
10092

93+
constexpr Score PBonus[RANK_NB][FILE_NB] =
94+
{ // Pawn
95+
{ S( 0, 0), S( 0, 0), S( 0, 0), S( 0, 0), S( 0, 0), S( 0, 0), S( 0, 0), S( 0, 0) },
96+
{ S( 0,-11), S( -3, -4), S( 13, -1), S( 19, -4), S( 16, 17), S( 13, 7), S( 4, 4), S( -4,-13) },
97+
{ S(-16, -8), S(-12, -6), S( 20, -3), S( 21, 0), S( 25,-11), S( 29, 3), S( 0, 0), S(-27, -1) },
98+
{ S(-11, 3), S(-17, 6), S( 11,-10), S( 21, 1), S( 32, -6), S( 19,-11), S( -5, 0), S(-14, -2) },
99+
{ S( 4, 13), S( 6, 7), S( -8, 3), S( 3, -5), S( 8,-15), S( -2, -1), S(-19, 9), S( -5, 13) },
100+
{ S( -5, 25), S(-19, 20), S( 7, 16), S( 8, 12), S( -7, 21), S( -2, 3), S(-10, -4), S(-16, 15) },
101+
{ S(-10, 6), S( 9, -5), S( -7, 16), S(-12, 27), S( -7, 15), S( -8, 11), S( 16, -7), S( -8, 4) }
102+
};
103+
101104
#undef S
102105

103106
Score psq[PIECE_NB][SQUARE_NB];
@@ -117,7 +120,8 @@ void init() {
117120
for (Square s = SQ_A1; s <= SQ_H8; ++s)
118121
{
119122
File f = std::min(file_of(s), ~file_of(s));
120-
psq[ pc][ s] = score + Bonus[pc][rank_of(s)][f];
123+
psq[ pc][ s] = score + (type_of(pc) == PAWN ? PBonus[rank_of(s)][file_of(s)]
124+
: Bonus[pc][rank_of(s)][f]);
121125
psq[~pc][~s] = -psq[pc][s];
122126
}
123127
}

src/search.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -448,7 +448,7 @@ void Thread::search() {
448448
{
449449
beta = std::min(bestValue + delta, VALUE_INFINITE);
450450
if (mainThread)
451-
++failedHighCnt;
451+
++failedHighCnt;
452452
}
453453
else
454454
break;

0 commit comments

Comments
 (0)