From b088f0aefd658261e9231b556382acf532920513 Mon Sep 17 00:00:00 2001 From: Joona Kiiski Date: Mon, 24 Aug 2009 20:06:09 +0300 Subject: [PATCH 1/1] Use special null move technique in low depth. 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 --- src/movepick.cpp | 5 ++++- src/search.cpp | 2 +- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/movepick.cpp b/src/movepick.cpp index 80893455..7e338dbf 100644 --- a/src/movepick.cpp +++ b/src/movepick.cpp @@ -45,6 +45,7 @@ namespace { 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}; @@ -79,8 +80,10 @@ MovePicker::MovePicker(const Position& p, Move ttm, Depth d, if (p.is_check()) phasePtr = EvasionsPhaseTable; - else if (d > Depth(0)) + else if (d >= Depth(3 * OnePly)) phasePtr = useNullMove ? MainSearchPhaseTable : MainSearchNoNullPhaseTable; + else if (d > Depth(0)) + phasePtr = useNullMove ? LowSearchPhaseTable : MainSearchNoNullPhaseTable; else if (d == Depth(0)) phasePtr = QsearchWithChecksPhaseTable; else diff --git a/src/search.cpp b/src/search.cpp index 804108b4..944d9c69 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -1282,7 +1282,7 @@ namespace { bool isCheck = pos.is_check(); bool useNullMove = ( allowNullmove - && depth > OnePly + //&& depth > OnePly && !isCheck && !value_is_mate(beta) && ok_to_do_nullmove(pos) -- 2.39.2