X-Git-Url: https://git.sesse.net/?p=stockfish;a=blobdiff_plain;f=src%2Fsearch.cpp;h=95d8be98bc858cad282f233abf5dad0b011eb3fc;hp=7eb04308b4c3bbd6c72247a6d920927ffc91b9e5;hb=1a7047f544b29cc16c970df1379752f0541ed90f;hpb=5bec768d42fc8ce34b4dc0574ef9f4e61bfd8853 diff --git a/src/search.cpp b/src/search.cpp index 7eb04308..95d8be98 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -1139,9 +1139,8 @@ namespace { ttMove = ss[ply].pv[ply]; tte = TT.retrieve(pos.get_key()); - // Following assert could fail, for instance when we have - // moveCount == 0 we return without saving a TT entry. - /* assert(tte); */ + // If tte->move() != MOVE_NONE then it equals ttMove + assert(!(tte && tte->move()) || tte->move() == ttMove); } // Initialize a MovePicker object for the current position, and prepare @@ -1170,9 +1169,7 @@ namespace { // To verify this we do a reduced search on all the other moves but the ttMove, // if result is lower then TT value minus a margin then we assume ttMove is the // only one playable. It is a kind of relaxed single reply extension. - // Note that could be ttMove != tte->move() due to IID, so we always use tte->move() - // to avoid aliases when we probe tte->depth() and tte->type() - if ( depth >= 8 * OnePly + if ( depth >= 6 * OnePly && tte && move == tte->move() && ext < OnePly @@ -1183,7 +1180,7 @@ namespace { if (abs(ttValue) < VALUE_KNOWN_WIN) { - Value excValue = search(pos, ss, ttValue - SingleReplyMargin, depth / 2, ply, false, threadID, ttMove); + Value excValue = search(pos, ss, ttValue - SingleReplyMargin, depth / 2, ply, false, threadID, move); // If search result is well below the foreseen score of the ttMove then we // assume ttMove is the only one realistically playable and we extend it. @@ -1476,8 +1473,6 @@ namespace { // To verify this we do a reduced search on all the other moves but the ttMove, // if result is lower then TT value minus a margin then we assume ttMove is the // only one playable. It is a kind of relaxed single reply extension. - // Note that could be ttMove != tte->move() due to IID, so we always use tte->move() - // to avoid aliases when we probe tte->depth() and tte->type() if ( depth >= 8 * OnePly && tte && move == tte->move() @@ -1490,7 +1485,7 @@ namespace { if (abs(ttValue) < VALUE_KNOWN_WIN) { - Value excValue = search(pos, ss, ttValue - SingleReplyMargin, depth / 2, ply, false, threadID, ttMove); + Value excValue = search(pos, ss, ttValue - SingleReplyMargin, depth / 2, ply, false, threadID, move); // If search result is well below the foreseen score of the ttMove then we // assume ttMove is the only one realistically playable and we extend it.