Pass accumulator caches by reference

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

No functional change
This commit is contained in:
Shawn Xu
2025-11-14 17:32:17 +01:00
committed by Joost VandeVondele
parent a191791f46
commit db824e26be
5 changed files with 13 additions and 13 deletions
+3 -3
View File
@@ -124,7 +124,7 @@ trace(Position& pos, const Eval::NNUE::Networks& networks, Eval::NNUE::Accumulat
// We estimate the value of each piece by doing a differential evaluation from
// the current base eval, simulating the removal of the piece from its square.
auto [psqt, positional] = networks.big.evaluate(pos, *accumulators, &caches.big);
auto [psqt, positional] = networks.big.evaluate(pos, *accumulators, caches.big);
Value base = psqt + positional;
base = pos.side_to_move() == WHITE ? base : -base;
@@ -140,7 +140,7 @@ trace(Position& pos, const Eval::NNUE::Networks& networks, Eval::NNUE::Accumulat
pos.remove_piece(sq);
accumulators->reset();
std::tie(psqt, positional) = networks.big.evaluate(pos, *accumulators, &caches.big);
std::tie(psqt, positional) = networks.big.evaluate(pos, *accumulators, caches.big);
Value eval = psqt + positional;
eval = pos.side_to_move() == WHITE ? eval : -eval;
v = base - eval;
@@ -157,7 +157,7 @@ trace(Position& pos, const Eval::NNUE::Networks& networks, Eval::NNUE::Accumulat
ss << '\n';
accumulators->reset();
auto t = networks.big.trace_evaluate(pos, *accumulators, &caches.big);
auto t = networks.big.trace_evaluate(pos, *accumulators, caches.big);
ss << " NNUE network contributions "
<< (pos.side_to_move() == WHITE ? "(White to move)" : "(Black to move)") << std::endl