mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-21 01:27:16 +08:00
Retire grain size code
Seems useless at long TC. Tested at 60+0.05 ELO: 2.98 +-2.2 (95%) LOS: 99.6% Total: 30440 W: 4934 L: 4673 D: 20833 And at 120+0.05 ELO: 2.50 +-2.6 (95%) LOS: 97.1% Total: 19633 W: 2848 L: 2707 D: 14078 bench: 8502826
This commit is contained in:
@@ -87,9 +87,6 @@ namespace {
|
|||||||
Bitboard pinnedPieces[COLOR_NB];
|
Bitboard pinnedPieces[COLOR_NB];
|
||||||
};
|
};
|
||||||
|
|
||||||
// Evaluation grain size, must be a power of 2
|
|
||||||
const int GrainSize = 4;
|
|
||||||
|
|
||||||
// Evaluation weights, initialized from UCI options
|
// Evaluation weights, initialized from UCI options
|
||||||
enum { Mobility, PawnStructure, PassedPawns, Space, KingDangerUs, KingDangerThem };
|
enum { Mobility, PawnStructure, PassedPawns, Space, KingDangerUs, KingDangerThem };
|
||||||
Score Weights[6];
|
Score Weights[6];
|
||||||
@@ -926,8 +923,7 @@ Value do_evaluate(const Position& pos) {
|
|||||||
assert(ph >= PHASE_ENDGAME && ph <= PHASE_MIDGAME);
|
assert(ph >= PHASE_ENDGAME && ph <= PHASE_MIDGAME);
|
||||||
|
|
||||||
int e = (eg_value(v) * int(sf)) / SCALE_FACTOR_NORMAL;
|
int e = (eg_value(v) * int(sf)) / SCALE_FACTOR_NORMAL;
|
||||||
int r = (mg_value(v) * int(ph) + e * int(PHASE_MIDGAME - ph)) / PHASE_MIDGAME;
|
return Value((mg_value(v) * int(ph) + e * int(PHASE_MIDGAME - ph)) / PHASE_MIDGAME);
|
||||||
return Value((r / GrainSize) * GrainSize); // Sign independent
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// apply_weight() weights score v by score w trying to prevent overflow
|
// apply_weight() weights score v by score w trying to prevent overflow
|
||||||
|
|||||||
Reference in New Issue
Block a user