]> git.sesse.net Git - stockfish/commit
More incremental accumulator updates
authorsyzygy1 <3028851+syzygy1@users.noreply.github.com>
Tue, 20 Oct 2020 19:06:06 +0000 (21:06 +0200)
committerJoost VandeVondele <Joost.VandeVondele@gmail.com>
Thu, 22 Oct 2020 18:50:16 +0000 (20:50 +0200)
commit2046d5da30b2cd505b69bddb40062b0d37b43bc7
tree2652345b891fc2c929d1814d2d7b23e1def59597
parent258af8ae44fc15407996e0a21a80ee8b9cfa12cb
More incremental accumulator updates

This patch was inspired by c065abd which updates the accumulator,
if possible, based on the accumulator of two plies back if
the accumulator of the preceding ply is not available.

With this patch we look back even further in the position history
in an attempt to reduce the number of complete recomputations.
When we find a usable accumulator for the position N plies back,
we also update the accumulator of the position N-1 plies back
because that accumulator is most likely to be helpful later
when evaluating positions in sibling branches.
By not updating all intermediate accumulators immediately,
we avoid doing too much work that is not certain to be useful.
Overall, roughly 2-3% speedup.

This patch makes the code more specific to the net architecture,
changing input features of the net will require additional changes
to the incremental update code as discussed in the PR #3193 and #3191.

Passed STC:
https://tests.stockfishchess.org/tests/view/5f9056712c92c7fe3a8c60d0
LLR: 2.94 (-2.94,2.94) {-0.25,1.25}
Total: 10040 W: 1116 L: 968 D: 7956
Ptnml(0-2): 42, 722, 3365, 828, 63

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

No functional change.
src/nnue/features/feature_set.h
src/nnue/nnue_accumulator.h
src/nnue/nnue_feature_transformer.h
src/position.cpp