1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-07-11 19:49:14 +00:00

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 https://github.com/official-stockfish/Stockfish/pull/1839

Bench: 3569243
This commit is contained in:
Kurt 2018-12-13 13:19:55 +01:00 committed by Stéphane Nicolet
parent e917bd59b1
commit 883367d217
2 changed files with 15 additions and 11 deletions

View file

@ -37,15 +37,7 @@ namespace PSQT {
// second half of the files.
constexpr Score Bonus[][RANK_NB][int(FILE_NB) / 2] = {
{ },
{ // Pawn
{ S( 0, 0), S( 0, 0), S( 0, 0), S( 0, 0) },
{ S(-11,-3), S( 7, -1), S( 7, 7), S(17, 2) },
{ S(-16,-2), S( -3, 2), S( 23, 6), S(23,-1) },
{ S(-14, 7), S( -7, -4), S( 20,-8), S(24, 2) },
{ S( -5,13), S( -2, 10), S( -1,-1), S(12,-8) },
{ S(-11,16), S(-12, 6), S( -2, 1), S( 4,16) },
{ S( -2, 1), S( 20,-12), S(-10, 6), S(-2,25) }
},
{ },
{ // Knight
{ S(-169,-105), S(-96,-74), S(-80,-46), S(-79,-18) },
{ 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] = {
}
};
constexpr Score PBonus[RANK_NB][FILE_NB] =
{ // Pawn
{ S( 0, 0), S( 0, 0), S( 0, 0), S( 0, 0), S( 0, 0), S( 0, 0), S( 0, 0), S( 0, 0) },
{ S( 0,-11), S( -3, -4), S( 13, -1), S( 19, -4), S( 16, 17), S( 13, 7), S( 4, 4), S( -4,-13) },
{ S(-16, -8), S(-12, -6), S( 20, -3), S( 21, 0), S( 25,-11), S( 29, 3), S( 0, 0), S(-27, -1) },
{ S(-11, 3), S(-17, 6), S( 11,-10), S( 21, 1), S( 32, -6), S( 19,-11), S( -5, 0), S(-14, -2) },
{ S( 4, 13), S( 6, 7), S( -8, 3), S( 3, -5), S( 8,-15), S( -2, -1), S(-19, 9), S( -5, 13) },
{ S( -5, 25), S(-19, 20), S( 7, 16), S( 8, 12), S( -7, 21), S( -2, 3), S(-10, -4), S(-16, 15) },
{ S(-10, 6), S( 9, -5), S( -7, 16), S(-12, 27), S( -7, 15), S( -8, 11), S( 16, -7), S( -8, 4) }
};
#undef S
Score psq[PIECE_NB][SQUARE_NB];
@ -117,7 +120,8 @@ void init() {
for (Square s = SQ_A1; s <= SQ_H8; ++s)
{
File f = std::min(file_of(s), ~file_of(s));
psq[ pc][ s] = score + Bonus[pc][rank_of(s)][f];
psq[ pc][ s] = score + (type_of(pc) == PAWN ? PBonus[rank_of(s)][file_of(s)]
: Bonus[pc][rank_of(s)][f]);
psq[~pc][~s] = -psq[pc][s];
}
}

View file

@ -448,7 +448,7 @@ void Thread::search() {
{
beta = std::min(bestValue + delta, VALUE_INFINITE);
if (mainThread)
++failedHighCnt;
++failedHighCnt;
}
else
break;