1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-04-30 00:33:09 +00:00

Introduce movecount pruning for qsearch()

If in quiescence search, we assume that me can prune late moves when:

a) the move ordering count of the move is : moveCount > abs(depth) + 2
b) we are not in check
c) the late move does not give check
d) the late move is not an advanced pawn push

Modification of an original idea by @VoyagerOne.

STC
https://tests.stockfishchess.org/tests/view/5f40581787a5c3c63d8f535f
LLR: 2.96 (-2.94,2.94) {-0.25,1.25}
Total: 132848 W: 14999 L: 14661 D: 103188
Ptnml(0-2): 684, 11242, 42309, 11430, 759

LTC
https://tests.stockfishchess.org/tests/view/5f4226da87a5c3c63d8f5412
LLR: 2.98 (-2.94,2.94) {0.25,1.25}
Total: 12008 W: 678 L: 551 D: 10779
Ptnml(0-2): 8, 485, 4899, 596, 16

closes https://github.com/official-stockfish/Stockfish/pull/3053

Bench: 3749974
This commit is contained in:
Vizvezdenec 2020-08-23 14:22:32 +03:00 committed by Stéphane Nicolet
parent cc9d503dde
commit d5f86b6359
2 changed files with 6 additions and 2 deletions

View file

@ -93,7 +93,7 @@ constexpr int MAX_LPH = 4;
typedef Stats<int16_t, 10692, MAX_LPH, int(SQUARE_NB) * int(SQUARE_NB)> LowPlyHistory;
/// CounterMoveHistory stores counter moves indexed by [piece][to] of the previous
/// move, see www.chessprogramming.org/Countermove_Heuristic
/// move, see www.chessprogramming.org/Countermove_Heuristic
typedef Stats<Move, NOT_USED, PIECE_NB, SQUARE_NB> CounterMoveHistory;
/// CapturePieceToHistory is addressed by a move's [piece][to][captured piece type]

View file

@ -1531,6 +1531,10 @@ moves_loop: // When in check, search starts from here
{
assert(type_of(move) != ENPASSANT); // Due to !pos.advanced_pawn_push
// moveCount pruning
if (moveCount > abs(depth) + 2)
continue;
futilityValue = futilityBase + PieceValue[EG][pos.piece_on(to_sq(move))];
if (futilityValue <= alpha)
@ -1547,7 +1551,7 @@ moves_loop: // When in check, search starts from here
}
// Do not search moves with negative SEE values
if ( !ss->inCheck && !pos.see_ge(move))
if (!ss->inCheck && !pos.see_ge(move))
continue;
// Speculative prefetch as early as possible