From d99c1a8b7e056ec3e6738f582075d5d07ea6cf25 Mon Sep 17 00:00:00 2001 From: Fabian Fichter Date: Fri, 27 Sep 2019 09:31:08 +0200 Subject: [PATCH] Speed up move picking for losing chess 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 | 2 +- src/search.cpp | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/movepick.cpp b/src/movepick.cpp index c725cb6..8d55ec4 100644 --- a/src/movepick.cpp +++ b/src/movepick.cpp @@ -178,7 +178,7 @@ top: case GOOD_CAPTURE: if (select([&](){ - 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); diff --git a/src/search.cpp b/src/search.cpp index 1b8c947..33333d0 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -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 -- 1.7.0.4