]> git.sesse.net Git - stockfish/commit
Change definition of between_bb()
authorbmc4 <bmc4@cin.ufpe.br>
Mon, 15 Mar 2021 19:06:42 +0000 (16:06 -0300)
committerStéphane Nicolet <cassio@free.fr>
Wed, 17 Mar 2021 23:21:41 +0000 (00:21 +0100)
commit50890616591443ab06faa0927747bf14c8d450e3
tree14cfb1f13b29eff7422fb37ebf19857ba697f2e9
parentd58e83695f1dbe5bb75ca9e5d6775757b5fd5f7a
Change definition of between_bb()

We remark that in current master, most of our use cases for between_bb() can be
optimized if the second parameter of the function is added to the segment. So we
change the definition of between_bb(s1, s2) such that it excludes s1 but includes s2.

We also use a precomputed array for between_bb() for another small speed gain
(see https://tests.stockfishchess.org/tests/view/604d09f72433018de7a389fb).

Passed STC:
LLR: 2.96 (-2.94,2.94) {-0.25,1.25}
Total: 18736 W: 1746 L: 1607 D: 15383
Ptnml(0-2): 61, 1226, 6644, 1387, 50
https://tests.stockfishchess.org/tests/view/60428c84ddcba5f0627bb6e4

Yellow LTC:
LTC:
LLR: -3.00 (-2.94,2.94) {0.25,1.25}
Total: 39144 W: 1431 L: 1413 D: 36300
Ptnml(0-2): 13, 1176, 17184, 1178, 21
https://tests.stockfishchess.org/tests/view/605128702433018de7a38ca1

Closes https://github.com/official-stockfish/Stockfish/pull/3397

---------

Verified for correctness by running perft on the following position:

./stockfish
position fen 4rrk1/1p1nq3/p7/2p1P1pp/3P2bp/3Q1Bn1/PPPB4/1K2R1NR w - - 40 21
go perft 6

Nodes searched: 6136386434

--------

No functional change
src/bitboard.cpp
src/bitboard.h
src/movegen.cpp
src/position.cpp