Skip to content

Commit

Permalink
- Fix wrong mate/tb scores from probCut : official-stockfish/Stockfish@
Browse files Browse the repository at this point in the history
  • Loading branch information
yaneurao committed Feb 14, 2024
1 parent 0eced1b commit 4e4643a
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions source/engine/yaneuraou-engine/yaneuraou-search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2246,7 +2246,7 @@ Value search(Position& pos, Stack* ss, Value alpha, Value beta, Depth depth, boo
&& ttValue != VALUE_NONE
&& ttValue < probCutBeta))
{
ASSERT_LV3(probCutBeta < VALUE_INFINITE);
ASSERT_LV3(probCutBeta < VALUE_INFINITE && probCutBeta > beta);

MovePicker mp(pos, ttMove, probCutBeta - ss->staticEval, &captureHistory);

Expand Down Expand Up @@ -2297,7 +2297,8 @@ Value search(Position& pos, Stack* ss, Value alpha, Value beta, Depth depth, boo
// ProbCutのdataを置換表に保存する。

tte->save(posKey, value_to_tt(value, ss->ply), ss->ttPv, BOUND_LOWER, depth - 3, move, ss->staticEval);
return value - (probCutBeta - beta);
return std::abs(value) < VALUE_TB_WIN_IN_MAX_PLY ? value - (probCutBeta - beta)
: value;
}
}

Expand Down

0 comments on commit 4e4643a

Please sign in to comment.