Skip to content

Commit

Permalink
do not redundantly evaluate when skip move try2
Browse files Browse the repository at this point in the history
test r15
  • Loading branch information
dhbloo committed Jun 13, 2024
1 parent fa863d2 commit c86c92c
Showing 1 changed file with 12 additions and 10 deletions.
22 changes: 12 additions & 10 deletions Rapfi/search/ab/search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -813,7 +813,10 @@ Value search(Board &board, SearchStack *ss, Value alpha, Value beta, Depth depth
goto moves_loop;
}
else if (!RootNode) {
if (ttHit) {
if (skipMove) {
eval = ss->staticEval;
}
else if (ttHit) {
// Never assume anything about values stored in TT
ss->staticEval = eval = ttEval;
if (eval == VALUE_NONE)
Expand All @@ -827,15 +830,14 @@ Value search(Board &board, SearchStack *ss, Value alpha, Value beta, Depth depth
ss->staticEval = eval = Evaluation::evaluate<Rule>(board, alpha, beta);

// Save static evaluation into transposition table
if (!skipMove)
TT.store(posKey,
VALUE_NONE,
ss->staticEval,
ss->ttPv,
BOUND_NONE,
Pos::NONE,
(int)DEPTH_NONE,
ss->ply);
TT.store(posKey,
VALUE_NONE,
ss->staticEval,
ss->ttPv,
BOUND_NONE,
Pos::NONE,
(int)DEPTH_NONE,
ss->ply);
}

improvement = ss->staticEval - (ss - 2)->staticEval;
Expand Down

0 comments on commit c86c92c

Please sign in to comment.