Skip to content

Commit

Permalink
Add extra bonus to pawn history for a move that caused a fail low
Browse files Browse the repository at this point in the history
Basically the same idea as it is for continuation/main history, but it
has some tweaks.
1) it has * 2 multiplier for bonus instead of full/half bonus - for
   whatever reason this seems to work better;
2) attempts with this type of big bonuses scaled somewhat poorly (or
   were unlucky at longer time controls), but after measuring the fact
   that average value of pawn history in LMR after adding this bonuses
   increased by substantial number (for multiplier 1,5 it increased by
   smth like 400~ from 8192 cap) attempts were made to make default pawn
   history negative to compensate it - and version with multiplier 2 and
   initial fill value -900 passed.

Passed STC:
https://tests.stockfishchess.org/tests/view/66424815f9f4e8fc783cba59
LLR: 2.93 (-2.94,2.94) <0.00,2.00>
Total: 115008 W: 30001 L: 29564 D: 55443
Ptnml(0-2): 432, 13629, 28903, 14150, 390

Passed LTC:
https://tests.stockfishchess.org/tests/view/6642f5437134c82f3f7a3ffa
LLR: 2.94 (-2.94,2.94) <0.50,2.50>
Total: 56448 W: 14432 L: 14067 D: 27949
Ptnml(0-2): 36, 6268, 15254, 6627, 39

Bench: 1857237
  • Loading branch information
Vizvezdenec authored and Disservin committed May 15, 2024
1 parent fa11426 commit 9e45644
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ void Search::Worker::clear() {
counterMoves.fill(Move::none());
mainHistory.fill(0);
captureHistory.fill(0);
pawnHistory.fill(0);
pawnHistory.fill(-900);
correctionHistory.fill(0);

for (bool inCheck : {false, true})
Expand Down Expand Up @@ -1335,6 +1335,11 @@ Value Search::Worker::search(
stat_bonus(depth) * bonus);
thisThread->mainHistory[~us][((ss - 1)->currentMove).from_to()]
<< stat_bonus(depth) * bonus / 2;


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]
<< stat_bonus(depth) * bonus * 2;
}

if (PvNode)
Expand Down

0 comments on commit 9e45644

Please sign in to comment.