Fix msb calculation for large-board version
authorFabian Fichter <ianfab@users.noreply.github.com>
Thu, 7 Feb 2019 22:19:45 +0000 (23:19 +0100)
committerFabian Fichter <ianfab@users.noreply.github.com>
Thu, 7 Feb 2019 22:19:45 +0000 (23:19 +0100)
commit9ffc78af565aafd6d75782d26385ea6a89d00782
treecba9f30060cefd1d2f2fa96b57d7b581d89a6727
parentd1b56e78293ed005e21d5c35a37924da25e662dc
Fix msb calculation for large-board version

A bug in the calculation of the most significant bit
caused undefined behavior in the king safety evaluation.

The fix significantly improves playing strength of the large-board version:
chess
LLR: 2.97 (-2.94,2.94) [-10.00,5.00]
Total: 100 W: 72 L: 15 D: 13

capablanca
LLR: 2.98 (-2.94,2.94) [-10.00,5.00]
Total: 82 W: 62 L: 8 D: 12

shogi
LLR: 2.97 (-2.94,2.94) [-10.00,5.00]
Total: 256 W: 157 L: 92 D: 7

No functional change for normal version.
src/bitboard.h