From: Joost VandeVondele Date: Fri, 14 Aug 2020 20:18:12 +0000 (+0200) Subject: Use NNUE more for fortresses X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=cd0b8b4cf28208fffef931322749205a0ddc6066 Use NNUE more for fortresses Increases the use of NNUE evaluation in positions without captures/pawn moves, by increasing the NNUEThreshold threshold with rule50_count. This patch will force Stockfish to use NNUE eval more and more in materially unbalanced positions, when it seems that the classical eval is struggling to win and only manages to shuffle. This will ask the (slower) NNUE eval to double-check the potential fortress branches of the search tree, but only when necessary. passed STC: https://tests.stockfishchess.org/tests/view/5f36f1bf11a9b1a1dbf192d8 LLR: 2.93 (-2.94,2.94) {-0.50,1.50} Total: 51824 W: 5836 L: 5653 D: 40335 Ptnml(0-2): 264, 4356, 16512, 4493, 287 passed LTC: https://tests.stockfishchess.org/tests/view/5f37836111a9b1a1dbf1936d LLR: 2.93 (-2.94,2.94) {0.25,1.75} Total: 29768 W: 1747 L: 1590 D: 26431 Ptnml(0-2): 33, 1347, 11977, 1484, 43 closes https://github.com/official-stockfish/Stockfish/pull/3011 Bench: 4173967 --- diff --git a/src/evaluate.cpp b/src/evaluate.cpp index a453fa0f..3a620a78 100644 --- a/src/evaluate.cpp +++ b/src/evaluate.cpp @@ -939,7 +939,7 @@ make_v: Value Eval::evaluate(const Position& pos) { bool classical = !Eval::useNNUE - || abs(eg_value(pos.psq_score())) >= NNUEThreshold; + || abs(eg_value(pos.psq_score())) >= NNUEThreshold * (16 + pos.rule50_count()) / 16; Value v = classical ? Evaluation(pos).value() : NNUE::evaluate(pos) * 5 / 4 + Tempo;