- ss[sp->ply].reduction = reduction<PvNode>(sp->depth, moveCount);
- if (ss[sp->ply].reduction)
+ ss->reduction = reduction<PvNode>(sp->depth, moveCount);
+ if (ss->reduction)
+ {
+ Value localAlpha = sp->alpha;
+ value = -search<NonPV>(pos, ss+1, -(localAlpha+1), -localAlpha, newDepth-ss->reduction, sp->ply+1, true, threadID);
+ doFullDepthSearch = (value > localAlpha);
+ }
+
+ // The move failed high, but if reduction is very big we could
+ // face a false positive, retry with a less aggressive reduction,
+ // if the move fails high again then go with full depth search.
+ if (doFullDepthSearch && ss->reduction > 2 * OnePly)