Fix races in gensfen as detected with thread sanitizer.

RootInTB was an incorrectly shared global, probably leading to wrong scoreing

Minor:
 setting TB global state from input by all threads (all threads write same values)
 setting Limits global state by all threads (idem)
 thread counting for finalization

CI can be enabled once races are fixed in the learner, manually goes like:
```
make clean && make -j2 ARCH=x86-64-modern sanitize=thread    optimize=no debug=yes build
../tests/instrumented_learn.sh --sanitizer-thread
```

Needs some review.
This commit is contained in:
Joost VandeVondele
2020-09-18 20:22:01 +02:00
committed by nodchip
parent 184bde47dc
commit e8472b5fbe
7 changed files with 66 additions and 58 deletions

View File

@@ -74,6 +74,7 @@ public:
CapturePieceToHistory captureHistory;
ContinuationHistory continuationHistory[2][2];
Score contempt;
bool rootInTB;
};