mirror of
https://github.com/sockspls/badfish
synced 2025-04-30 08:43:09 +00:00
Double pawn simplification
Try doubled pawn simplification, with psq table compensation. STC: LLR: 2.95 (-2.94,2.94) [-3.00,1.00] Total: 36094 W: 6558 L: 6463 D: 23073 LTC: LLR: 2.94 (-2.94,2.94) [-3.00,1.00] Total: 102352 W: 13417 L: 13404 D: 75531 Bench: 8716243
This commit is contained in:
parent
969982406c
commit
16c603ce9b
2 changed files with 10 additions and 13 deletions
|
@ -44,10 +44,8 @@ namespace {
|
||||||
// Connected pawn bonus by opposed, phalanx, twice supported and rank
|
// Connected pawn bonus by opposed, phalanx, twice supported and rank
|
||||||
Score Connected[2][2][2][RANK_NB];
|
Score Connected[2][2][2][RANK_NB];
|
||||||
|
|
||||||
// Doubled pawn penalty by file
|
// Doubled pawn penalty
|
||||||
const Score Doubled[FILE_NB] = {
|
const Score Doubled = S(18,38);
|
||||||
S(11, 34), S(17, 38), S(19, 38), S(19, 38),
|
|
||||||
S(19, 38), S(19, 38), S(17, 38), S(11, 34) };
|
|
||||||
|
|
||||||
// Lever bonus by rank
|
// Lever bonus by rank
|
||||||
const Score Lever[RANK_NB] = {
|
const Score Lever[RANK_NB] = {
|
||||||
|
@ -145,7 +143,7 @@ namespace {
|
||||||
// either there is a stopper in the way on this rank, or there is a
|
// either there is a stopper in the way on this rank, or there is a
|
||||||
// stopper on adjacent file which controls the way to that rank.
|
// stopper on adjacent file which controls the way to that rank.
|
||||||
backward = (b | shift_bb<Up>(b & adjacent_files_bb(f))) & stoppers;
|
backward = (b | shift_bb<Up>(b & adjacent_files_bb(f))) & stoppers;
|
||||||
|
|
||||||
assert(!backward || !(pawn_attack_span(Them, s + Up) & neighbours));
|
assert(!backward || !(pawn_attack_span(Them, s + Up) & neighbours));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -169,7 +167,7 @@ namespace {
|
||||||
score += Connected[opposed][!!phalanx][more_than_one(supported)][relative_rank(Us, s)];
|
score += Connected[opposed][!!phalanx][more_than_one(supported)][relative_rank(Us, s)];
|
||||||
|
|
||||||
if (doubled)
|
if (doubled)
|
||||||
score -= Doubled[f] / distance<Rank>(s, frontmost_sq(Us, doubled));
|
score -= Doubled / distance<Rank>(s, frontmost_sq(Us, doubled));
|
||||||
|
|
||||||
if (lever)
|
if (lever)
|
||||||
score += Lever[relative_rank(Us, s)];
|
score += Lever[relative_rank(Us, s)];
|
||||||
|
|
13
src/psqt.cpp
13
src/psqt.cpp
|
@ -38,13 +38,12 @@ const Score Bonus[][RANK_NB][int(FILE_NB) / 2] = {
|
||||||
{ },
|
{ },
|
||||||
{ // Pawn
|
{ // Pawn
|
||||||
{ S( 0, 0), S( 0, 0), S( 0, 0), S( 0, 0) },
|
{ S( 0, 0), S( 0, 0), S( 0, 0), S( 0, 0) },
|
||||||
{ S(-19, 5), S( 1,-4), S( 7, 8), S( 3,-2) },
|
{ S(-16, 7), S( 1,-4), S( 7, 8), S( 3,-2) },
|
||||||
{ S(-26,-6), S( -7,-5), S( 19, 5), S(24, 4) },
|
{ S(-23,-4), S( -7,-5), S( 19, 5), S(24, 4) },
|
||||||
{ S(-25, 1), S(-14, 3), S( 20,-8), S(35,-3) },
|
{ S(-22, 3), S(-14, 3), S( 20,-8), S(35,-3) },
|
||||||
{ S(-14, 6), S( 0, 9), S( 3, 7), S(21,-6) },
|
{ S(-11, 8), S( 0, 9), S( 3, 7), S(21,-6) },
|
||||||
{ S(-14, 6), S(-13,-5), S( -6, 2), S(-2, 4) },
|
{ S(-11, 8), S(-13,-5), S( -6, 2), S(-2, 4) },
|
||||||
{ S(-12, 1), S( 15,-9), S( -8, 1), S(-4,18) },
|
{ S( -9, 3), S( 15,-9), S( -8, 1), S(-4,18) }
|
||||||
{ S( 0, 0), S( 0, 0), S( 0, 0), S( 0, 0) }
|
|
||||||
},
|
},
|
||||||
{ // Knight
|
{ // Knight
|
||||||
{ S(-143, -97), S(-96,-82), S(-80,-46), S(-73,-14) },
|
{ S(-143, -97), S(-96,-82), S(-80,-46), S(-73,-14) },
|
||||||
|
|
Loading…
Add table
Reference in a new issue