mirror of
https://github.com/sockspls/badfish
synced 2025-05-01 09:13:08 +00:00
Fix doubled pawns asymmetry
When evaluating double pawns we use always lsb() to extract the frontmost square. This breaks evaluation color symmetry as is possible to verify with an instrumented evaluate() Value evaluate(const Position& pos) { Value v = do_evaluate<false>(pos); Position p = pos; p.flip(); assert(v == do_evaluate<false>(p)); return v; } Passed no regression test: STC LLR: 2.96 (-2.94,2.94) [-3.00,1.00] Total: 21035 W: 4244 L: 4122 D: 12669 LTC LLR: 2.95 (-2.94,2.94) [-3.00,1.00] Total: 39839 W: 6662 L: 6572 D: 26605 bench: 8255966
This commit is contained in:
parent
79232be02a
commit
84408e5cd6
1 changed files with 1 additions and 1 deletions
|
@ -165,7 +165,7 @@ namespace {
|
|||
value -= UnsupportedPawnPenalty;
|
||||
|
||||
if (doubled)
|
||||
value -= Doubled[f] / distance<Rank>(s, Square(lsb(doubled)));
|
||||
value -= Doubled[f] / distance<Rank>(s, frontmost_sq(Us, doubled));
|
||||
|
||||
if (backward)
|
||||
value -= Backward[opposed][f];
|
||||
|
|
Loading…
Add table
Reference in a new issue