- Value nullValue = -search(pos, ss, -(beta-1), depth-4*OnePly, ply+1, false, threadID);
- pos.undo_null_move(u);
-
- if (nullValue >= beta)
+ int R = (depth >= 4 * OnePly ? 4 : 3); // Null move dynamic reduction
+
+ Value nullValue = -search(pos, ss, -(beta-1), depth-R*OnePly, ply+1, false, threadID);
+
+ // Check for a null capture artifact, if the value without the null capture
+ // is above beta then mark the node as a suspicious failed low. We will verify
+ // later if we are really under threat.
+ if ( UseNullDrivenIID
+ && nullValue < beta
+ && depth > 6 * OnePly
+ &&!value_is_mate(nullValue)
+ && ttMove == MOVE_NONE
+ && ss[ply + 1].currentMove != MOVE_NONE
+ && pos.move_is_capture(ss[ply + 1].currentMove)
+ && pos.see(ss[ply + 1].currentMove) + nullValue >= beta)
+ nullDrivenIID = true;
+
+ pos.undo_null_move();
+
+ if (value_is_mate(nullValue))
+ {
+ /* Do not return unproven mates */
+ }
+ else if (nullValue >= beta)