Verify repetitions exactly and constexpr-generate the hash keys
Verify repetitions against the nibble-packed piece placement in addition to the Zobrist key, fixing false threefold draws from hash collisions. Generate the Zobrist constants and cuckoo tables at compile time and remove Position::init() asserting the needed requirements on the Zobrist keys.
failed STC:
LLR: -2.94 (-2.94,2.94) <-1.75,0.25>
Total: 649728 W: 164888 L: 165785 D: 319055
Ptnml(0-2): 666, 69228, 185983, 68311, 676
https://tests.stockfishchess.org/tests/view/6aeb4dfb20cd2dc3f03d1ce7
fixes https://github.com/official-stockfish/Stockfish/issues/7279
The 0.4 Elo cost of additional verification is acceptable to guarantee proper 3-fold detection.
The bench doesn't change, the patch is only functional on relatively rare hash collisions.
closes https://github.com/official-stockfish/Stockfish/pull/7305
No functional change