1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-04-30 16:53:09 +00:00

Simplify connected #2114

This is a functional simplification that simplifies
some of the math for connected pawns. The bench is
different because I moved a /2 from opposed into
the connected array.

STC
LLR: 2.95 (-2.94,2.94) [-3.00,1.00]
Total: 37954 W: 8504 L: 8415 D: 21035
http://tests.stockfishchess.org/tests/view/5cbf599a0ebc5925cf028156

LTC
LLR: 2.96 (-2.94,2.94) [-3.00,1.00]
Total: 27780 W: 4682 L: 4572 D: 18526
http://tests.stockfishchess.org/tests/view/5cbf6a5e0ebc5925cf0284b8

Bench 3824325
This commit is contained in:
protonspring 2019-04-23 12:26:58 -06:00 committed by Marco Costalba
parent 2d9fac1e13
commit 4fcd78bd06

View file

@ -37,7 +37,7 @@ namespace {
constexpr Score Isolated = S( 5, 15); constexpr Score Isolated = S( 5, 15);
// Connected pawn bonus // Connected pawn bonus
constexpr int Connected[RANK_NB] = { 0, 13, 17, 24, 59, 96, 171 }; constexpr int Connected[RANK_NB] = { 0, 7, 8, 12, 29, 48, 86 };
// Strength of pawn shelter for our king by [distance from edge][rank]. // Strength of pawn shelter for our king by [distance from edge][rank].
// RANK_1 = 0 is used for files where we have no pawn, or pawn is behind our king. // RANK_1 = 0 is used for files where we have no pawn, or pawn is behind our king.
@ -126,8 +126,9 @@ namespace {
// Score this pawn // Score this pawn
if (support | phalanx) if (support | phalanx)
{ {
int v = (phalanx ? 3 : 2) * Connected[r]; int v = Connected[r] * (phalanx ? 3 : 2) / (opposed ? 2 : 1)
v = 17 * popcount(support) + (v >> (opposed + 1)); + 17 * popcount(support);
score += make_score(v, v * (r - 2) / 4); score += make_score(v, v * (r - 2) / 4);
} }
else if (!neighbours) else if (!neighbours)