// Depth limit for selective search:
Depth SelectiveDepth = 7*OnePly;
- // Use dynamic LMR?
- const bool UseDynamicLMR = false;
-
// Use internal iterative deepening?
const bool UseIIDAtPVNodes = true;
const bool UseIIDAtNonPVNodes = false;
Depth depth, int ply, int threadID);
void sp_search(SplitPoint *sp, int threadID);
void sp_search_pv(SplitPoint *sp, int threadID);
- void init_node(const Position &pos, SearchStack ss[], int ply, int threadID);
+ void init_node(SearchStack ss[], int ply, int threadID);
void update_pv(SearchStack ss[], int ply);
void sp_update_pv(SearchStack *pss, SearchStack ss[], int ply);
bool connected_moves(const Position &pos, Move m1, Move m2);
pv[ply] = pv[ply + 1] = MOVE_NONE;
currentMove = threatMove = MOVE_NONE;
reduction = Depth(0);
- currentMoveCaptureValue = Value(0);
}
void SearchStack::initKillers() {
// Initialize, and make an early exit in case of an aborted search,
// an instant draw, maximum ply reached, etc.
- init_node(pos, ss, ply, threadID);
+ init_node(ss, ply, threadID);
// After init_node() that calls poll()
if (AbortSearch || thread_should_stop(threadID))
movesSearched[moveCount++] = ss[ply].currentMove = move;
- if (moveIsCapture)
- ss[ply].currentMoveCaptureValue =
- move_is_ep(move)? PawnValueMidgame : pos.midgame_value_of_piece_on(move_to(move));
- else
- ss[ply].currentMoveCaptureValue = Value(0);
-
// Decide the new search depth
bool dangerous;
Depth ext = extension(pos, move, true, moveIsCapture, moveIsCheck, singleReply, mateThreat, &dangerous);
// Initialize, and make an early exit in case of an aborted search,
// an instant draw, maximum ply reached, etc.
- init_node(pos, ss, ply, threadID);
+ init_node(ss, ply, threadID);
// After init_node() that calls poll()
if (AbortSearch || thread_should_stop(threadID))
StateInfo st;
pos.do_null_move(st);
- int R = (depth >= 4 * OnePly ? 4 : 3); // Null move dynamic reduction
+ int R = (depth >= 5 * OnePly ? 4 : 3); // Null move dynamic reduction
Value nullValue = -search(pos, ss, -(beta-1), depth-R*OnePly, ply+1, false, threadID);
&& !move_is_castle(move)
&& !move_is_killer(move, ss[ply]))
{
- // LMR dynamic reduction
- Depth R = UseDynamicLMR
- && moveCount >= 2 * LMRNonPVMoves
- && depth > 7*OnePly ? 2*OnePly : OnePly;
-
- ss[ply].reduction = R;
- value = -search(pos, ss, -(beta-1), newDepth-R, ply+1, true, threadID);
+ ss[ply].reduction = OnePly;
+ value = -search(pos, ss, -(beta-1), newDepth-OnePly, ply+1, true, threadID);
}
else
value = beta; // Just to trigger next condition
// Initialize, and make an early exit in case of an aborted search,
// an instant draw, maximum ply reached, etc.
- init_node(pos, ss, ply, threadID);
+ init_node(ss, ply, threadID);
// After init_node() that calls poll()
if (AbortSearch || thread_should_stop(threadID))
EvalInfo ei;
Value staticValue;
bool isCheck = pos.is_check();
+ ei.futilityMargin = Value(0); // Manually initialize futilityMargin
if (isCheck)
staticValue = -VALUE_INFINITE;
assert(ei.futilityMargin == Value(0));
staticValue = tte->value();
- ei.futilityMargin = Value(0); // manually initialize futilityMargin
}
else
staticValue = evaluate(pos, ei, threadID);
assert(move_is_ok(move));
- if (moveIsCapture)
- ss[sp->ply].currentMoveCaptureValue =
- move_is_ep(move)? PawnValueMidgame : pos.midgame_value_of_piece_on(move_to(move));
- else
- ss[sp->ply].currentMoveCaptureValue = Value(0);
-
lock_grab(&(sp->lock));
int moveCount = ++sp->moves;
lock_release(&(sp->lock));
// NodesBetweenPolls nodes, init_node() also calls poll(), which polls
// for user input and checks whether it is time to stop the search.
- void init_node(const Position &pos, SearchStack ss[], int ply, int threadID) {
+ void init_node(SearchStack ss[], int ply, int threadID) {
assert(ply >= 0 && ply < PLY_MAX);
assert(threadID >= 0 && threadID < ActiveThreads);