Fix a data race for NNUE
authorJoost VandeVondele <Joost.VandeVondele@gmail.com>
Sun, 9 Aug 2020 16:11:38 +0000 (18:11 +0200)
committerJoost VandeVondele <Joost.VandeVondele@gmail.com>
Sun, 9 Aug 2020 21:51:07 +0000 (23:51 +0200)
commit27b593a94477a821f80a041320683f805114d4a3
treeb5755855deb4a10392174ec5038f30321fabb7fc
parenta6e89293df5af35931b61d86b6de3872a981c100
Fix a data race for NNUE

the stateInfo at the rootPos is no longer read-only, as the NNUE accumulator is part of it.
Threads can thus not share this object and need their own copy.

tested for no regression
https://tests.stockfishchess.org/tests/view/5f3022239081672066536bce
LLR: 2.96 (-2.94,2.94) {-1.50,0.50}
Total: 52800 W: 6843 L: 6802 D: 39155
Ptnml(0-2): 336, 4646, 16399, 4679, 340

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

fixes https://github.com/official-stockfish/Stockfish/issues/2933

No functional change
src/Makefile
src/thread.cpp
src/thread.h