]> git.sesse.net Git - stockfish/commitdiff
Asymmetrical 8x8 Pawn PSQT
authorKurt <yoshi2jared@gmail.com>
Thu, 13 Dec 2018 12:19:55 +0000 (13:19 +0100)
committerStéphane Nicolet <cassio@free.fr>
Thu, 13 Dec 2018 12:20:31 +0000 (13:20 +0100)
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

src/psqt.cpp
src/search.cpp

index 4703da35c8b754d237b47d562c44c7747127751f..9f54069f80af14907e8a1ff87c98c3c233aa9578 100644 (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] =\r
+  { // Pawn\r
+   { S(  0,  0), S(  0,  0), S(  0,  0), S(  0,  0), S(  0,  0), S(  0,  0), S(  0,  0), S(  0,  0) },\r
+   { S(  0,-11), S( -3, -4), S( 13, -1), S( 19, -4), S( 16, 17), S( 13,  7), S(  4,  4), S( -4,-13) },\r
+   { S(-16, -8), S(-12, -6), S( 20, -3), S( 21,  0), S( 25,-11), S( 29,  3), S(  0,  0), S(-27, -1) },\r
+   { S(-11,  3), S(-17,  6), S( 11,-10), S( 21,  1), S( 32, -6), S( 19,-11), S( -5,  0), S(-14, -2) },\r
+   { S(  4, 13), S(  6,  7), S( -8,  3), S(  3, -5), S(  8,-15), S( -2, -1), S(-19,  9), S( -5, 13) },\r
+   { S( -5, 25), S(-19, 20), S(  7, 16), S(  8, 12), S( -7, 21), S( -2,  3), S(-10, -4), S(-16, 15) },\r
+   { S(-10,  6), S(  9, -5), S( -7, 16), S(-12, 27), S( -7, 15), S( -8, 11), S( 16, -7), S( -8,  4) }\r
+  };
+
 #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];
       }
   }
index 6c16aca8ba9fc5db0ae8980006f40784bc4da6a5..a26a9ab8cbc1092d8a34171cc7a5765a2aaf0c48 100644 (file)
@@ -448,7 +448,7 @@ void Thread::search() {
               {
                   beta = std::min(bestValue + delta, VALUE_INFINITE);
                   if (mainThread)
-                         ++failedHighCnt;
+                      ++failedHighCnt;
               }
               else
                   break;