- if (nullValue >= beta)
- {
- // Do not return unproven mate scores
- if (nullValue >= VALUE_MATE_IN_MAX_PLY)
- nullValue = beta;
-
- if (depth < 12 * ONE_PLY)
- return nullValue;
-
- // Do verification search at high depths
- ss->skipNullMove = true;
- Value v = search<NonPV>(pos, ss, alpha, beta, depth-R, false);
- ss->skipNullMove = false;
-
- if (v >= beta)
- return nullValue;
- }
- else
- {
- // The null move failed low, which means that we may be faced with
- // some kind of threat. If the previous move was reduced, check if
- // the move that refuted the null move was somehow connected to the
- // move which was reduced. If a connection is found, return a fail
- // low score (which will cause the reduced move to fail high in the
- // parent node, which will trigger a re-search with full depth).
- threatMove = (ss+1)->currentMove;
-
- if ( depth < 5 * ONE_PLY
- && (ss-1)->reduction
- && threatMove != MOVE_NONE
- && allows(pos, (ss-1)->currentMove, threatMove))
- return alpha;
- }