]> git.sesse.net Git - stockfish/commit
Fix incorrect StateInfo
authorMarco Costalba <mcostalba@gmail.com>
Mon, 14 Aug 2017 16:12:16 +0000 (09:12 -0700)
committerMarco Costalba <mcostalba@gmail.com>
Tue, 15 Aug 2017 06:01:58 +0000 (23:01 -0700)
commit232c50fed0b80a0f39322a925575f760648ae0a5
treedfdf71e0791c117bfd378eb8599b2d6d110f715d
parentc3e964f35e3619afa7d729a928dcaa2e710ecc21
Fix incorrect StateInfo

We use Position::set() to set root position across
threads. But there are some StateInfo fields (previous,
pliesFromNull, capturedPiece) that cannot be deduced
from a fen string, so set() clears them and to not lose
the info we need to backup and later restore setupStates->back().
Note that setupStates is shared by threads but is accessed
in read-only mode.

This fixes regression introduced by df6cb446eaf21

Tested with 3 threads at STC:
LLR: 2.95 (-2.94,2.94) [-4.00,0.00]
Total: 14436 W: 2304 L: 2196 D: 9936

Bench: 5608839
src/thread.cpp