mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-21 09:37:16 +08:00
Retire Material::space_weight()
Move all in evaluation. Simplify the code and concentrate in a single place all the logic behind space evaluation, making it much more clear. Verified also at STC it does not regress due to a possible slow down: LLR: 3.91 (-2.94,2.94) [-3.00,1.00] Total: 65744 W: 13285 L: 13194 D: 39265 No functional change.
This commit is contained in:
@@ -223,15 +223,6 @@ Entry* probe(const Position& pos, Table& entries, Endgames& endgames) {
|
||||
if (pos.count<PAWN>(BLACK) == 1 && npm_b - npm_w <= BishopValueMg)
|
||||
e->factor[BLACK] = (uint8_t) SCALE_FACTOR_ONEPAWN;
|
||||
|
||||
// Compute the space weight
|
||||
if (npm_w + npm_b >= 2 * QueenValueMg + 4 * RookValueMg + 2 * KnightValueMg)
|
||||
{
|
||||
int minorPieceCount = pos.count<KNIGHT>(WHITE) + pos.count<BISHOP>(WHITE)
|
||||
+ pos.count<KNIGHT>(BLACK) + pos.count<BISHOP>(BLACK);
|
||||
|
||||
e->spaceWeight = make_score(minorPieceCount * minorPieceCount, 0);
|
||||
}
|
||||
|
||||
// Evaluate the material imbalance. We use PIECE_TYPE_NONE as a place holder
|
||||
// for the bishop pair "extended piece", which allows us to be more flexible
|
||||
// in defining bishop pair bonuses.
|
||||
|
||||
Reference in New Issue
Block a user