1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-07-13 04:29:15 +00:00

Shuffle detection #2108

Bench: 3402947
This commit is contained in:
MJZ1977 2019-04-10 12:56:05 +02:00 committed by Marco Costalba
parent 6373fd56e9
commit e89bc30fdc

View file

@ -606,6 +606,15 @@ namespace {
: ttHit ? tte->move() : MOVE_NONE; : ttHit ? tte->move() : MOVE_NONE;
ttPv = (ttHit && tte->is_pv()) || (PvNode && depth > 4 * ONE_PLY); ttPv = (ttHit && tte->is_pv()) || (PvNode && depth > 4 * ONE_PLY);
// If position has been searched at higher depths and we are shuffling,
// return value_draw.
if ( pos.rule50_count() > 36 - 6 * (pos.count<ALL_PIECES>() > 14)
&& ss->ply > 36 - 6 * (pos.count<ALL_PIECES>() > 14)
&& ttHit
&& tte->depth() > depth
&& pos.count<PAWN>() > 0)
return VALUE_DRAW;
// At non-PV nodes we check for an early TT cutoff // At non-PV nodes we check for an early TT cutoff
if ( !PvNode if ( !PvNode
&& ttHit && ttHit
@ -927,6 +936,14 @@ moves_loop: // When in check, search starts from here
else if (type_of(move) == CASTLING) else if (type_of(move) == CASTLING)
extension = ONE_PLY; extension = ONE_PLY;
// Shuffle extension
else if ( PvNode
&& pos.rule50_count() > 18
&& ss->ply > 18
&& depth < 3 * ONE_PLY
&& ss->ply < 3 * thisThread->rootDepth / ONE_PLY) // To avoid infinite loops
extension = ONE_PLY;
// Passed pawn extension // Passed pawn extension
else if ( move == ss->killers[0] else if ( move == ss->killers[0]
&& pos.advanced_pawn_push(move) && pos.advanced_pawn_push(move)