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
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;
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());
if (!excludedMove)
ss->ttPv = PvNode || (ss->ttHit && tte->is_pv());
if (ttValue >= beta)
{
// Bonus for a quiet ttMove that fails high
if (ttValue >= beta)
{
// Bonus for a quiet ttMove that fails high
- if (!pos.capture_or_promotion(ttMove))
update_quiet_stats(pos, ss, ttMove, stat_bonus(depth), depth);
// Extra penalty for early quiet moves of the previous ply
update_quiet_stats(pos, ss, ttMove, stat_bonus(depth), depth);
// Extra penalty for early quiet moves of the previous ply
update_continuation_histories(ss-1, pos.piece_on(prevSq), prevSq, -stat_bonus(depth + 1));
}
// Penalty for a quiet ttMove that fails low
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))
{
int penalty = -stat_bonus(depth);
thisThread->mainHistory[us][from_to(ttMove)] << penalty;
{
int penalty = -stat_bonus(depth);
thisThread->mainHistory[us][from_to(ttMove)] << penalty;
moves_loop: // When in check, search starts here
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
int rangeReduction = 0;
// Step 11. A small Probcut idea, when we are in check