]> git.sesse.net Git - stockfish/commitdiff
Refine "few moves" in "last minute surprise"
authorMarco Costalba <mcostalba@gmail.com>
Mon, 27 Oct 2008 08:28:14 +0000 (09:28 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Sat, 1 Nov 2008 11:46:51 +0000 (12:46 +0100)
It seems that "few moves" works because we extend the good
captures at the last ply of PV, so code it directly.

This version seems defenitly stronger then previous one.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
src/movepick.h
src/search.cpp

index 66518ac76861fff4d34a41078e89fa690631100d..5a38826188811eb634f053d5cd3396760325d69f 100644 (file)
@@ -7,11 +7,7 @@
   it under the terms of the GNU General Public License as published by
   the Free Software Foundation, either version 3 of the License, or
   (at your option) any later version.
-<<<<<<< HEAD:src/movepick.h
 
-=======
-  
->>>>>>> d3600c39a745179ed6b094b305d0645e83a1ee86:src/movepick.h
   Stockfish is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
@@ -54,7 +50,7 @@ public:
     PH_TT_MOVE,        // Transposition table move
     PH_MATE_KILLER,    // Mate killer from the current ply
     PH_GOOD_CAPTURES,  // Queen promotions and captures with SEE values >= 0
-    PH_BAD_CAPTURES,   // Queen promotions and captures with SEE valuse <= 0
+    PH_BAD_CAPTURES,   // Queen promotions and captures with SEE values < 0
     PH_KILLER_1,       // Killer move 1 from the current ply (not used yet).
     PH_KILLER_2,       // Killer move 2 from the current ply (not used yet).
     PH_NONCAPTURES,    // Non-captures and underpromotions
index f29041847c0ae033cc4b25d403f266fc633a15f5..fca3d2c9dbc431a89f1acdf9e764fa0f18ada6fd 100644 (file)
@@ -931,7 +931,7 @@ namespace {
     {
       assert(move_is_ok(move));
 
-      bool fewMoves = (depth <= OnePly && mp.number_of_moves() < 4);
+      bool lastMinuteSurprise = (depth <= OnePly && mp.current_move_type() == MovePicker::PH_GOOD_CAPTURES);
       bool singleReply = (pos.is_check() && mp.number_of_moves() == 1);
       bool moveIsCheck = pos.move_is_check(move, dcCandidates);
       bool moveIsCapture = pos.move_is_capture(move);
@@ -943,7 +943,7 @@ namespace {
         PawnValueMidgame : pos.midgame_value_of_piece_on(move_to(move));
 
       // Decide the new search depth
-      Depth ext = extension(pos, move, true, moveIsCheck, singleReply || fewMoves, mateThreat);
+      Depth ext = extension(pos, move, true, moveIsCheck, singleReply || lastMinuteSurprise, mateThreat);
       Depth newDepth = depth - OnePly + ext;
 
       // Make and search the move