]> git.sesse.net Git - stockfish/commitdiff
Document asymmetric SEE pruning trick
authorJoona Kiiski <joona.kiiski@gmail.com>
Tue, 9 Apr 2013 08:20:10 +0000 (09:20 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Tue, 9 Apr 2013 21:31:57 +0000 (23:31 +0200)
Here are the tests:

sprt @ 60+0.05
ELO: 3.53 +-2.8 (95%) LOS: 99.3%
Total: 18794 W: 3098 L: 2907 D: 12789

16000 @ 60+0.05
ELO: 1.39 +-3.1 (95%) LOS: 81.0%
Total: 16000 W: 2689 L: 2625 D: 10686

16000 @ 15+0.05
ELO: 2.82 +-3.3 (95%) LOS: 95.1%
Total: 16000 W: 3148 L: 3018 D: 9834

No functional change

Signature: 4969307

src/position.cpp
src/position.h
src/search.cpp

index 88ef25d2c819a195e4eb2d5df8c7c22bfb279a2d..1b2defa54662a34718bb46c79e40ae9abffbe595 100644 (file)
@@ -1151,6 +1151,11 @@ int Position::see(Move m) const {
   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);
@@ -1234,7 +1239,9 @@ int Position::do_see(Move m, int asymmThreshold) const {
 
   } 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)
index 2ad9294fc896e0fd2518c9122c846c8fe00a56db..0951b4669cd28ee61d32771a602d68a484d95de4 100644 (file)
@@ -161,7 +161,6 @@ public:
   int see(Move m) const;
   int see_sign(Move m) const;
   int see_asymm(Move m, int asymmThreshold) const;
-  template <bool Asymmetric> int do_see(Move m, int asymmThreshold) const; //FIXME: private!!
 
   // Accessing hash keys
   Key key() const;
@@ -195,6 +194,7 @@ private:
 
   // Helper functions
   void do_castle(Square kfrom, Square kto, Square rfrom, Square rto);
+  template<bool Asymmetric> int do_see(Move m, int asymmThreshold) const;
   template<bool FindPinned> Bitboard hidden_checkers() const;
 
   // Computing hash keys from scratch (for initialization and debugging)
index 1abe022aacefa580d699131310127c8a7910437f..5abbafbcbfcd8b756dbf481efdffff9187e78016 100644 (file)
@@ -1225,7 +1225,8 @@ split_point_start: // At split points actual search starts from here
               continue;
           }
 
-          // Prune moves with negative or equal SEE
+          // Prune moves with negative or equal SEE.
+          // Also prune moves with positive SEE where capturing loses a tempo and SEE < beta - futilityBase.
           if (   futilityBase < beta
               && depth < DEPTH_ZERO
               && pos.see_asymm(move, beta - futilityBase) <= 0)