]> git.sesse.net Git - stockfish/blobdiff - src/position.cpp
Document asymmetric SEE pruning trick
[stockfish] / src / position.cpp
index 88ef25d2c819a195e4eb2d5df8c7c22bfb279a2d..1b2defa54662a34718bb46c79e40ae9abffbe595 100644 (file)
@@ -1151,6 +1151,11 @@ int Position::see(Move m) const {
   return do_see<false>(m, 0);
 }
 
   return do_see<false>(m, 0);
 }
 
+/// Position::see_asymm() takes tempi into account.
+/// If the side who initiated the capturing sequence does the last capture,
+/// he loses a tempo. In this case if the result is below asymmThreshold 
+/// the capturing sequence is considered bad.
+
 int Position::see_asymm(Move m, int asymmThreshold) const
 {
   return do_see<true>(m, asymmThreshold);
 int Position::see_asymm(Move m, int asymmThreshold) const
 {
   return do_see<true>(m, asymmThreshold);
@@ -1234,7 +1239,9 @@ int Position::do_see(Move m, int asymmThreshold) const {
 
   } while (stmAttackers);
 
 
   } while (stmAttackers);
 
-  // FIXME: Document
+  // If we are doing asymmetric SEE evaluation and the same side does the first
+  // and the last capture, he loses a tempo and gain must be at least worth "asymmThreshold".
+  // If not, we replace the score with a very low value, before negamaxing.
   if (Asymmetric)
   {
       for (int i = 0; i < slIndex ; i += 2)
   if (Asymmetric)
   {
       for (int i = 0; i < slIndex ; i += 2)