]> git.sesse.net Git - stockfish/commit
Introduce a function to compute NNUE accumulator
authorJoost VandeVondele <Joost.VandeVondele@gmail.com>
Mon, 20 Feb 2023 19:02:55 +0000 (20:02 +0100)
committerJoost VandeVondele <Joost.VandeVondele@gmail.com>
Thu, 23 Feb 2023 12:25:35 +0000 (13:25 +0100)
commit08385527dd470ece814ac85013802995a0e7f6ca
tree2188dd8e799042c62637920279dd496342d00ead
parent77dfcbedce2861b2c6c5056d49e7a8731fea4256
Introduce a function to compute NNUE accumulator

This patch introduces `hint_common_parent_position()` to signal that potentially several child nodes will require an NNUE eval. By populating explicitly the accumulator, these subsequent evaluations can be performed more efficiently.

This was based on the observation that calculating the evaluation in an excluded move position yielded a significant Elo gain, even though the evaluation itself was already available (work by pb00067).

Sopel wrote the code to perform just the accumulator update. This PR is based on cleaned up code that

passed STC:
https://tests.stockfishchess.org/tests/view/63f62f9be74a12625bcd4aa0
 LLR: 2.94 (-2.94,2.94) <0.50,2.50>
Total: 110368 W: 29607 L: 29167 D: 51594
Ptnml(0-2): 41, 10551, 33572, 10967, 53

and in an the earlier (equivalent) version

passed STC:
https://tests.stockfishchess.org/tests/view/63f3c3fee74a12625bcce2a6
LLR: 2.95 (-2.94,2.94) <0.00,2.00>
Total: 47552 W: 12786 L: 12467 D: 22299
Ptnml(0-2): 120, 5107, 12997, 5438, 114

passed LTC:
https://tests.stockfishchess.org/tests/view/63f45cc2e74a12625bccfa63
LLR: 2.94 (-2.94,2.94) <0.50,2.50>
Total: 110368 W: 29607 L: 29167 D: 51594
Ptnml(0-2): 41, 10551, 33572, 10967, 53

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

Bench: 3726250
src/evaluate.h
src/nnue/evaluate_nnue.cpp
src/nnue/evaluate_nnue.h
src/nnue/nnue_feature_transformer.h
src/search.cpp