Skip to content

Commit 45dbd9c

Browse files
renouvemcostalba
authored andcommitted
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
1 parent a646f74 commit 45dbd9c

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

src/evaluate.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,6 @@ namespace {
8787
Bitboard pinnedPieces[COLOR_NB];
8888
};
8989

90-
// Evaluation grain size, must be a power of 2
91-
const int GrainSize = 4;
92-
9390
// Evaluation weights, initialized from UCI options
9491
enum { Mobility, PawnStructure, PassedPawns, Space, KingDangerUs, KingDangerThem };
9592
Score Weights[6];
@@ -926,8 +923,7 @@ Value do_evaluate(const Position& pos) {
926923
assert(ph >= PHASE_ENDGAME && ph <= PHASE_MIDGAME);
927924

928925
int e = (eg_value(v) * int(sf)) / SCALE_FACTOR_NORMAL;
929-
int r = (mg_value(v) * int(ph) + e * int(PHASE_MIDGAME - ph)) / PHASE_MIDGAME;
930-
return Value((r / GrainSize) * GrainSize); // Sign independent
926+
return Value((mg_value(v) * int(ph) + e * int(PHASE_MIDGAME - ph)) / PHASE_MIDGAME);
931927
}
932928

933929
// apply_weight() weights score v by score w trying to prevent overflow

0 commit comments

Comments
 (0)