diff --git a/dist/Ethereal8.22.zip b/dist/Ethereal8.22.zip deleted file mode 100644 index 1654f312..00000000 Binary files a/dist/Ethereal8.22.zip and /dev/null differ diff --git a/dist/Ethereal8.23.zip b/dist/Ethereal8.23.zip new file mode 100644 index 00000000..a08a85f8 Binary files /dev/null and b/dist/Ethereal8.23.zip differ diff --git a/src/search.c b/src/search.c index bb044b94..050c92dc 100644 --- a/src/search.c +++ b/src/search.c @@ -346,6 +346,26 @@ int alphaBetaSearch(PVariation * pv, Board * board, int alpha, int beta, optimal = eval + depth * 1.25 * PawnValue; } + // Node Razoring at expected ALLNODEs + if (USE_RAZORING + && nodeType != PVNODE + && !inCheck + && depth <= 4 + && !tableIsTactical + && hasNonPawnMaterial(board, board->turn) + && eval + RazorMargins[depth] < alpha){ + + + if (depth <= 1) + return quiescenceSearch(board, alpha, beta, height); + + value = quiescenceSearch(board, alpha - RazorMargins[depth], + beta - RazorMargins[depth], height); + + if (value + RazorMargins[depth] < alpha) + return value; + } + // Static null move pruning if (USE_STATIC_NULL_PRUNING && depth <= 3 @@ -413,17 +433,6 @@ int alphaBetaSearch(PVariation * pv, Board * board, int alpha, int beta, hist = getHistoryScore(History, currentMove, board->turn, 128); } - // Late Move Pruning - if (USE_LATE_MOVE_PRUNING - && nodeType != PVNODE - && played >= 1 - && !inCheck - && isQuiet - && depth < 6 - && quiets > LateMovePruningCounts[depth] - && hist < 32) - continue; - // Use futility pruning if (USE_FUTILITY_PRUNING && nodeType != PVNODE @@ -441,6 +450,20 @@ int alphaBetaSearch(PVariation * pv, Board * board, int alpha, int beta, continue; } + // Late Move Pruning + if (USE_LATE_MOVE_PRUNING + && nodeType != PVNODE + && played >= 1 + && !inCheck + && isQuiet + && depth <= 8 + && quiets > LateMovePruningCounts[depth] + && isNotInCheck(board, board->turn)){ + + revertMove(board, currentMove, undo); + continue; + } + // Update counter of moves actually played played += 1; @@ -658,4 +681,11 @@ int moveWasTactical(Undo * undo, uint16_t move){ return undo->capturePiece != EMPTY || MoveType(move) == PROMOTION_MOVE || MoveType(move) == ENPASS_MOVE; +} + +int hasNonPawnMaterial(Board * board, int turn){ + uint64_t friendly = board->colours[turn]; + uint64_t kings = board->pieces[5]; + uint64_t pawns = board->pieces[0]; + return (friendly & (kings | pawns)) != friendly; } \ No newline at end of file diff --git a/src/search.h b/src/search.h index 694aa1f7..4b30dd3a 100644 --- a/src/search.h +++ b/src/search.h @@ -44,7 +44,11 @@ int moveIsTactical(Board * board, uint16_t move); int moveWasTactical(Undo * undo, uint16_t move); -static const int LateMovePruningCounts[6] = {0, 6, 11, 15, 20, 25}; +int hasNonPawnMaterial(Board * board, int turn); + +static const int LateMovePruningCounts[] = {0, 6, 9, 14, 21, 30, 41, 54, 69}; + +static const int RazorMargins[] = {0, 450, 480, 520, 580}; #define USE_STATIC_NULL_PRUNING (1) #define USE_FUTILITY_PRUNING (1) @@ -53,5 +57,6 @@ static const int LateMovePruningCounts[6] = {0, 6, 11, 15, 20, 25}; #define USE_INTERNAL_ITERATIVE_DEEPENING (1) #define USE_TRANSPOSITION_TABLE (1) #define USE_LATE_MOVE_PRUNING (1) +#define USE_RAZORING (1) #endif \ No newline at end of file diff --git a/src/uci.c b/src/uci.c index 41661e25..fb48387b 100644 --- a/src/uci.c +++ b/src/uci.c @@ -82,7 +82,7 @@ int main(){ http://wbec-ridderkerk.nl/html/UCIProtocol.html */ if (stringEquals(str, "uci")){ - printf("id name Ethereal 8.22\n"); + printf("id name Ethereal 8.23\n"); printf("id author Andrew Grant\n"); printf("option name Hash type spin default 16 min 1 max 2048\n"); printf("uciok\n");