From 7893f6aab8e4a3aef2e824aa4ab90b1ea325ceea Mon Sep 17 00:00:00 2001 From: Fabian Fichter Date: Thu, 18 Jun 2020 22:40:50 +0200 Subject: [PATCH] Simplify clobber-specific code --- src/position.cpp | 2 +- src/search.cpp | 5 ----- 2 files changed, 1 insertions(+), 6 deletions(-) diff --git a/src/position.cpp b/src/position.cpp index 9a5b739..d6a2daf 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -1700,7 +1700,7 @@ bool Position::see_ge(Move m, Value threshold) const { && count(~sideToMove) == extinction_piece_count() + 1))) return extinction_value() < VALUE_ZERO; - if (must_capture()) + if (must_capture() || count() == count()) return VALUE_ZERO >= threshold; int swap = PieceValue[MG][piece_on(to)] - threshold; diff --git a/src/search.cpp b/src/search.cpp index c827aab..d303c4d 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -965,7 +965,6 @@ namespace { // much above beta, we can (almost) safely prune the previous move. if ( !PvNode && depth >= 5 - && (pos.pieces() ^ pos.pieces(CLOBBER_PIECE)) && abs(beta) < VALUE_TB_WIN_IN_MAX_PLY) { Value raisedBeta = std::min(beta + (189 + 20 * !!pos.capture_the_flag_piece()) * (1 + pos.check_counting() + (pos.extinction_value() != VALUE_NONE)) - 45 * improving, VALUE_INFINITE); @@ -1560,10 +1559,6 @@ moves_loop: // When in check, search starts from here moveCount++; - // Avoid qsearch explosion for clobber - if (type_of(pos.moved_piece(move)) == CLOBBER_PIECE && bestValue > VALUE_MATED_IN_MAX_PLY) - continue; - // Futility pruning if ( !inCheck && !givesCheck -- 1.7.0.4