X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=src%2Fevaluate.cpp;h=9061a38421fb75ae22be58f8f77940455a17c781;hb=f7d1491b3df28bf10faac81e340cb6a22fc5b57b;hp=718c7bc035da95f92718e73fe599ee376ff793d7;hpb=cc7bcd5303a645223a6cd853817d3172754243aa;p=stockfish diff --git a/src/evaluate.cpp b/src/evaluate.cpp index 718c7bc0..9061a384 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -192,7 +192,6 @@ using namespace Trace; namespace { - // Threshold for lazy and space evaluation constexpr Value LazyThreshold1 = Value(3631); constexpr Value LazyThreshold2 = Value(2084); @@ -1084,13 +1083,14 @@ make_v: Value Eval::evaluate(const Position& pos) { Value v; - bool useClassical = false; + // Deciding between classical and NNUE eval (~10 Elo): for high PSQ imbalance we use classical, + // but we switch to NNUE during long shuffling or with high material on the board. + bool useClassical = (pos.this_thread()->depth > 9 || pos.count() > 7) && + abs(eg_value(pos.psq_score())) * 5 > (856 + pos.non_pawn_material() / 64) * (10 + pos.rule50_count()); // Deciding between classical and NNUE eval (~10 Elo): for high PSQ imbalance we use classical, // but we switch to NNUE during long shuffling or with high material on the board. - if ( !useNNUE - || ((pos.this_thread()->depth > 9 || pos.count() > 7) && - abs(eg_value(pos.psq_score())) * 5 > (856 + pos.non_pawn_material() / 64) * (10 + pos.rule50_count()))) + if (!useNNUE || useClassical) { v = Evaluation(pos).value(); // classical useClassical = abs(v) >= 297;