From: Marco Costalba Date: Tue, 20 Jul 2010 21:36:38 +0000 (+0100) Subject: Store position static score in TT as soon as possible X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=e2c0b5f99527ed3d03aab8be18ae2bb4c477d51e Store position static score in TT as soon as possible So to maximize the possibility to avoid to recalculate it in the future. A small speed-up of 0.8% Idea by Ralph Stoesser. No functional change. Signed-off-by: Marco Costalba --- diff --git a/src/search.cpp b/src/search.cpp index a3687c07..83ce84d8 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -1090,7 +1090,10 @@ namespace { ei.kingDanger[pos.side_to_move()] = tte->king_danger(); } else + { ss->eval = evaluate(pos, ei); + TT.store(posKey, VALUE_NONE, VALUE_TYPE_NONE, DEPTH_NONE, MOVE_NONE, ss->eval, ei.kingDanger[pos.side_to_move()]); + } refinedValue = refine_eval(tte, ss->eval, ply); // Enhance accuracy with TT value if possible update_gains(pos, (ss-1)->currentMove, (ss-1)->eval, ss->eval); @@ -1108,10 +1111,6 @@ namespace { && !value_is_mate(beta) && !pos.has_pawn_on_7th(pos.side_to_move())) { - // Pass ss->eval to qsearch() and avoid an evaluate call - if (!tte) - TT.store(posKey, VALUE_NONE, VALUE_TYPE_NONE, DEPTH_NONE, MOVE_NONE, ss->eval, ei.kingDanger[pos.side_to_move()]); - Value rbeta = beta - razor_margin(depth); Value v = qsearch(pos, ss, rbeta-1, rbeta, Depth(0), ply); if (v < rbeta)