From f923dc0fe5ec831c8cb682e1a856122c8964519f Mon Sep 17 00:00:00 2001 From: Rocky640 Date: Fri, 31 Aug 2018 09:30:16 -0400 Subject: [PATCH 1/1] Long Diagonal Tweaks 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 | 4 ++-- src/psqt.cpp | 16 ++++++++-------- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/src/evaluate.cpp b/src/evaluate.cpp index ac8bde74..0021c088 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -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(s, pos.pieces(PAWN)) | s))) + if (more_than_one(attacks_bb(s, pos.pieces(PAWN)) & Center)) score += LongDiagonalBishop; } diff --git a/src/psqt.cpp b/src/psqt.cpp index f29b9c40..8a02bf72 100644 --- a/src/psqt.cpp +++ b/src/psqt.cpp @@ -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) }, -- 2.39.2