]> git.sesse.net Git - stockfish/commitdiff
Use common_parent_position hint also at PVNodes TT hits.
authorpb00067 <pb00067@phxl0401.wp.lan>
Sun, 26 Feb 2023 08:59:35 +0000 (09:59 +0100)
committerJoost VandeVondele <Joost.VandeVondele@gmail.com>
Mon, 27 Feb 2023 07:27:26 +0000 (08:27 +0100)
Credits to Stefan Geschwentner (locutus2) showing that the hint
is useful on PvNodes. In contrast to his test,
this version avoids to use the hint when in check.
I believe checking positions aren't good candidates for the hint
because:
- evasion moves are rather few, so a checking pos. has much less childs
than a normal position
- if the king has to move the NNUE eval can't use incremental updates,
  so the child nodes have to do a full refresh anyway.

Passed STC:
https://tests.stockfishchess.org/tests/view/63f9c5b1e74a12625bcdf585
LLR: 2.95 (-2.94,2.94) <0.00,2.00>
Total: 124472 W: 33268 L: 32846 D: 58358
Ptnml(0-2): 350, 12986, 35170, 13352, 378

closes https://github.com/official-stockfish/Stockfish/pull/4410

no functional change

src/search.cpp

index 6ccc70cc673ba783bd993c124d88fc12f10a42c1..206779ed1be13ea17b278572a059cffcd229961d 100644 (file)
@@ -744,7 +744,11 @@ namespace {
         if (eval == VALUE_NONE)
             ss->staticEval = eval = evaluate(pos, &complexity);
         else // Fall back to (semi)classical complexity for TT hits, the NNUE complexity is lost
+        {
             complexity = abs(ss->staticEval - pos.psq_eg_stm());
+            if (PvNode)
+               Eval::NNUE::hint_common_parent_position(pos);
+        }
 
         // ttValue can be used as a better position evaluation (~7 Elo)
         if (    ttValue != VALUE_NONE