From: Joost VandeVondele Date: Wed, 6 Oct 2021 17:16:02 +0000 (+0200) Subject: Compute ttCapture earlier X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=580698e5e57f40dcba52b92a7f0c7a0e9ab09437 Compute ttCapture earlier Compute ttCapture earlier, and reuse. passed STC: LLR: 2.93 (-2.94,2.94) <-2.50,0.50> Total: 74128 W: 18640 L: 18578 D: 36910 Ptnml(0-2): 224, 7970, 20649, 7962, 259 https://tests.stockfishchess.org/tests/view/615dd9fa1a32f4036ac7fc4d closes https://github.com/official-stockfish/Stockfish/pull/3734 No functional change --- diff --git a/src/search.cpp b/src/search.cpp index bdd139ce..1aaf53d8 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -658,6 +658,7 @@ namespace { ttValue = ss->ttHit ? value_from_tt(tte->value(), ss->ply, pos.rule50_count()) : VALUE_NONE; ttMove = rootNode ? thisThread->rootMoves[thisThread->pvIdx].pv[0] : ss->ttHit ? tte->move() : MOVE_NONE; + ttCapture = ttMove && pos.capture_or_promotion(ttMove); if (!excludedMove) ss->ttPv = PvNode || (ss->ttHit && tte->is_pv()); @@ -683,7 +684,7 @@ namespace { if (ttValue >= beta) { // Bonus for a quiet ttMove that fails high - if (!pos.capture_or_promotion(ttMove)) + if (!ttCapture) update_quiet_stats(pos, ss, ttMove, stat_bonus(depth), depth); // Extra penalty for early quiet moves of the previous ply @@ -691,7 +692,7 @@ namespace { update_continuation_histories(ss-1, pos.piece_on(prevSq), prevSq, -stat_bonus(depth + 1)); } // Penalty for a quiet ttMove that fails low - else if (!pos.capture_or_promotion(ttMove)) + else if (!ttCapture) { int penalty = -stat_bonus(depth); thisThread->mainHistory[us][from_to(ttMove)] << penalty; @@ -948,7 +949,6 @@ namespace { moves_loop: // When in check, search starts here - ttCapture = ttMove && pos.capture_or_promotion(ttMove); int rangeReduction = 0; // Step 11. A small Probcut idea, when we are in check