]> git.sesse.net Git - stockfish/blobdiff - src/position.cpp
Fix early stop condition
[stockfish] / src / position.cpp
index 982befa35dacf71960f2d1bea539c7eccd2eb297..755e22d85a7c9317d2682f5838fda4b6bfd6a11c 100644 (file)
@@ -1,7 +1,7 @@
 /*
   Stockfish, a UCI chess playing engine derived from Glaurung 2.1
   Copyright (C) 2004-2008 Tord Romstad (Glaurung author)
-  Copyright (C) 2008-2013 Marco Costalba, Joona Kiiski, Tord Romstad
+  Copyright (C) 2008-2014 Marco Costalba, Joona Kiiski, Tord Romstad
 
   Stockfish is free software: you can redistribute it and/or modify
   it under the terms of the GNU General Public License as published by
@@ -614,7 +614,7 @@ bool Position::pseudo_legal(const Move m) const {
 }
 
 
-/// Position::move_gives_check() tests whether a pseudo-legal move gives a check
+/// Position::gives_check() tests whether a pseudo-legal move gives a check
 
 bool Position::gives_check(Move m, const CheckInfo& ci) const {
 
@@ -1011,10 +1011,7 @@ void Position::undo_null_move() {
 
 
 /// Position::see() is a static exchange evaluator: It tries to estimate the
-/// material gain or loss resulting from a move. Parameter 'asymmThreshold' takes
-/// tempi into account. If the side who initiated the capturing sequence does the
-/// last capture, he loses a tempo and if the result is below 'asymmThreshold'
-/// the capturing sequence is considered bad.
+/// material gain or loss resulting from a move.
 
 int Position::see_sign(Move m) const {
 
@@ -1029,7 +1026,7 @@ int Position::see_sign(Move m) const {
   return see(m);
 }
 
-int Position::see(Move m, int asymmThreshold) const {
+int Position::see(Move m) const {
 
   Square from, to;
   Bitboard occupied, attackers, stmAttackers;
@@ -1096,15 +1093,6 @@ int Position::see(Move m, int asymmThreshold) const {
 
   } while (stmAttackers);
 
-  // If we are doing asymmetric SEE evaluation and the same side does the first
-  // and the last capture, it loses a tempo and gain must be at least worth
-  // 'asymmThreshold', otherwise we replace the score with a very low value,
-  // before negamaxing.
-  if (asymmThreshold)
-      for (int i = 0; i < slIndex; i += 2)
-          if (swapList[i] < asymmThreshold)
-              swapList[i] = - QueenValueMg * 16;
-
   // Having built the swap list, we negamax through it to find the best
   // achievable score from the point of view of the side to move.
   while (--slIndex)