Move the existing dampening function last so that NNUE evaluations are
also handled as we approach the 50 move rule.
STC:
LLR: 2.95 (-2.94,2.94) {-0.50,1.50}
Total: 4792 W: 695 L: 561 D: 3536
Ptnml(0-2): 19, 420, 1422, 478, 57
https://tests.stockfishchess.org/tests/view/
5f3164179081672066537534
LTC:
LLR: 8.62 (-2.94,2.94) {0.25,1.75}
Total: 286744 W: 18494 L: 17430 D: 250820
Ptnml(0-2): 418, 14886, 111745, 15860, 463
https://tests.stockfishchess.org/tests/view/
5f316b039081672066537541
closes https://github.com/official-stockfish/Stockfish/pull/3004
Bench:
4001800
// Side to move point of view
v = (pos.side_to_move() == WHITE ? v : -v) + Tempo;
// Side to move point of view
v = (pos.side_to_move() == WHITE ? v : -v) + Tempo;
- // Damp down the evaluation linearly when shuffling
- v = v * (100 - pos.rule50_count()) / 100;
-
Value Eval::evaluate(const Position& pos) {
Value Eval::evaluate(const Position& pos) {
- if (Eval::useNNUE)
- {
- Value v = eg_value(pos.psq_score());
- // Take NNUE eval only on balanced positions
- if (abs(v) < NNUEThreshold)
- return NNUE::evaluate(pos) + Tempo;
- }
- return Evaluation<NO_TRACE>(pos).value();
+ bool classical = !Eval::useNNUE
+ || abs(eg_value(pos.psq_score())) >= NNUEThreshold;
+ Value v = classical ? Evaluation<NO_TRACE>(pos).value()
+ : NNUE::evaluate(pos) + Tempo;
+
+ // Damp down the evaluation linearly when shuffling
+ v = v * (100 - pos.rule50_count()) / 100;
+
+ return v;
}
/// trace() is like evaluate(), but instead of returning a value, it returns
}
/// trace() is like evaluate(), but instead of returning a value, it returns