Skip to content

Commit

Permalink
simplify statScore
Browse files Browse the repository at this point in the history
test r15
  • Loading branch information
dhbloo committed Jun 14, 2024
1 parent 190b2a1 commit dfb8929
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
7 changes: 3 additions & 4 deletions Rapfi/search/ab/search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -658,7 +658,6 @@ Value search(Board &board, SearchStack *ss, Value alpha, Value beta, Depth depth
Pos bestMove = Pos::NONE;
HistoryTracker histTracker(board, ss);
(ss + 2)->killers[0] = (ss + 2)->killers[1] = Pos::NONE; // Reset killer of grand-children
ss->statScore = 0; // Reset statScore

// Update selDepth (selDepth counts from 1, ply from 0)
if (PvNode && thisThread->selDepth <= ss->ply)
Expand Down Expand Up @@ -1133,13 +1132,13 @@ Value search(Board &board, SearchStack *ss, Value alpha, Value beta, Depth depth
r -= 1.0f;
}

// Update statScore of this node
ss->statScore = searchData->mainHistory[self][move][HIST_ATTACK]
// Compute statScore of this node
int statScore = searchData->mainHistory[self][move][HIST_ATTACK]
+ searchData->mainHistory[self][move][HIST_QUIET] * 4 / 5 - 3391;

// Decrease/increase reduction for moves with a good/bad history
// Use less stat score at higher depths
r -= ss->statScore * (1.0f / (12633 + 4055 * (depth > 7)));
r -= statScore * (1.0f / (12633 + 4055 * (depth > 7)));

// Allow LMR to do deeper search in some circumstances
// Clamp the LMR depth to newDepth (no depth less than one)
Expand Down
1 change: 0 additions & 1 deletion Rapfi/search/ab/searchstack.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,6 @@ struct SearchStack
int moveCount;
Depth extraExtension; /// cumulative extension depth that larger than one ply
int dbValueDepth;
int statScore;
Value staticEval;
Pos currentMove;
Pos skipMove;
Expand Down

0 comments on commit dfb8929

Please sign in to comment.