// Reset aspiration window starting size
Value avg = rootMoves[pvIdx].averageScore;
- delta = Value(10) + int(avg) * avg / 17470;
+ delta = Value(10) + int(avg) * avg / 15335;
alpha = std::max(avg - delta, -VALUE_INFINITE);
beta = std::min(avg + delta, VALUE_INFINITE);
// Adjust optimism based on root move's averageScore (~4 Elo)
- int opt = 113 * avg / (std::abs(avg) + 109);
- optimism[us] = Value(opt);
- optimism[~us] = -optimism[us];
+ optimism[us] = 103 * (avg + 33) / (std::abs(avg + 34) + 119);
+ optimism[~us] = -116 * (avg + 40) / (std::abs(avg + 12) + 123);
// Start with a small aspiration window and, in the case of a fail
// high/low, re-search with a bigger window until we don't fail
{
value = qsearch<NonPV>(pos, ss, alpha - 1, alpha);
if (value < alpha)
- {
- if (!priorCapture && prevSq != SQ_NONE)
- {
- int bonus = (depth > 6) + (PvNode || cutNode) + (value < alpha - 658)
- + ((ss - 1)->moveCount > 11);
- update_continuation_histories(ss - 1, pos.piece_on(prevSq), prevSq,
- stat_bonus(depth) * bonus);
- thisThread->mainHistory[~us][from_to((ss - 1)->currentMove)]
- << stat_bonus(depth) * bonus * 57 / 100;
- }
return value;
- }
}
// Step 8. Futility pruning: child node (~40 Elo)
{
assert(pos.capture_stage(move));
+ // Prefetch the TT entry for the resulting position
+ prefetch(TT.first_entry(pos.key_after(move)));
+
ss->currentMove = move;
ss->continuationHistory =
&thisThread
update_continuation_histories(ss - 1, pos.piece_on(prevSq), prevSq,
stat_bonus(depth) * bonus);
thisThread->mainHistory[~us][from_to((ss - 1)->currentMove)]
- << stat_bonus(depth) * bonus * 61 / 100;
+ << stat_bonus(depth) * bonus / 2;
}
if (PvNode)