Depth reduction(bool i, Depth d, int mn) {
int r = Reductions[d] * Reductions[mn];
- return (r + 503) / 1024 + (!i && r > 915);
+ return (r + 534) / 1024 + (!i && r > 904);
}
- constexpr int futility_move_count(bool improving, Depth depth) {
- return (3 + depth * depth) / (2 - improving);
+ int futility_move_count(bool improving, Depth depth, const Position& pos) {
+ return (3 + depth * depth + 2 * pos.blast_on_capture()) / (2 - improving + pos.blast_on_capture());
}
// History and stats update bonus, based on depth
// Step 8. Null move search with verification search (~40 Elo)
if ( !PvNode
&& (ss-1)->currentMove != MOVE_NULL
- && (ss-1)->statScore < 24185
+ && (ss-1)->statScore < 23767
&& eval >= beta
&& eval >= ss->staticEval
- && ss->staticEval >= beta - 22 * depth - 34 * improving + 162 * ss->ttPv + 159 + 200 * (!pos.double_step_enabled() && pos.piece_to_char()[PAWN] != ' ')
- && ss->staticEval >= beta - 20 * depth - 22 * improving + 168 * ss->ttPv + 159
++ && ss->staticEval >= beta - 20 * depth - 22 * improving + 168 * ss->ttPv + 159 + 200 * (!pos.double_step_enabled() && pos.piece_to_char()[PAWN] != ' ')
&& !excludedMove
&& pos.non_pawn_material(us)
+ && pos.count<ALL_PIECES>(~us) != pos.count<PAWN>(~us)
+ && !pos.flip_enclosed_pieces()
&& (ss->ply >= thisThread->nmpMinPly || us != thisThread->nmpColor))
{
assert(eval - beta >= 0);
// Null move dynamic reduction based on depth and value
- Depth R = (1062 - 300 * pos.must_capture() - 250 * !pos.checking_permitted() + 68 * depth) / 256 + std::min(int(eval - beta) / 190, pos.must_capture() || pos.blast_on_capture() ? 0 : 3);
- Depth R = (1090 + 81 * depth) / 256 + std::min(int(eval - beta) / 205, 3);
++ Depth R = (1090 - 300 * pos.must_capture() - 250 * !pos.checking_permitted() + 81 * depth) / 256 + std::min(int(eval - beta) / 205, pos.must_capture() || pos.blast_on_capture() ? 0 : 3);
ss->currentMove = MOVE_NULL;
ss->continuationHistory = &thisThread->continuationHistory[0][0][NO_PIECE][0];
r += 2;
ss->statScore = thisThread->mainHistory[us][from_to(move)]
- + (*contHist[0])[movedPiece][to_sq(move)]
- + (*contHist[1])[movedPiece][to_sq(move)]
- + (*contHist[3])[movedPiece][to_sq(move)]
+ + (*contHist[0])[history_slot(movedPiece)][to_sq(move)]
+ + (*contHist[1])[history_slot(movedPiece)][to_sq(move)]
+ + (*contHist[3])[history_slot(movedPiece)][to_sq(move)]
- - 4791;
+ - 4923;
// Decrease/increase reduction for moves with a good/bad history (~30 Elo)
if (!ss->inCheck)
- r -= ss->statScore / (14790 - 4434 * pos.captures_to_hand());
- r -= ss->statScore / 14721;
++ r -= ss->statScore / (14721 - 4434 * pos.captures_to_hand());
}
// In general we want to cap the LMR depth search at newDepth. But if