mirror of
https://github.com/sockspls/badfish
synced 2025-07-11 19:49:14 +00:00
Fix capture pruning
We forgot to update bestValue previously Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
parent
bb968fd42a
commit
cd112ee8eb
1 changed files with 30 additions and 0 deletions
|
@ -1542,6 +1542,36 @@ namespace {
|
||||||
// Update current move
|
// Update current move
|
||||||
movesSearched[moveCount++] = ss[ply].currentMove = move;
|
movesSearched[moveCount++] = ss[ply].currentMove = move;
|
||||||
|
|
||||||
|
// Futility pruning for captures
|
||||||
|
// FIXME: test disabling 'Futility pruning for captures'
|
||||||
|
// FIXME: test with 'newDepth < RazorDepth'
|
||||||
|
Color them = opposite_color(pos.side_to_move());
|
||||||
|
|
||||||
|
if ( !isCheck
|
||||||
|
&& newDepth < SelectiveDepth
|
||||||
|
&& !dangerous
|
||||||
|
&& pos.move_is_capture(move)
|
||||||
|
&& !pos.move_is_check(move, ci)
|
||||||
|
&& !move_is_promotion(move)
|
||||||
|
&& move != ttMove
|
||||||
|
&& !move_is_ep(move)
|
||||||
|
&& (pos.type_of_piece_on(move_to(move)) != PAWN || !pos.pawn_is_passed(them, move_to(move)))) // Do not prune passed pawn captures
|
||||||
|
{
|
||||||
|
int preFutilityValueMargin = 0;
|
||||||
|
|
||||||
|
if (newDepth >= OnePly)
|
||||||
|
preFutilityValueMargin = 112 * bitScanReverse32(int(newDepth) * int(newDepth) / 2);
|
||||||
|
|
||||||
|
Value futilityCaptureValue = ss[ply].eval + pos.endgame_value_of_piece_on(move_to(move)) + preFutilityValueMargin + ei.futilityMargin + 90;
|
||||||
|
|
||||||
|
if (futilityCaptureValue < beta)
|
||||||
|
{
|
||||||
|
if (futilityCaptureValue > bestValue)
|
||||||
|
bestValue = futilityCaptureValue;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Futility pruning
|
// Futility pruning
|
||||||
if ( !isCheck
|
if ( !isCheck
|
||||||
&& !dangerous
|
&& !dangerous
|
||||||
|
|
Loading…
Add table
Reference in a new issue