1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-05-02 01:29:36 +00:00

Use CounterMoveHistory when calculating LMR for cut nodes

If the sum of CounterMoveHistory heuristic and History heuristic is below zero,
then reduce an extra ply in cut nodes

LTC:
LLR: 2.96 (-2.94,2.94) [0.00,6.00]
Total: 6479 W: 1099 L: 967 D: 4413

Bench: 7773299

Resolves #315
This commit is contained in:
VoyagerOne 2015-03-28 21:15:49 +00:00 committed by Joona Kiiski
parent 3a6753328c
commit ac8e6ff000

View file

@ -964,7 +964,9 @@ moves_loop: // When in check and at SpNode search starts from here
ss->reduction = reduction<PvNode>(improving, depth, moveCount); ss->reduction = reduction<PvNode>(improving, depth, moveCount);
if ( (!PvNode && cutNode) if ( (!PvNode && cutNode)
|| History[pos.piece_on(to_sq(move))][to_sq(move)] < VALUE_ZERO) || History[pos.piece_on(to_sq(move))][to_sq(move)] < VALUE_ZERO
|| CounterMovesHistory[pos.piece_on(prevMoveSq)][prevMoveSq][pos.piece_on(to_sq(move))][to_sq(move)]
+ History[pos.piece_on(to_sq(move))][to_sq(move)] < VALUE_ZERO)
ss->reduction += ONE_PLY; ss->reduction += ONE_PLY;
if (move == countermoves[0] || move == countermoves[1]) if (move == countermoves[0] || move == countermoves[1])