Try good captures before null move when depth < 3 * OnePly.
Use this kind of null move also in Depth == OnePly.
Signed-off-by: Marco Costalba <mcostalba@gmail.com>
CACHE_LINE_ALIGNMENT
const MovegenPhaseT MainSearchPhaseTable[] = { PH_STOP, PH_NULL_MOVE, PH_TT_MOVES, PH_GOOD_CAPTURES, PH_KILLERS, PH_NONCAPTURES, PH_BAD_CAPTURES, PH_STOP};
const MovegenPhaseT MainSearchNoNullPhaseTable[] = { PH_STOP, PH_TT_MOVES, PH_GOOD_CAPTURES, PH_KILLERS, PH_NONCAPTURES, PH_BAD_CAPTURES, PH_STOP};
CACHE_LINE_ALIGNMENT
const MovegenPhaseT MainSearchPhaseTable[] = { PH_STOP, PH_NULL_MOVE, PH_TT_MOVES, PH_GOOD_CAPTURES, PH_KILLERS, PH_NONCAPTURES, PH_BAD_CAPTURES, PH_STOP};
const MovegenPhaseT MainSearchNoNullPhaseTable[] = { PH_STOP, PH_TT_MOVES, PH_GOOD_CAPTURES, PH_KILLERS, PH_NONCAPTURES, PH_BAD_CAPTURES, PH_STOP};
+ const MovegenPhaseT LowSearchPhaseTable[] = { PH_STOP, PH_TT_MOVES, PH_GOOD_CAPTURES, PH_NULL_MOVE, PH_KILLERS, PH_NONCAPTURES, PH_BAD_CAPTURES, PH_STOP};
const MovegenPhaseT EvasionsPhaseTable[] = { PH_STOP, PH_EVASIONS, PH_STOP};
const MovegenPhaseT QsearchWithChecksPhaseTable[] = { PH_STOP, PH_TT_MOVES, PH_QCAPTURES, PH_QCHECKS, PH_STOP};
const MovegenPhaseT QsearchWithoutChecksPhaseTable[] = { PH_STOP, PH_TT_MOVES, PH_QCAPTURES, PH_STOP};
const MovegenPhaseT EvasionsPhaseTable[] = { PH_STOP, PH_EVASIONS, PH_STOP};
const MovegenPhaseT QsearchWithChecksPhaseTable[] = { PH_STOP, PH_TT_MOVES, PH_QCAPTURES, PH_QCHECKS, PH_STOP};
const MovegenPhaseT QsearchWithoutChecksPhaseTable[] = { PH_STOP, PH_TT_MOVES, PH_QCAPTURES, PH_STOP};
if (p.is_check())
phasePtr = EvasionsPhaseTable;
if (p.is_check())
phasePtr = EvasionsPhaseTable;
+ else if (d >= Depth(3 * OnePly))
phasePtr = useNullMove ? MainSearchPhaseTable : MainSearchNoNullPhaseTable;
phasePtr = useNullMove ? MainSearchPhaseTable : MainSearchNoNullPhaseTable;
+ else if (d > Depth(0))
+ phasePtr = useNullMove ? LowSearchPhaseTable : MainSearchNoNullPhaseTable;
else if (d == Depth(0))
phasePtr = QsearchWithChecksPhaseTable;
else
else if (d == Depth(0))
phasePtr = QsearchWithChecksPhaseTable;
else
bool isCheck = pos.is_check();
bool useNullMove = ( allowNullmove
bool isCheck = pos.is_check();
bool useNullMove = ( allowNullmove
&& !isCheck
&& !value_is_mate(beta)
&& ok_to_do_nullmove(pos)
&& !isCheck
&& !value_is_mate(beta)
&& ok_to_do_nullmove(pos)