1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-04-29 16:23:09 +00:00

Simplify Prior Capture Countermove Bonus

Passed Non-regression STC:
LLR: 2.94 (-2.94,2.94) <-1.75,0.25>
Total: 184032 W: 47626 L: 47568 D: 88838
Ptnml(0-2): 590, 21808, 47238, 21714, 666
https://tests.stockfishchess.org/tests/view/67412c7686d5ee47d953f743

Passed Non-regression LTC:
LLR: 2.96 (-2.94,2.94) <-1.75,0.25>
Total: 169218 W: 43395 L: 43323 D: 82500
Ptnml(0-2): 302, 18567, 46791, 18655, 294
https://tests.stockfishchess.org/tests/view/6743b7e086d5ee47d953f9a6

closes https://github.com/official-stockfish/Stockfish/pull/5701

Bench: 1130692
This commit is contained in:
Shawn Xu 2024-11-22 17:13:00 -08:00 committed by Disservin
parent 1f9404434d
commit 6a8478c6ad
2 changed files with 6 additions and 9 deletions

View file

@ -888,8 +888,7 @@ Value Search::Worker::search(
// Prefetch the TT entry for the resulting position // Prefetch the TT entry for the resulting position
prefetch(tt.first_entry(pos.key_after(move))); prefetch(tt.first_entry(pos.key_after(move)));
ss->currentMove = move; ss->currentMove = move;
ss->capturedPiece = captured;
ss->continuationHistory = ss->continuationHistory =
&this->continuationHistory[ss->inCheck][true][pos.moved_piece(move)][move.to_sq()]; &this->continuationHistory[ss->inCheck][true][pos.moved_piece(move)][move.to_sq()];
ss->continuationCorrectionHistory = ss->continuationCorrectionHistory =
@ -1138,8 +1137,7 @@ moves_loop: // When in check, search starts here
prefetch(tt.first_entry(pos.key_after(move))); prefetch(tt.first_entry(pos.key_after(move)));
// Update the current move (this must be done after singular extension search) // Update the current move (this must be done after singular extension search)
ss->currentMove = move; ss->currentMove = move;
ss->capturedPiece = pos.piece_on(move.to_sq());
ss->continuationHistory = ss->continuationHistory =
&thisThread->continuationHistory[ss->inCheck][capture][movedPiece][move.to_sq()]; &thisThread->continuationHistory[ss->inCheck][capture][movedPiece][move.to_sq()];
ss->continuationCorrectionHistory = ss->continuationCorrectionHistory =
@ -1403,7 +1401,8 @@ moves_loop: // When in check, search starts here
else if (priorCapture && prevSq != SQ_NONE) else if (priorCapture && prevSq != SQ_NONE)
{ {
// bonus for prior countermoves that caused the fail low // bonus for prior countermoves that caused the fail low
Piece capturedPiece = (ss - 1)->capturedPiece; Piece capturedPiece = pos.captured_piece();
assert(capturedPiece != NO_PIECE);
thisThread->captureHistory[pos.piece_on(prevSq)][prevSq][type_of(capturedPiece)] thisThread->captureHistory[pos.piece_on(prevSq)][prevSq][type_of(capturedPiece)]
<< stat_bonus(depth) * 2; << stat_bonus(depth) * 2;
} }
@ -1653,8 +1652,7 @@ Value Search::Worker::qsearch(Position& pos, Stack* ss, Value alpha, Value beta)
prefetch(tt.first_entry(pos.key_after(move))); prefetch(tt.first_entry(pos.key_after(move)));
// Update the current move // Update the current move
ss->currentMove = move; ss->currentMove = move;
ss->capturedPiece = pos.piece_on(move.to_sq());
ss->continuationHistory = ss->continuationHistory =
&thisThread &thisThread
->continuationHistory[ss->inCheck][capture][pos.moved_piece(move)][move.to_sq()]; ->continuationHistory[ss->inCheck][capture][pos.moved_piece(move)][move.to_sq()];

View file

@ -66,7 +66,6 @@ struct Stack {
CorrectionHistory<PieceTo>* continuationCorrectionHistory; CorrectionHistory<PieceTo>* continuationCorrectionHistory;
int ply; int ply;
Move currentMove; Move currentMove;
Piece capturedPiece;
Move excludedMove; Move excludedMove;
Value staticEval; Value staticEval;
int statScore; int statScore;
@ -357,4 +356,4 @@ class Worker {
} // namespace Stockfish } // namespace Stockfish
#endif // #ifndef SEARCH_H_INCLUDED #endif // #ifndef SEARCH_H_INCLUDED