1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-04-29 16:23:09 +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:
Linmiao Xu 2024-07-17 00:03:10 -04:00 committed by Joost VandeVondele
parent bb4b01e306
commit 1e2f051103

View file

@ -59,8 +59,7 @@ Value Eval::evaluate(const Eval::NNUE::Networks& networks,
assert(!pos.checkers());
int simpleEval = simple_eval(pos, pos.side_to_move());
bool smallNet = use_smallnet(pos);
bool smallNet = use_smallnet(pos);
int v;
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;
// 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);
nnue = (125 * psqt + 131 * positional) / 128;