mirror of
https://github.com/sockspls/badfish
synced 2025-05-01 01:03:09 +00:00
Further improve chain pawn evaluation
Passed both short TC: LLR: 2.96 (-2.94,2.94) [-1.50,4.50] Total: 28299 W: 5854 L: 5667 D: 16778 And long TC: LLR: 2.96 (-2.94,2.94) [0.00,6.00] Total: 9738 W: 1797 L: 1644 D: 6297 bench: 9294116
This commit is contained in:
parent
f22a63ce67
commit
97015afce8
1 changed files with 14 additions and 6 deletions
|
@ -52,9 +52,15 @@ namespace {
|
||||||
S(33, 31), S(33, 31), S(29, 31), S(20, 28) }};
|
S(33, 31), S(33, 31), S(29, 31), S(20, 28) }};
|
||||||
|
|
||||||
// Pawn chain membership bonus by file
|
// Pawn chain membership bonus by file
|
||||||
const Score ChainMember[FILE_NB] = {
|
const Score ChainMember[FILE_NB][RANK_NB] = {
|
||||||
S(11,-1), S(13,-1), S(13,-1), S(14,-1),
|
{ S(0, 0), S(14, 0), S(16, 4), S(18, 9), S(56, 56), S(104, 208), S(236, 472) },
|
||||||
S(14,-1), S(13,-1), S(13,-1), S(11,-1)
|
{ S(0, 0), S(16, 0), S(18, 5), S(20, 10), S(60, 60), S(108, 216), S(240, 480) },
|
||||||
|
{ S(0, 0), S(16, 0), S(18, 5), S(20, 10), S(60, 60), S(108, 216), S(240, 480) },
|
||||||
|
{ S(0, 0), S(17, 0), S(19, 6), S(22, 11), S(66, 66), S(118, 236), S(254, 508) },
|
||||||
|
{ S(0, 0), S(17, 0), S(19, 6), S(22, 11), S(66, 66), S(118, 236), S(254, 508) },
|
||||||
|
{ S(0, 0), S(16, 0), S(18, 5), S(20, 10), S(60, 60), S(108, 216), S(240, 480) },
|
||||||
|
{ S(0, 0), S(16, 0), S(18, 5), S(20, 10), S(60, 60), S(108, 216), S(240, 480) },
|
||||||
|
{ S(0, 0), S(14, 0), S(16, 4), S(18, 9), S(56, 56), S(104, 208), S(236, 472) }
|
||||||
};
|
};
|
||||||
|
|
||||||
// Candidate passed pawn bonus by rank
|
// Candidate passed pawn bonus by rank
|
||||||
|
@ -92,6 +98,7 @@ namespace {
|
||||||
Bitboard b;
|
Bitboard b;
|
||||||
Square s;
|
Square s;
|
||||||
File f;
|
File f;
|
||||||
|
Rank r;
|
||||||
bool passed, isolated, doubled, opposed, chain, backward, candidate;
|
bool passed, isolated, doubled, opposed, chain, backward, candidate;
|
||||||
Score value = SCORE_ZERO;
|
Score value = SCORE_ZERO;
|
||||||
const Square* pl = pos.list<PAWN>(Us);
|
const Square* pl = pos.list<PAWN>(Us);
|
||||||
|
@ -112,6 +119,7 @@ namespace {
|
||||||
assert(pos.piece_on(s) == make_piece(Us, PAWN));
|
assert(pos.piece_on(s) == make_piece(Us, PAWN));
|
||||||
|
|
||||||
f = file_of(s);
|
f = file_of(s);
|
||||||
|
r = relative_rank(Us, s);
|
||||||
|
|
||||||
// This file cannot be semi-open
|
// This file cannot be semi-open
|
||||||
e->semiopenFiles[Us] &= ~(1 << f);
|
e->semiopenFiles[Us] &= ~(1 << f);
|
||||||
|
@ -176,11 +184,11 @@ namespace {
|
||||||
value -= Backward[opposed][f];
|
value -= Backward[opposed][f];
|
||||||
|
|
||||||
if (chain)
|
if (chain)
|
||||||
value += ChainMember[f] + CandidatePassed[relative_rank(Us, s)] / 2;
|
value += opposed ? ChainMember[f][r] / 2 : ChainMember[f][r];
|
||||||
|
|
||||||
if (candidate)
|
if (candidate)
|
||||||
{
|
{
|
||||||
value += CandidatePassed[relative_rank(Us, s)];
|
value += CandidatePassed[r];
|
||||||
|
|
||||||
if (!doubled)
|
if (!doubled)
|
||||||
e->candidatePawns[Us] |= s;
|
e->candidatePawns[Us] |= s;
|
||||||
|
|
Loading…
Add table
Reference in a new issue