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

Evasion Pruning Tweak

Use moveCount to decide when to prune for evasion pruning

STC:
LLR: 2.95 (-2.94,2.94) [0.00,5.00]
Total: 24476 W: 4518 L: 4289 D: 15669

LTC:
LLR: 2.96 (-2.94,2.94) [0.00,5.00]
Total: 18362 W: 2476 L: 2298 D: 13588

Bench: 6469989

Closes #1120
This commit is contained in:
VoyagerOne 2017-05-21 18:25:20 -07:00 committed by Joona Kiiski
parent c216dcbe7b
commit 1d31065e1d

View file

@ -1165,6 +1165,7 @@ moves_loop: // When in check search starts from here
Value bestValue, value, ttValue, futilityValue, futilityBase, oldAlpha; Value bestValue, value, ttValue, futilityValue, futilityBase, oldAlpha;
bool ttHit, givesCheck, evasionPrunable; bool ttHit, givesCheck, evasionPrunable;
Depth ttDepth; Depth ttDepth;
int moveCount;
if (PvNode) if (PvNode)
{ {
@ -1175,6 +1176,7 @@ moves_loop: // When in check search starts from here
ss->currentMove = bestMove = MOVE_NONE; ss->currentMove = bestMove = MOVE_NONE;
ss->ply = (ss-1)->ply + 1; ss->ply = (ss-1)->ply + 1;
moveCount = 0;
// Check for an instant draw or if the maximum ply has been reached // Check for an instant draw or if the maximum ply has been reached
if (pos.is_draw(ss->ply) || ss->ply >= MAX_PLY) if (pos.is_draw(ss->ply) || ss->ply >= MAX_PLY)
@ -1258,6 +1260,8 @@ moves_loop: // When in check search starts from here
? pos.check_squares(type_of(pos.piece_on(from_sq(move)))) & to_sq(move) ? pos.check_squares(type_of(pos.piece_on(from_sq(move)))) & to_sq(move)
: pos.gives_check(move); : pos.gives_check(move);
moveCount++;
// Futility pruning // Futility pruning
if ( !InCheck if ( !InCheck
&& !givesCheck && !givesCheck
@ -1283,7 +1287,7 @@ moves_loop: // When in check search starts from here
// Detect non-capture evasions that are candidates to be pruned // Detect non-capture evasions that are candidates to be pruned
evasionPrunable = InCheck evasionPrunable = InCheck
&& depth != DEPTH_ZERO && (depth != DEPTH_ZERO || moveCount > 2)
&& bestValue > VALUE_MATED_IN_MAX_PLY && bestValue > VALUE_MATED_IN_MAX_PLY
&& !pos.capture(move); && !pos.capture(move);
@ -1298,7 +1302,10 @@ moves_loop: // When in check search starts from here
// Check for legality just before making the move // Check for legality just before making the move
if (!pos.legal(move)) if (!pos.legal(move))
{
moveCount--;
continue; continue;
}
ss->currentMove = move; ss->currentMove = move;