mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-24 02:57:11 +08:00
Rewrite unstoppable pawns evaluation
Instead of current code, give a bonus according to the frontmost square among candidate + passed pawns. This is a big simplification that removes a lot of accurate code substituting it with a statistically based one using the common 'bonus' scheme, leaving to the search to sort out the details. Results are equivalent but code is much less and, as an added bonus, we now store candidates bitboard in pawns hash and allow this info to be used in evaluation. This paves the way to possible candidate pawns evaluations together with all the other pieces, as we do for passed. Patch passed short TC LLR: 2.96 (-2.94,2.94) [-1.50,4.50] Total: 16927 W: 3462 L: 3308 D: 10157 Then failed (quite quickly) at long TC LLR: -2.95 (-2.94,2.94) [0.00,6.00] Total: 8451 W: 1386 L: 1448 D: 5617 But when ran with a conclusive 40K fixed games at 60 secs it proved almost equivalent to original one. ELO: 1.08 +-2.0 (95%) LOS: 85.8% Total: 40000 W: 6739 L: 6615 D: 26646 bench: 3884003
This commit is contained in:
@@ -99,7 +99,7 @@ namespace {
|
||||
Bitboard ourPawns = pos.pieces(Us, PAWN);
|
||||
Bitboard theirPawns = pos.pieces(Them, PAWN);
|
||||
|
||||
e->passedPawns[Us] = 0;
|
||||
e->passedPawns[Us] = e->candidatePawns[Us] = 0;
|
||||
e->kingSquares[Us] = SQ_NONE;
|
||||
e->semiopenFiles[Us] = 0xFF;
|
||||
e->pawnAttacks[Us] = shift_bb<Right>(ourPawns) | shift_bb<Left>(ourPawns);
|
||||
@@ -179,7 +179,12 @@ namespace {
|
||||
value += ChainMember[f];
|
||||
|
||||
if (candidate)
|
||||
{
|
||||
value += CandidatePassed[relative_rank(Us, s)];
|
||||
|
||||
if (!doubled)
|
||||
e->candidatePawns[Us] |= s;
|
||||
}
|
||||
}
|
||||
|
||||
return value;
|
||||
|
||||
Reference in New Issue
Block a user