]> git.sesse.net Git - stockfish/commitdiff
Long Diagonal Tweaks
authorRocky640 <support@multicim.com>
Fri, 31 Aug 2018 13:30:16 +0000 (09:30 -0400)
committerStéphane Nicolet <cassio@free.fr>
Sat, 1 Sep 2018 02:33:17 +0000 (04:33 +0200)
a) Reduce PSQT values along the long diagonals on non-central squares
and increase the LongDiagonal bonus accordingly. The effect is to penalise
bishops on the long diagonal which can not "see" the 2 central squares.
The "good" bishops still have more or less the same bonus as current master.

b) For a bishop on a central square, because of the "| s" term in the code,
the LongDiagonalBonus was always given. So while being there, remove the "| s"
and compensate the central Bishop PSQT accordingly.

Passed STC
LLR: 2.95 (-2.94,2.94) [0.00,4.00]
Total: 44498 W: 9658 L: 9323 D: 25517
http://tests.stockfishchess.org/tests/view/5b8992770ebc592cf2748942

Passed LTC
LLR: 2.95 (-2.94,2.94) [0.00,4.00]
Total: 63092 W: 10324 L: 9975 D: 42793
http://tests.stockfishchess.org/tests/view/5b89a17a0ebc592cf2748b59

Closes https://github.com/official-stockfish/Stockfish/pull/1760

bench: 4693901

src/evaluate.cpp
src/psqt.cpp

index ac8bde741a385650f9a8155025fbfd99f03c5746..0021c088c0aa0ef88f6076aa43df9554faa3fa16 100644 (file)
@@ -162,7 +162,7 @@ namespace {
   constexpr Score HinderPassedPawn   = S(  8,  0);
   constexpr Score KingProtector      = S(  6,  6);
   constexpr Score KnightOnQueen      = S( 21, 11);
-  constexpr Score LongDiagonalBishop = S( 22,  0);
+  constexpr Score LongDiagonalBishop = S( 46,  0);
   constexpr Score MinorBehindPawn    = S( 16,  0);
   constexpr Score Overload           = S( 13,  6);
   constexpr Score PawnlessFlank      = S( 19, 84);
@@ -351,7 +351,7 @@ namespace {
                                      * (1 + popcount(blocked & CenterFiles));
 
                 // Bonus for bishop on a long diagonal which can "see" both center squares
-                if (more_than_one(Center & (attacks_bb<BISHOP>(s, pos.pieces(PAWN)) | s)))
+                if (more_than_one(attacks_bb<BISHOP>(s, pos.pieces(PAWN)) & Center))
                     score += LongDiagonalBishop;
             }
 
index f29b9c400f69f954cb73393f6f5eeacbbe87a1b7..8a02bf7293e0039472311d1005621e5beee3d289 100644 (file)
@@ -57,14 +57,14 @@ constexpr Score Bonus[][RANK_NB][int(FILE_NB) / 2] = {
    { S(-195,-109), S(-67,-89), S(-42,-50), S(-29,-13) }
   },
   { // Bishop
-   { S(-44,-58), S(-13,-31), S(-25,-37), S(-34,-19) },
-   { S(-20,-34), S( 20, -9), S( 12,-14), S(  1,  4) },
-   { S( -9,-23), S( 27,  0), S( 21, -3), S( 11, 16) },
-   { S(-11,-26), S( 28, -3), S( 21, -5), S( 10, 16) },
-   { S(-11,-26), S( 27, -4), S( 16, -7), S(  9, 14) },
-   { S(-17,-24), S( 16, -2), S( 12,  0), S(  2, 13) },
-   { S(-23,-34), S( 17,-10), S(  6,-12), S( -2,  6) },
-   { S(-35,-55), S(-11,-32), S(-19,-36), S(-29,-17) }
+   { S(-64,-58), S(-13,-31), S(-25,-37), S(-34,-19) },
+   { S(-20,-34), S(  0, -9), S( 12,-14), S(  1,  4) },
+   { S( -9,-23), S( 27,  0), S(  1, -3), S( 11, 16) },
+   { S(-11,-26), S( 28, -3), S( 21, -5), S( 32, 16) },
+   { S(-11,-26), S( 27, -4), S( 16, -7), S( 31, 14) },
+   { S(-17,-24), S( 16, -2), S( -8,  0), S(  2, 13) },
+   { S(-23,-34), S( -3,-10), S(  6,-12), S( -2,  6) },
+   { S(-55,-55), S(-11,-32), S(-19,-36), S(-29,-17) }
   },
   { // Rook
    { S(-25, 0), S(-16, 0), S(-16, 0), S(-9, 0) },