Skip to content

Commit 68d61b8

Browse files
committed
Simplify IID depth formula
Restore original formula messed up during half-ply removal. STC LLR: 4.11 (-2.94,2.94) [-3.00,1.00] Total: 21349 W: 4091 L: 3909 D: 13349 LTC LLR: 5.42 (-2.94,2.94) [-3.00,1.00] Total: 52819 W: 8321 L: 8122 D: 36376 bench: 8040572
1 parent a241022 commit 68d61b8

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

src/search.cpp

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -769,9 +769,9 @@ namespace {
769769
&& !ttMove
770770
&& (PvNode || ss->staticEval + 256 >= beta))
771771
{
772-
Depth d = 2 * (depth - 2 * ONE_PLY) - (PvNode ? DEPTH_ZERO : depth / 2);
772+
Depth d = depth - 2 * ONE_PLY - (PvNode ? DEPTH_ZERO : depth / 4);
773773
ss->skipEarlyPruning = true;
774-
search<PvNode ? PV : NonPV, false>(pos, ss, alpha, beta, d / 2, true);
774+
search<PvNode ? PV : NonPV, false>(pos, ss, alpha, beta, d, true);
775775
ss->skipEarlyPruning = false;
776776

777777
tte = TT.probe(posKey, ttHit);
@@ -821,13 +821,11 @@ namespace {
821821
if (!pos.legal(move, ci.pinned))
822822
continue;
823823

824-
moveCount = ++splitPoint->moveCount;
824+
ss->moveCount = moveCount = ++splitPoint->moveCount;
825825
splitPoint->spinlock.release();
826826
}
827827
else
828-
++moveCount;
829-
830-
ss->moveCount = moveCount;
828+
ss->moveCount = ++moveCount;
831829

832830
if (RootNode)
833831
{
@@ -935,8 +933,7 @@ namespace {
935933
// Check for legality just before making the move
936934
if (!RootNode && !SpNode && !pos.legal(move, ci.pinned))
937935
{
938-
moveCount--;
939-
ss->moveCount = moveCount;
936+
ss->moveCount = --moveCount;
940937
continue;
941938
}
942939

@@ -1429,7 +1426,7 @@ namespace {
14291426
}
14301427

14311428
// Extra penalty for PV move in previous ply when it gets refuted
1432-
if (is_ok((ss-2)->currentMove) && (ss-1)->moveCount==1 && !pos.captured_piece_type())
1429+
if (is_ok((ss-2)->currentMove) && (ss-1)->moveCount == 1 && !pos.captured_piece_type())
14331430
{
14341431
Square prevPrevSq = to_sq((ss-2)->currentMove);
14351432
HistoryStats& ttMoveCmh = CounterMovesHistory[pos.piece_on(prevPrevSq)][prevPrevSq];

0 commit comments

Comments
 (0)