Skip to content

Commit 759d129

Browse files
Mark Tenzersnicolet
authored andcommitted
Introduce Overload
This patch applies a S(10, 5) bonus for every square that is: - Occupied by an enemy piece which is not a pawn - Attacked exactly once by our pieces - Defended exactly once by enemy pieces The idea is that these pieces must be defended. Their defenders have dramatically limited mobility, and they are vulnerable to our future attack. As with connectivity, there are probably many more tests to be run in this area. In particular: - I believe @snicolet's queen overload tests have demonstrated a potential need for a queen overload bonus above and beyond this one; however, the conditions for "overload" in this patch are different (excluding pieces we attack twice). My next test after this is (hopefully) merged will be to intersect the Bitboard I define here with the enemy's queen attacks and attempt to give additional bonus. - Perhaps we should exclude pieces attacked by pawns--can pawns really be overloaded? Should they have the same weight, or less? This didn't work with a previous version, but it could work with this one. - More generally, different pieces may need more or less bonus. We could change bonuses based on what type of enemy piece is being overloaded, what type of friendly piece is attacking, and/or what type of piece is being defended by the overloaded piece and attacked by us, or any intersection of these three. For example, here attacked/defended pawns are excluded, but they're not totally worthless targets, and could be added again with a smaller bonus. - This list is by no means exhaustive. STC: LLR: 2.96 (-2.94,2.94) [0.00,5.00] Total: 17439 W: 3599 L: 3390 D: 10450 http://tests.stockfishchess.org/tests/view/5ac78a2e0ebc59435923735e LTC: LLR: 2.95 (-2.94,2.94) [0.00,5.00] Total: 43304 W: 6533 L: 6256 D: 30515 http://tests.stockfishchess.org/tests/view/5ac7a1d80ebc59435923736f Closes #1533 Bench: 5248871 ---------------- This is my first time opening a PR, so I apologize if there are errors. There are too many people to thank since I submitted my first test just over a month ago. Thank you all for the warm welcome and here is to more green patches! In particular, I would like to thank: - @crossbr, whose comment in a FishCooking thread first inspired me to consider the overloading of pieces other than queens, - @snicolet, whose queen overload tests inspired this one and served as the base of my first overload attempts, - @protonspring, whose connectivity tests inspired this one and who provided much of the feedback needed to take this from red to green, - @vondele, who kindly corrected me when I submitted a bad LTC test, - @Rocky640, who has helped me over and over again in the past month. Thank you all!
1 parent 04a228f commit 759d129

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

AUTHORS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ Lucas Braesch (lucasart)
7777
Lyudmil Antonov (lantonov)
7878
Matthew Lai (matthewlai)
7979
Matthew Sullivan
80+
Mark Tenzer (31m059)
8081
Michael Byrne (MichaelB7)
8182
Michael Stembera (mstembera)
8283
Michel Van den Bergh (vdbergh)

src/evaluate.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,7 @@ namespace {
171171
constexpr Score KnightOnQueen = S( 21, 11);
172172
constexpr Score LongDiagonalBishop = S( 22, 0);
173173
constexpr Score MinorBehindPawn = S( 16, 0);
174+
constexpr Score Overload = S( 10, 5);
174175
constexpr Score PawnlessFlank = S( 20, 80);
175176
constexpr Score RookOnPawn = S( 8, 24);
176177
constexpr Score SliderOnQueen = S( 42, 21);
@@ -520,7 +521,7 @@ namespace {
520521
Bitboard b, weak, defended, nonPawnEnemies, stronglyProtected, safeThreats;
521522
Score score = SCORE_ZERO;
522523

523-
// Non-pawn enemies attacked by a pawn
524+
// Non-pawn enemies
524525
nonPawnEnemies = pos.pieces(Them) ^ pos.pieces(Them, PAWN);
525526

526527
// Our safe or protected pawns
@@ -608,6 +609,12 @@ namespace {
608609
b = (pos.pieces(Us) ^ pos.pieces(Us, PAWN, KING)) & attackedBy[Us][ALL_PIECES];
609610
score += Connectivity * popcount(b);
610611

612+
// Bonus for overload (non-pawn enemies attacked and defended exactly once)
613+
b = nonPawnEnemies
614+
& attackedBy[Us][ALL_PIECES] & ~attackedBy2[Us]
615+
& attackedBy[Them][ALL_PIECES] & ~attackedBy2[Them];
616+
score += Overload * popcount(b);
617+
611618
if (T)
612619
Trace::add(THREAT, Us, score);
613620

0 commit comments

Comments
 (0)