mirror of
https://github.com/sockspls/badfish
synced 2025-04-30 16:53:09 +00:00
History Stat Comparison
Adjust LMR by comparing history stats with opponent (prior ply). STC: LLR: 2.96 (-2.94,2.94) [0.00,5.00] Total: 27754 W: 5066 L: 4824 D: 17864 LTC: LLR: 2.95 (-2.94,2.94) [0.00,5.00] Total: 216596 W: 28157 L: 27343 D: 161096 Bench: 5437729
This commit is contained in:
parent
e18321f55a
commit
e77f38c431
2 changed files with 17 additions and 7 deletions
|
@ -570,6 +570,7 @@ namespace {
|
||||||
Thread* thisThread = pos.this_thread();
|
Thread* thisThread = pos.this_thread();
|
||||||
inCheck = pos.checkers();
|
inCheck = pos.checkers();
|
||||||
moveCount = quietCount = ss->moveCount = 0;
|
moveCount = quietCount = ss->moveCount = 0;
|
||||||
|
ss->history = VALUE_ZERO;
|
||||||
bestValue = -VALUE_INFINITE;
|
bestValue = -VALUE_INFINITE;
|
||||||
ss->ply = (ss-1)->ply + 1;
|
ss->ply = (ss-1)->ply + 1;
|
||||||
|
|
||||||
|
@ -994,14 +995,22 @@ moves_loop: // When in check search starts from here
|
||||||
&& !pos.see_ge(make_move(to_sq(move), from_sq(move)), VALUE_ZERO))
|
&& !pos.see_ge(make_move(to_sq(move), from_sq(move)), VALUE_ZERO))
|
||||||
r -= 2 * ONE_PLY;
|
r -= 2 * ONE_PLY;
|
||||||
|
|
||||||
// Decrease/increase reduction for moves with a good/bad history
|
ss->history = thisThread->history[moved_piece][to_sq(move)]
|
||||||
Value val = thisThread->history[moved_piece][to_sq(move)]
|
|
||||||
+ (cmh ? (*cmh )[moved_piece][to_sq(move)] : VALUE_ZERO)
|
+ (cmh ? (*cmh )[moved_piece][to_sq(move)] : VALUE_ZERO)
|
||||||
+ (fmh ? (*fmh )[moved_piece][to_sq(move)] : VALUE_ZERO)
|
+ (fmh ? (*fmh )[moved_piece][to_sq(move)] : VALUE_ZERO)
|
||||||
+ (fmh2 ? (*fmh2)[moved_piece][to_sq(move)] : VALUE_ZERO)
|
+ (fmh2 ? (*fmh2)[moved_piece][to_sq(move)] : VALUE_ZERO)
|
||||||
+ thisThread->fromTo.get(~pos.side_to_move(), move);
|
+ thisThread->fromTo.get(~pos.side_to_move(), move)
|
||||||
int rHist = (val - 8000) / 20000;
|
- 8000; // Correction factor
|
||||||
r = std::max(DEPTH_ZERO, (r / ONE_PLY - rHist) * ONE_PLY);
|
|
||||||
|
// Decrease/increase reduction by comparing opponent's stat score
|
||||||
|
if (ss->history > VALUE_ZERO && (ss-1)->history < VALUE_ZERO)
|
||||||
|
r -= ONE_PLY;
|
||||||
|
|
||||||
|
else if (ss->history < VALUE_ZERO && (ss-1)->history > VALUE_ZERO)
|
||||||
|
r += ONE_PLY;
|
||||||
|
|
||||||
|
// Decrease/increase reduction for moves with a good/bad history
|
||||||
|
r = std::max(DEPTH_ZERO, (r / ONE_PLY - ss->history / 20000) * ONE_PLY);
|
||||||
}
|
}
|
||||||
|
|
||||||
Depth d = std::max(newDepth - r, ONE_PLY);
|
Depth d = std::max(newDepth - r, ONE_PLY);
|
||||||
|
|
|
@ -43,6 +43,7 @@ struct Stack {
|
||||||
Move excludedMove;
|
Move excludedMove;
|
||||||
Move killers[2];
|
Move killers[2];
|
||||||
Value staticEval;
|
Value staticEval;
|
||||||
|
Value history;
|
||||||
bool skipEarlyPruning;
|
bool skipEarlyPruning;
|
||||||
int moveCount;
|
int moveCount;
|
||||||
CounterMoveStats* counterMoves;
|
CounterMoveStats* counterMoves;
|
||||||
|
|
Loading…
Add table
Reference in a new issue