]> git.sesse.net Git - stockfish/commitdiff
Better document fail-high condition
authorMarco Costalba <mcostalba@gmail.com>
Sat, 17 Nov 2012 11:44:19 +0000 (12:44 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Sat, 17 Nov 2012 11:50:10 +0000 (12:50 +0100)
At this point we have already verified (value > alpha)
and this implies, in case of a non-PV node, where search
window size is zero, that value >= beta.

This is not so self-evident, so document the code with
an assert condition.

No functional change.

src/search.cpp

index c80a064dfde82ba15f1eb98550d9eda5ebf11107..4915b502848f746a211063562724a48a7d54d4dd 100644 (file)
@@ -1003,8 +1003,10 @@ split_point_start: // At split points actual search starts from here
                   alpha = value; // Update alpha here! Always alpha < beta
                   if (SpNode) sp->alpha = value;
               }
-              else // Fail high
+              else
               {
+                  assert(value >= beta); // Fail high
+
                   if (SpNode) sp->cutoff = true;
                   break;
               }