Skip to content

Commit

Permalink
Refine statscore for captures
Browse files Browse the repository at this point in the history
Continuation of previous attempts there.
Now instead of using capture history with a static offset also add the
value of the captured piece in the same way at it is used in movepicker.

Passed STC:
https://tests.stockfishchess.org/tests/view/674aa3d386d5ee47d95404aa
LLR: 2.93 (-2.94,2.94) <0.00,2.00>
Total: 116480 W: 30433 L: 29999 D: 56048
Ptnml(0-2): 361, 13720, 29662, 14118, 379

Passed LTC:
https://tests.stockfishchess.org/tests/view/674c4b2d86d5ee47d954073f
LLR: 2.94 (-2.94,2.94) <0.50,2.50>
Total: 133542 W: 34365 L: 33847 D: 65330
Ptnml(0-2): 78, 14585, 36934, 15089, 85

closes #5706

Bench: 934447
  • Loading branch information
Vizvezdenec authored and Disservin committed Dec 8, 2024
1 parent e8d2ba1 commit afaf3a0
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/search.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1180,7 +1180,10 @@ Value Search::Worker::search(
r -= 1879;

if (capture)
ss->statScore = 0;
ss->statScore =
7 * int(PieceValue[pos.captured_piece()])
+ thisThread->captureHistory[movedPiece][move.to_sq()][type_of(pos.captured_piece())]
- 5000;
else
ss->statScore = 2 * thisThread->mainHistory[us][move.from_to()]
+ (*contHist[0])[movedPiece][move.to_sq()]
Expand Down

0 comments on commit afaf3a0

Please sign in to comment.