X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;h=1582b7bc01e841468227e6ca3fd1fd4188db6c1a;hp=434587a87d5c6e40c627ca3a54edfbad779a1f0d;hb=72c7595f8ac72c7831ee319b8b0bc46404c5fc27;hpb=659c54582ddb1bbbf80f7022a80c027ab0bd4c42 diff --git a/src/search.cpp b/src/search.cpp index 434587a8..1582b7bc 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -121,9 +121,6 @@ namespace { // 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; @@ -258,7 +255,7 @@ namespace { 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); @@ -328,7 +325,6 @@ void SearchStack::init(int ply) { pv[ply] = pv[ply + 1] = MOVE_NONE; currentMove = threatMove = MOVE_NONE; reduction = Depth(0); - currentMoveCaptureValue = Value(0); } void SearchStack::initKillers() { @@ -959,7 +955,7 @@ namespace { // 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)) @@ -1018,12 +1014,6 @@ namespace { 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); @@ -1155,7 +1145,7 @@ namespace { // 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)) @@ -1202,7 +1192,7 @@ namespace { 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); @@ -1335,13 +1325,8 @@ namespace { && !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 @@ -1424,7 +1409,7 @@ namespace { // 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)) @@ -1451,6 +1436,7 @@ namespace { EvalInfo ei; Value staticValue; bool isCheck = pos.is_check(); + ei.futilityMargin = Value(0); // Manually initialize futilityMargin if (isCheck) staticValue = -VALUE_INFINITE; @@ -1462,7 +1448,6 @@ namespace { assert(ei.futilityMargin == Value(0)); staticValue = tte->value(); - ei.futilityMargin = Value(0); // manually initialize futilityMargin } else staticValue = evaluate(pos, ei, threadID); @@ -1729,12 +1714,6 @@ namespace { 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)); @@ -2025,7 +2004,7 @@ namespace { // 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);