Skip to content

Commit d539da1

Browse files
SFisGODvondele
authored andcommitted
Use classical eval more often
If there is a moderate imbalance, use classical eval with small probability (1/16), as derived from the node counter. STC: LLR: 2.94 (-2.94,2.94) {-0.25,1.25} Total: 32320 W: 3562 L: 3377 D: 25381 Ptnml(0-2): 144, 2609, 10478, 2776, 153 https://tests.stockfishchess.org/tests/view/5f520615ba100690c5cc5f80 LTC: LLR: 2.95 (-2.94,2.94) {0.25,1.25} Total: 21032 W: 1116 L: 974 D: 18942 Ptnml(0-2): 20, 837, 8664, 971, 24 https://tests.stockfishchess.org/tests/view/5f522eaaba100690c5cc5f8c closes #3107 Bench: 4109324
1 parent 9a063fc commit d539da1

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/evaluate.cpp

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1015,12 +1015,16 @@ namespace {
10151015

10161016
Value Eval::evaluate(const Position& pos) {
10171017

1018+
bool useClassical = abs(eg_value(pos.psq_score())) * 16 > NNUEThreshold1 * (16 + pos.rule50_count());
10181019
bool classical = !Eval::useNNUE
1019-
|| abs(eg_value(pos.psq_score())) * 16 > NNUEThreshold1 * (16 + pos.rule50_count());
1020+
|| useClassical
1021+
|| (abs(eg_value(pos.psq_score())) > PawnValueMg / 8 && !(pos.this_thread()->nodes & 0xF));
10201022
Value v = classical ? Evaluation<NO_TRACE>(pos).value()
10211023
: NNUE::evaluate(pos) * 5 / 4 + Tempo;
10221024

1023-
if (classical && Eval::useNNUE && abs(v) * 16 < NNUEThreshold2 * (16 + pos.rule50_count()))
1025+
if ( useClassical
1026+
&& Eval::useNNUE
1027+
&& abs(v) * 16 < NNUEThreshold2 * (16 + pos.rule50_count()))
10241028
v = NNUE::evaluate(pos) * 5 / 4 + Tempo;
10251029

10261030
// Damp down the evaluation linearly when shuffling

0 commit comments

Comments
 (0)