mirror of
https://github.com/sockspls/badfish
synced 2025-07-11 19:49:14 +00:00
qsearch: do not prune pv nodes with negative SEE
Also small micro-optimization, take a line out of the moves loop. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
parent
bb0da595a7
commit
a7227ac26f
1 changed files with 6 additions and 3 deletions
|
@ -1394,6 +1394,8 @@ namespace {
|
||||||
int moveCount = 0;
|
int moveCount = 0;
|
||||||
Bitboard dcCandidates = mp.discovered_check_candidates();
|
Bitboard dcCandidates = mp.discovered_check_candidates();
|
||||||
bool isCheck = pos.is_check();
|
bool isCheck = pos.is_check();
|
||||||
|
bool pvNode = (beta - alpha != 1);
|
||||||
|
bool enoughMaterial = pos.non_pawn_material(pos.side_to_move()) > RookValueMidgame;
|
||||||
|
|
||||||
// Loop through the moves until no moves remain or a beta cutoff
|
// Loop through the moves until no moves remain or a beta cutoff
|
||||||
// occurs.
|
// occurs.
|
||||||
|
@ -1414,8 +1416,8 @@ namespace {
|
||||||
&& !moveIsCheck
|
&& !moveIsCheck
|
||||||
&& !move_promotion(move)
|
&& !move_promotion(move)
|
||||||
&& !moveIsPassedPawnPush
|
&& !moveIsPassedPawnPush
|
||||||
&& beta - alpha == 1
|
&& !pvNode
|
||||||
&& pos.non_pawn_material(pos.side_to_move()) > RookValueMidgame)
|
&& enoughMaterial)
|
||||||
{
|
{
|
||||||
Value futilityValue = staticValue
|
Value futilityValue = staticValue
|
||||||
+ Max(pos.midgame_value_of_piece_on(move_to(move)),
|
+ Max(pos.midgame_value_of_piece_on(move_to(move)),
|
||||||
|
@ -1431,9 +1433,10 @@ namespace {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Don't search captures and checks with negative SEE values.
|
// Don't search captures and checks with negative SEE values
|
||||||
if ( !isCheck
|
if ( !isCheck
|
||||||
&& !move_promotion(move)
|
&& !move_promotion(move)
|
||||||
|
&& !pvNode
|
||||||
&& (pos.midgame_value_of_piece_on(move_from(move)) >
|
&& (pos.midgame_value_of_piece_on(move_from(move)) >
|
||||||
pos.midgame_value_of_piece_on(move_to(move)))
|
pos.midgame_value_of_piece_on(move_to(move)))
|
||||||
&& pos.see(move) < 0)
|
&& pos.see(move) < 0)
|
||||||
|
|
Loading…
Add table
Reference in a new issue