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

Current capture for Counter-Move history

Use current capture to index the CMH table instead of prior capture.

STC:
LLR: 2.96 (-2.94,2.94) [0.00,4.00]
Total: 61908 W: 13626 L: 13220 D: 35062
http://tests.stockfishchess.org/tests/view/5da8aa670ebc597ba8eda558

LTC:
LLR: 2.96 (-2.94,2.94) [0.00,4.00]
Total: 49057 W: 8071 L: 7765 D: 33221
http://tests.stockfishchess.org/tests/view/5da8e99d0ebc597ba8eda9ca

Closes https://github.com/official-stockfish/Stockfish/pull/2362

Bench: 4423737
This commit is contained in:
VoyagerOne 2019-10-18 09:23:00 -04:00 committed by Stéphane Nicolet
parent b8e5092d07
commit 472de897cb

View file

@ -864,12 +864,17 @@ namespace {
&& probCutCount < 2 + 2 * cutNode) && probCutCount < 2 + 2 * cutNode)
if (move != excludedMove && pos.legal(move)) if (move != excludedMove && pos.legal(move))
{ {
assert(pos.capture_or_promotion(move));
assert(depth >= 5);
captureOrPromotion = true;
probCutCount++; probCutCount++;
ss->currentMove = move; ss->currentMove = move;
ss->continuationHistory = &thisThread->continuationHistory[inCheck][priorCapture][pos.moved_piece(move)][to_sq(move)]; ss->continuationHistory = &thisThread->continuationHistory[inCheck]
[captureOrPromotion]
assert(depth >= 5); [pos.moved_piece(move)]
[to_sq(move)];
pos.do_move(move, st); pos.do_move(move, st);
@ -911,7 +916,7 @@ moves_loop: // When in check, search starts from here
countermove, countermove,
ss->killers); ss->killers);
value = bestValue; // Workaround a bogus 'uninitialized' warning under gcc value = bestValue;
moveCountPruning = false; moveCountPruning = false;
ttCapture = ttMove && pos.capture_or_promotion(ttMove); ttCapture = ttMove && pos.capture_or_promotion(ttMove);
@ -1068,7 +1073,10 @@ moves_loop: // When in check, search starts from here
// 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->continuationHistory = &thisThread->continuationHistory[inCheck][priorCapture][movedPiece][to_sq(move)]; ss->continuationHistory = &thisThread->continuationHistory[inCheck]
[captureOrPromotion]
[movedPiece]
[to_sq(move)];
// Step 15. Make the move // Step 15. Make the move
pos.do_move(move, st, givesCheck); pos.do_move(move, st, givesCheck);
@ -1323,7 +1331,7 @@ moves_loop: // When in check, search starts from here
Move ttMove, move, bestMove; Move ttMove, move, bestMove;
Depth ttDepth; Depth ttDepth;
Value bestValue, value, ttValue, futilityValue, futilityBase, oldAlpha; Value bestValue, value, ttValue, futilityValue, futilityBase, oldAlpha;
bool ttHit, pvHit, inCheck, givesCheck, evasionPrunable, priorCapture; bool ttHit, pvHit, inCheck, givesCheck, captureOrPromotion, evasionPrunable;
int moveCount; int moveCount;
if (PvNode) if (PvNode)
@ -1337,7 +1345,6 @@ moves_loop: // When in check, search starts from here
(ss+1)->ply = ss->ply + 1; (ss+1)->ply = ss->ply + 1;
bestMove = MOVE_NONE; bestMove = MOVE_NONE;
inCheck = pos.checkers(); inCheck = pos.checkers();
priorCapture = pos.captured_piece();
moveCount = 0; moveCount = 0;
// Check for an immediate draw or maximum ply reached // Check for an immediate draw or maximum ply reached
@ -1426,6 +1433,7 @@ moves_loop: // When in check, search starts from here
assert(is_ok(move)); assert(is_ok(move));
givesCheck = pos.gives_check(move); givesCheck = pos.gives_check(move);
captureOrPromotion = pos.capture_or_promotion(move);
moveCount++; moveCount++;
@ -1475,7 +1483,10 @@ moves_loop: // When in check, search starts from here
} }
ss->currentMove = move; ss->currentMove = move;
ss->continuationHistory = &thisThread->continuationHistory[inCheck][priorCapture][pos.moved_piece(move)][to_sq(move)]; ss->continuationHistory = &thisThread->continuationHistory[inCheck]
[captureOrPromotion]
[pos.moved_piece(move)]
[to_sq(move)];
// Make and search the move // Make and search the move
pos.do_move(move, st, givesCheck); pos.do_move(move, st, givesCheck);