mirror of
https://github.com/opelly27/Stockfish.git
synced 2026-05-20 07:27:46 +00:00
Replace simple eval with psqt in re-eval condition
As a result, re-eval depends only on smallnet outputs so an extra call to simple eval can be removed. Passed non-regression STC: https://tests.stockfishchess.org/tests/view/669743054ff211be9d4ec232 LLR: 2.94 (-2.94,2.94) <-1.75,0.25> Total: 214912 W: 55801 L: 55777 D: 103334 Ptnml(0-2): 746, 24597, 56760, 24593, 760 https://github.com/official-stockfish/Stockfish/pull/5501 Bench: 1440277
This commit is contained in:
committed by
Joost VandeVondele
parent
bb4b01e306
commit
1e2f051103
+2
-3
@@ -59,8 +59,7 @@ Value Eval::evaluate(const Eval::NNUE::Networks& networks,
|
|||||||
|
|
||||||
assert(!pos.checkers());
|
assert(!pos.checkers());
|
||||||
|
|
||||||
int simpleEval = simple_eval(pos, pos.side_to_move());
|
bool smallNet = use_smallnet(pos);
|
||||||
bool smallNet = use_smallnet(pos);
|
|
||||||
int v;
|
int v;
|
||||||
|
|
||||||
auto [psqt, positional] = smallNet ? networks.small.evaluate(pos, &caches.small)
|
auto [psqt, positional] = smallNet ? networks.small.evaluate(pos, &caches.small)
|
||||||
@@ -69,7 +68,7 @@ Value Eval::evaluate(const Eval::NNUE::Networks& networks,
|
|||||||
Value nnue = (125 * psqt + 131 * positional) / 128;
|
Value nnue = (125 * psqt + 131 * positional) / 128;
|
||||||
|
|
||||||
// Re-evaluate the position when higher eval accuracy is worth the time spent
|
// Re-evaluate the position when higher eval accuracy is worth the time spent
|
||||||
if (smallNet && (nnue * simpleEval < 0 || std::abs(nnue) < 227))
|
if (smallNet && (nnue * psqt < 0 || std::abs(nnue) < 227))
|
||||||
{
|
{
|
||||||
std::tie(psqt, positional) = networks.big.evaluate(pos, &caches.big);
|
std::tie(psqt, positional) = networks.big.evaluate(pos, &caches.big);
|
||||||
nnue = (125 * psqt + 131 * positional) / 128;
|
nnue = (125 * psqt + 131 * positional) / 128;
|
||||||
|
|||||||
Reference in New Issue
Block a user