Skip to content

Commit

Permalink
Refactor prior countermove bonus
Browse files Browse the repository at this point in the history
Passed simplification STC
LLR: 2.97 (-2.94,2.94) <-1.75,0.25>
Total: 155424 W: 40252 L: 40159 D: 75013
Ptnml(0-2): 511, 18655, 39328, 18666, 552
https://tests.stockfishchess.org/tests/view/6794084fe96bfb672ad18d90

Passed rebased simplification LTC
LLR: 2.97 (-2.94,2.94) <-1.75,0.25>
Total: 103944 W: 26567 L: 26427 D: 50950
Ptnml(0-2): 69, 11640, 28418, 11772, 73
https://tests.stockfishchess.org/tests/view/67955c9a406a4efe9eb7d7e4

closes #5825

Bench: 1839554
  • Loading branch information
Ergodice authored and Disservin committed Jan 26, 2025
1 parent a016abd commit ebdc7ba
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions src/search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1381,23 +1381,21 @@ Value Search::Worker::search(
int bonusScale = (118 * (depth > 5) + 37 * !allNode + 169 * ((ss - 1)->moveCount > 8)
+ 128 * (!ss->inCheck && bestValue <= ss->staticEval - 102)
+ 115 * (!(ss - 1)->inCheck && bestValue <= -(ss - 1)->staticEval - 82)
+ 80 * ((ss - 1)->isTTMove));

// Proportional to "how much damage we have to undo"
bonusScale += std::min(-(ss - 1)->statScore / 106, 318);
+ 80 * ((ss - 1)->isTTMove) + std::min(-(ss - 1)->statScore / 106, 318));

bonusScale = std::max(bonusScale, 0);

const int scaledBonus = stat_bonus(depth) * bonusScale / 32;
const int scaledBonus = stat_bonus(depth) * bonusScale;

update_continuation_histories(ss - 1, pos.piece_on(prevSq), prevSq,
scaledBonus * 436 / 1024);
scaledBonus * 436 / 32768);

thisThread->mainHistory[~us][((ss - 1)->currentMove).from_to()] << scaledBonus * 207 / 1024;
thisThread->mainHistory[~us][((ss - 1)->currentMove).from_to()]
<< scaledBonus * 207 / 32768;

if (type_of(pos.piece_on(prevSq)) != PAWN && ((ss - 1)->currentMove).type_of() != PROMOTION)
thisThread->pawnHistory[pawn_structure_index(pos)][pos.piece_on(prevSq)][prevSq]
<< scaledBonus * 1195 / 1024;
<< scaledBonus * 1195 / 32768;
}

else if (priorCapture && prevSq != SQ_NONE)
Expand Down

0 comments on commit ebdc7ba

Please sign in to comment.