Skip to content

Commit

Permalink
Tune fail low bonus formula
Browse files Browse the repository at this point in the history
  • Loading branch information
PikaCat-OuO committed May 29, 2024
1 parent 8ac9093 commit b4b657d
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions src/search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1234,17 +1234,18 @@ Value Search::Worker::search(
// Bonus for prior countermove that caused the fail low
else if (!priorCapture && prevSq != SQ_NONE)
{
int bonus = (depth > 4) + (depth > 5) + (PvNode || cutNode) + ((ss - 1)->statScore < -12449)
+ ((ss - 1)->moveCount > 13) + (!ss->inCheck && bestValue <= ss->staticEval - 146)
+ (!(ss - 1)->inCheck && bestValue <= -(ss - 1)->staticEval - 78);
int bonus = (116 * (depth > 5) + 115 * (PvNode || cutNode)
+ 186 * ((ss - 1)->statScore < -12449) + 121 * ((ss - 1)->moveCount > 13)
+ 64 * (!ss->inCheck && bestValue <= ss->staticEval - 146)
+ 137 * (!(ss - 1)->inCheck && bestValue <= -(ss - 1)->staticEval - 78));
update_continuation_histories(ss - 1, pos.piece_on(prevSq), prevSq,
stat_bonus(depth) * bonus);
stat_bonus(depth) * bonus / 100);
thisThread->mainHistory[~us][((ss - 1)->currentMove).from_to()]
<< stat_bonus(depth) * bonus / 2;
<< stat_bonus(depth) * bonus / 200;

if (type_of(pos.piece_on(prevSq)) != PAWN)
thisThread->pawnHistory[pawn_structure_index(pos)][pos.piece_on(prevSq)][prevSq]
<< stat_bonus(depth) * bonus * 4;
<< stat_bonus(depth) * bonus / 25;
}

if (PvNode)
Expand Down

0 comments on commit b4b657d

Please sign in to comment.