Use pure NNUE for king of the hill
authorFabian Fichter <ianfab@users.noreply.github.com>
Tue, 1 Dec 2020 20:12:23 +0000 (21:12 +0100)
committerFabian Fichter <ianfab@users.noreply.github.com>
Tue, 1 Dec 2020 20:12:23 +0000 (21:12 +0100)
Since the best NNUE network is much stronger than classical evaluation,
it seems intuitive to switch from hybrid to pure NNUE evaluation.

kingofthehill STC
Score: 133 - 34 - 33  [0.748] 200
Elo: 188.5 +/- 49.5, LOS: 100.0 %, DrawRatio: 16.5 %

kingofthehill LTC
Score: 63 - 20 - 17  [0.715] 100
Elo: 159.8 +/- 68.4, LOS: 100.0 %, DrawRatio: 17.0 %

src/evaluate.cpp

index 0efda47..17b8a83 100644 (file)
@@ -1476,8 +1476,9 @@ Value Eval::evaluate(const Position& pos) {
       // If there is PSQ imbalance use classical eval, with small probability if it is small
       Value psq = Value(abs(eg_value(pos.psq_score())));
       int   r50 = 16 + pos.rule50_count();
-      bool  largePsq = psq * 16 > (NNUEThreshold1 + pos.non_pawn_material() / 64) * r50;
-      bool  classical = largePsq || (psq > PawnValueMg / 4 && !(pos.this_thread()->nodes & 0xB));
+      bool  pure = pos.capture_the_flag_piece() && pos.checking_permitted();
+      bool  largePsq = psq * 16 > (NNUEThreshold1 + pos.non_pawn_material() / 64) * r50 && !pure;
+      bool  classical = largePsq || (psq > PawnValueMg / 4 && !(pos.this_thread()->nodes & 0xB) && !pure);
 
       v = classical ? Evaluation<NO_TRACE>(pos).value() : adjusted_NNUE();