Skip to content

Commit

Permalink
Add improving to a condition of NMP
Browse files Browse the repository at this point in the history
This patch makes one of the conditions for null-move pruning depend on whether we're improving. Keep in mind that it relies on the "classical" definiton, rather than the refined one.

Passed STC: https://tests.stockfishchess.org/tests/view/678d5267d63764e34db49720
LLR: 2.94 (-2.94,2.94) <0.00,2.00>
Total: 38976 W: 10296 L: 9974 D: 18706
Ptnml(0-2): 135, 4504, 9902, 4798, 149

Passed LTC: https://tests.stockfishchess.org/tests/view/678d5891d63764e34db49731
LLR: 2.95 (-2.94,2.94) <0.50,2.50>
Total: 275772 W: 70655 L: 69836 D: 135281
Ptnml(0-2): 217, 30615, 75394, 31452, 208

closes official-stockfish#5813

Bench: 2475787
  • Loading branch information
pkrisz99 authored and xu-shawn committed Feb 2, 2025
1 parent c2ee398 commit 29fe09d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions AUTHORS
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,7 @@ Kian E (KJE-98)
kinderchocolate
Kiran Panditrao (Krgp)
Kojirion
Krisztián Peőcz
Krystian Kuzniarek (kuzkry)
Leonardo Ljubičić (ICCF World Champion)
Leonid Pechenik (lp--)
Expand Down
8 changes: 4 additions & 4 deletions src/search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -803,12 +803,10 @@ Value Search::Worker::search(
&& eval >= beta && (!ttData.move || ttCapture) && !is_loss(beta) && !is_win(eval))
return beta + (eval - beta) / 3;

improving |= ss->staticEval >= beta + 97;

// Step 9. Null move search with verification search
if (cutNode && (ss - 1)->currentMove != Move::null() && eval >= beta
&& ss->staticEval >= beta - 20 * depth + 440 && !excludedMove && pos.non_pawn_material(us)
&& ss->ply >= thisThread->nmpMinPly && !is_loss(beta))
&& ss->staticEval >= beta - 20 * depth + 470 - 60 * improving && !excludedMove
&& pos.non_pawn_material(us) && ss->ply >= thisThread->nmpMinPly && !is_loss(beta))
{
assert(eval - beta >= 0);

Expand Down Expand Up @@ -846,6 +844,8 @@ Value Search::Worker::search(
}
}

improving |= ss->staticEval >= beta + 97;

// Step 10. Internal iterative reductions
// For PV nodes without a ttMove as well as for deep enough cutNodes, we decrease depth.
// (* Scaler) Especially if they make IIR more aggressive.
Expand Down

0 comments on commit 29fe09d

Please sign in to comment.