mirror of
https://github.com/sockspls/badfish
synced 2025-05-01 09:13:08 +00:00
Use FMHs to assist with LMR formula.
STC: LLR: 2.99 (-2.94,2.94) [0.00,5.00] Total: 52232 W: 9654 L: 9304 D: 33274 LTC: LLR: 2.97 (-2.94,2.94) [0.00,5.00] Total: 115988 W: 15550 L: 15049 D: 85389 Bench: 7890808 Resolves #651
This commit is contained in:
parent
4048bae47b
commit
e082112cfe
1 changed files with 6 additions and 1 deletions
|
@ -1007,13 +1007,18 @@ moves_loop: // When in check search starts from here
|
||||||
Value hValue = thisThread->history[pos.piece_on(to_sq(move))][to_sq(move)];
|
Value hValue = thisThread->history[pos.piece_on(to_sq(move))][to_sq(move)];
|
||||||
Value cmhValue = cmh[pos.piece_on(to_sq(move))][to_sq(move)];
|
Value cmhValue = cmh[pos.piece_on(to_sq(move))][to_sq(move)];
|
||||||
|
|
||||||
|
const CounterMoveStats* fm = (ss - 2)->counterMoves;
|
||||||
|
const CounterMoveStats* fm2 = (ss - 4)->counterMoves;
|
||||||
|
Value fmValue = (fm ? (*fm)[pos.piece_on(to_sq(move))][to_sq(move)] : VALUE_ZERO);
|
||||||
|
Value fm2Value = (fm2 ? (*fm2)[pos.piece_on(to_sq(move))][to_sq(move)] : VALUE_ZERO);
|
||||||
|
|
||||||
// Increase reduction for cut nodes and moves with a bad history
|
// Increase reduction for cut nodes and moves with a bad history
|
||||||
if ( (!PvNode && cutNode)
|
if ( (!PvNode && cutNode)
|
||||||
|| (hValue < VALUE_ZERO && cmhValue <= VALUE_ZERO))
|
|| (hValue < VALUE_ZERO && cmhValue <= VALUE_ZERO))
|
||||||
r += ONE_PLY;
|
r += ONE_PLY;
|
||||||
|
|
||||||
// Decrease/increase reduction for moves with a good/bad history
|
// Decrease/increase reduction for moves with a good/bad history
|
||||||
int rHist = (hValue + cmhValue) / 14980;
|
int rHist = (hValue + cmhValue + fmValue + fm2Value) / 20000;
|
||||||
r = std::max(DEPTH_ZERO, r - rHist * ONE_PLY);
|
r = std::max(DEPTH_ZERO, r - rHist * ONE_PLY);
|
||||||
|
|
||||||
// Decrease reduction for moves that escape a capture. Filter out
|
// Decrease reduction for moves that escape a capture. Filter out
|
||||||
|
|
Loading…
Add table
Reference in a new issue