Speed up move picking for losing chess
authorFabian Fichter <ianfab@users.noreply.github.com>
Fri, 27 Sep 2019 07:31:08 +0000 (09:31 +0200)
committerFabian Fichter <ianfab@users.noreply.github.com>
Wed, 2 Oct 2019 18:35:12 +0000 (20:35 +0200)
giveaway STC
LLR: 2.95 (-2.94,2.94) [0.00,10.00]
Total: 403 W: 203 L: 114 D: 86
http://35.161.250.236:6543/tests/view/5d93a8726e23db3768ec087a

giveaway LTC
LLR: 2.96 (-2.94,2.94) [0.00,10.00]
Total: 369 W: 178 L: 93 D: 98
http://35.161.250.236:6543/tests/view/5d93be896e23db3768ec088a

losers STC
LLR: 2.96 (-2.94,2.94) [0.00,10.00]
Total: 539 W: 290 L: 190 D: 59
http://35.161.250.236:6543/tests/view/5d93a8fd6e23db3768ec087d

losers LTC
LLR: 2.97 (-2.94,2.94) [0.00,10.00]
Total: 604 W: 314 L: 214 D: 76
http://35.161.250.236:6543/tests/view/5d93be916e23db3768ec088c

codrus STC
LLR: 2.95 (-2.94,2.94) [0.00,10.00]
Total: 857 W: 477 L: 364 D: 16
http://35.161.250.236:6543/tests/view/5d93a9126e23db3768ec087f

src/movepick.cpp
src/search.cpp

index c725cb6..8d55ec4 100644 (file)
@@ -178,7 +178,7 @@ top:
 
   case GOOD_CAPTURE:
       if (select<Best>([&](){
-                       return pos.see_ge(*cur, Value(-55 * cur->value / 1024)) ?
+                       return pos.see_ge(*cur, Value(-55 * cur->value / 1024)) || pos.must_capture() ?
                               // Move losing capture to endBadCaptures to be tried later
                               true : (*endBadCaptures++ = *cur, false); }))
           return *(cur - 1);
index 1b8c947..33333d0 100644 (file)
@@ -1046,7 +1046,8 @@ moves_loop: // When in check, search starts from here
           && bestValue > VALUE_MATED_IN_MAX_PLY)
       {
           // Skip quiet moves if movecount exceeds our FutilityMoveCount threshold
-          moveCountPruning = moveCount >= futility_move_count(improving, depth / ONE_PLY);
+          moveCountPruning = moveCount >= futility_move_count(improving, depth / ONE_PLY)
+                            || (pos.must_capture() && (moveCountPruning || (pos.capture(move) && pos.legal(move))));
 
           if (   !captureOrPromotion
               && !givesCheck