Move smallnet threshold logic into a function

Now that the smallnet threshold is no longer a constant,
use a function to organize it with other eval code.

Passed non-regression STC:
https://tests.stockfishchess.org/tests/view/66459fa093ce6da3e93b5ba2
LLR: 2.95 (-2.94,2.94) <-1.75,0.25>
Total: 217600 W: 56281 L: 56260 D: 105059
Ptnml(0-2): 756, 23787, 59729, 23736, 792

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

No functional change
This commit is contained in:
Linmiao Xu
2024-05-16 01:48:56 -04:00
committed by Joost VandeVondele
parent 1b7dea3f85
commit d92d1f3180
3 changed files with 7 additions and 6 deletions

View File

@@ -45,9 +45,7 @@ constexpr std::string_view PieceToChar(" PNBRQK pnbrqk");
void hint_common_parent_position(const Position& pos,
const Networks& networks,
AccumulatorCaches& caches) {
int simpleEvalAbs = std::abs(simple_eval(pos, pos.side_to_move()));
if (simpleEvalAbs > Eval::SmallNetThreshold + 6 * pos.count<PAWN>())
if (Eval::use_smallnet(pos))
networks.small.hint_common_access(pos, &caches.small);
else
networks.big.hint_common_access(pos, &caches.big);