Skip to content

Commit a7fcf67

Browse files
committed
Simplify away tactical late move reductions
Bench: 5343783 STC ELO | 0.89 +- 2.40 (95%) SPRT | 10.0+0.10s Threads=1 Hash=8MB LLR | 2.99 (-2.94, 2.94) [-3.00, 1.00] GAMES | N: 36736 W: 8476 L: 8382 D: 19878 LTC ELO | -0.91 +- 1.86 (95%) SPRT | 40.0+0.40s Threads=1 Hash=64MB LLR | -0.68 (-2.94, 2.94) [-3.00, 1.00] GAMES | N: 58256 W: 12595 L: 12747 D: 32914
1 parent 527334e commit a7fcf67

1 file changed

Lines changed: 14 additions & 19 deletions

File tree

src/search.c

Lines changed: 14 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -561,38 +561,33 @@ int Negamax(int alpha, int beta, int depth, int cutnode, ThreadData* thread, PV*
561561

562562
// Late move reductions
563563
int R = 1;
564-
if (depth > 2 && playedMoves > 1) {
564+
if (depth > 2 && playedMoves > 1 && !tactical) {
565565
R = LMR[min(depth, 63)][min(playedMoves, 63)];
566566

567-
if (!tactical) {
568-
// increase reduction on non-pv
569-
if (!isPV) R++;
567+
// increase reduction on non-pv
568+
if (!isPV) R++;
570569

571-
// increase reduction if our eval is declining
572-
if (!improving) R++;
570+
// increase reduction if our eval is declining
571+
if (!improving) R++;
573572

574-
// reduce these special quiets less
575-
if (killerOrCounter) R -= 2;
573+
// reduce these special quiets less
574+
if (killerOrCounter) R -= 2;
576575

577-
// less likely a non-capture is best
578-
if (IsCap(hashMove)) R++;
576+
// less likely a non-capture is best
577+
if (IsCap(hashMove)) R++;
579578

580-
// move GAVE check
581-
if (board->checkers) R--;
582-
583-
// adjust reduction based on historical score
584-
R -= history / 20480;
585-
} else {
586-
int th = GetTacticalHistory(data, board, move);
587-
R = 1 - 4 * th / (abs(th) + 24576);
588-
}
579+
// move GAVE check
580+
if (board->checkers) R--;
589581

590582
// Reduce more on expected cut nodes
591583
// idea from komodo/sf, explained by Don Daily here
592584
// https://talkchess.com/forum3/viewtopic.php?f=7&t=47577&start=10#p519741
593585
// and https://www.chessprogramming.org/Node_Types
594586
if (cutnode) R++;
595587

588+
// adjust reduction based on historical score
589+
R -= history / 20480;
590+
596591
// prevent dropping into QS, extending, or reducing all extensions
597592
R = min(depth - 1, max(R, 1));
598593
}

0 commit comments

Comments
 (0)