]> git.sesse.net Git - stockfish/commitdiff
Use Movepick SEE value in search
authorMarco Costalba <mcostalba@gmail.com>
Fri, 9 Sep 2016 06:38:44 +0000 (08:38 +0200)
committerMarco Costalba <mcostalba@gmail.com>
Fri, 9 Sep 2016 15:11:54 +0000 (17:11 +0200)
This halves the calls to the costly pos.see_sign(),
speed up is about 1-1.3%

Non functional change.

src/movepick.cpp
src/movepick.h
src/search.cpp

index 78765beccabc228f0a8c8346866866b061a0d700..4971b304ba0c12f550151564ba0fe5c038c5c61c 100644 (file)
@@ -243,6 +243,11 @@ void MovePicker::generate_next_stage() {
   }
 }
 
+int MovePicker::see_sign() const
+{
+  return  stage == GOOD_CAPTURES ?  1
+        : stage == BAD_CAPTURES  ? -1 : 0;
+}
 
 /// next_move() is the most important method of the MovePicker class. It returns
 /// a new pseudo legal move every time it is called, until there are no more moves
index 8028d487f3f5803418f22f12b4b5dbf116cc947f..e69255e604b117f38e1900b397fff43ec159e398 100644 (file)
@@ -104,6 +104,7 @@ public:
   MovePicker(const Position&, Move, Depth, Search::Stack*);
 
   Move next_move();
+  int see_sign() const;
 
 private:
   template<GenType> void score();
index 6182d9c57068b59b071fa0336bd2830211ae97f9..1d930dd540d160bfaa1c1aad948f0315c7dcf877 100644 (file)
@@ -958,7 +958,8 @@ moves_loop: // When in check search starts from here
               }
           }
           else if (   depth < 3 * ONE_PLY
-                   && pos.see_sign(move) < VALUE_ZERO)
+                   && (     mp.see_sign() < 0
+                       || (!mp.see_sign() && pos.see_sign(move) < VALUE_ZERO)))
               continue;
       }