]> git.sesse.net Git - stockfish/commit
Cleanup and simplify NNUE code.
authorTomasz Sobczyk <tomasz.sobczyk1997@gmail.com>
Sat, 24 Apr 2021 13:08:11 +0000 (15:08 +0200)
committerJoost VandeVondele <Joost.VandeVondele@gmail.com>
Sun, 25 Apr 2021 11:16:30 +0000 (13:16 +0200)
commitb748b46714d5f8e0acca0a042ede1fc95e4f5190
tree20aa95e809784f9721bcf0ca82d7a12f8d651240
parent32d781769db9f017405fe422bfdc702069fb0422
Cleanup and simplify NNUE code.

A lot of optimizations happend since the NNUE was introduced
and since then some parts of the code were left unused. This
got to the point where asserts were have to be made just to
let people know that modifying something will not have any
effects or may even break everything due to the assumptions
being made. Removing these parts removes those inexisting
"false dependencies". Additionally:

 * append_changed_indices now takes the king pos and stateinfo
   explicitly, no more misleading pos parameter
 * IndexList is removed in favor of a generic ValueList.
   Feature transformer just instantiates the type it needs.
 * The update cost and refresh requirement is deferred to the
   feature set once again, but now doesn't go through the whole
   FeatureSet machinery and just calls HalfKP directly.
 * accumulator no longer has a singular dimension.
 * The PS constants and the PieceSquareIndex array are made local
   to the HalfKP feature set because they are specific to it and
   DO differ for other feature sets.
 * A few names are changed to more descriptive

Passed STC non-regression:
https://tests.stockfishchess.org/tests/view/608421dd95e7f1852abd2790
LLR: 2.95 (-2.94,2.94) <-2.50,0.50>
Total: 180008 W: 16186 L: 16258 D: 147564
Ptnml(0-2): 587, 12593, 63725, 12503, 596

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

No functional change
src/misc.h
src/nnue/architectures/halfkp_256x2-32-32.h [deleted file]
src/nnue/features/feature_set.h [deleted file]
src/nnue/features/features_common.h [deleted file]
src/nnue/features/half_kp.cpp
src/nnue/features/half_kp.h
src/nnue/features/index_list.h [deleted file]
src/nnue/nnue_accumulator.h
src/nnue/nnue_architecture.h
src/nnue/nnue_common.h
src/nnue/nnue_feature_transformer.h