mirror of
https://github.com/sockspls/badfish
synced 2025-04-29 16:23:09 +00:00
MovePicker: fix a nasty bug in EvalInfo optimization
EvalInfo has missing attack info when a specialized endgame function is used. We missed this case and were using an empty attack bitboard instead so that no captures were generated for endgames. After testing the EvalInfo optimization gave worst results, so after a (long) debug session this nasty bug was found. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
parent
7daaf03b39
commit
75d001addd
1 changed files with 6 additions and 4 deletions
|
@ -78,11 +78,14 @@ MovePicker::MovePicker(const Position& p, bool pv, Move ttm,
|
|||
numOfBadCaptures = 0;
|
||||
|
||||
// With EvalInfo we are able to know how many captures are possible before
|
||||
// generating them. So avoid generating them in case we know are zero.
|
||||
// generating them. So avoid generating in case we know are zero.
|
||||
Color us = pos.side_to_move();
|
||||
Color them = opposite_color(us);
|
||||
bool noAttacks = ei && (ei->attackedBy[us][0] & pos.pieces_of_color(them)) == 0;
|
||||
bool noCaptures = noAttacks && (pos.ep_square() == SQ_NONE) && !pos.has_pawn_on_7th(us);
|
||||
bool noCaptures = ei
|
||||
&& (ei->attackedBy[us][0] & pos.pieces_of_color(them)) == 0
|
||||
&& !ei->mi->specialized_eval_exists()
|
||||
&& (pos.ep_square() == SQ_NONE)
|
||||
&& !pos.has_pawn_on_7th(us);
|
||||
|
||||
if (p.is_check())
|
||||
phaseIndex = EvasionsPhaseIndex;
|
||||
|
@ -93,7 +96,6 @@ MovePicker::MovePicker(const Position& p, bool pv, Move ttm,
|
|||
else
|
||||
phaseIndex = (noCaptures ? NoMovesPhaseIndex : QsearchWithoutChecksPhaseIndex);
|
||||
|
||||
|
||||
dc = p.discovered_check_candidates(us);
|
||||
pinned = p.pinned_pieces(p.side_to_move());
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue