1
0
Fork 0

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
pull/3740/head
Joost VandeVondele 2021-10-06 19:16:02 +02:00 committed by Stéphane Nicolet
parent 0bddd942b4
commit 580698e5e5
1 changed files with 3 additions and 3 deletions

View File

@ -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