]> git.sesse.net Git - stockfish/commitdiff
Merge branch 'eval_cache'
authorMarco Costalba <mcostalba@gmail.com>
Mon, 10 Dec 2012 08:22:13 +0000 (09:22 +0100)
committerMarco Costalba <mcostalba@gmail.com>
Mon, 10 Dec 2012 08:26:02 +0000 (09:26 +0100)
Unusually good result. Defenitly needs further verifications.

After 2160 games at 15"+0.05
Mod vs Orig 486 - 367 - 1307 ELO +19

bench: 6261882

Readme.txt
src/position.cpp
src/thread.h
src/types.h

index ab4eec082b9125f3eaeeba3dd615cbf8cd34cb0d..9c80a876f641b34c6df424a30cb806fb703cb0c7 100644 (file)
@@ -8,7 +8,7 @@ Partner or Fritz) in order to be used comfortably. Read the
 documentation for your GUI of choice for information about how to use
 Stockfish with it.
 
-This version of Stockfish supports up to 32 CPUs, but has not been
+This version of Stockfish supports up to 64 CPUs, but has not been
 tested thoroughly with more than 4.  The program tries to detect the
 number of CPUs on your computer and sets the number of search threads
 accordingly, but please be aware that the detection is not always
index a0d5730c4e75a427da26930aeed3df681d6e1f49..37b5c049cadd2152b6fdccaee44a87d0f57df315 100644 (file)
@@ -561,7 +561,7 @@ bool Position::is_pseudo_legal(const Move m) const {
       return false;
 
   // The destination square cannot be occupied by a friendly piece
-  if (color_of(piece_on(to)) == us)
+  if (piece_on(to) != NO_PIECE && color_of(piece_on(to)) == us)
       return false;
 
   // Handle the special case of a pawn move
@@ -587,7 +587,7 @@ bool Position::is_pseudo_legal(const Move m) const {
       case DELTA_SE:
       // Capture. The destination square must be occupied by an enemy
       // piece (en passant captures was handled earlier).
-      if (color_of(piece_on(to)) != them)
+      if (piece_on(to) == NO_PIECE || color_of(piece_on(to)) != them)
           return false;
 
       // From and to files must be one file apart, avoids a7h5
@@ -772,7 +772,7 @@ void Position::do_move(Move m, StateInfo& newSt, const CheckInfo& ci, bool moveI
   PieceType capture = type_of(m) == ENPASSANT ? PAWN : type_of(piece_on(to));
 
   assert(color_of(piece) == us);
-  assert(color_of(piece_on(to)) != us);
+  assert(piece_on(to) == NO_PIECE || color_of(piece_on(to)) == them);
   assert(capture != KING);
 
   if (capture)
index 488feeb50053541b45c86bb02db7d151d22934a3..6c3c18affdb0a134b08f4f23cbb87a5a87a40dd6 100644 (file)
@@ -29,7 +29,7 @@
 #include "position.h"
 #include "search.h"
 
-const int MAX_THREADS = 32;
+const int MAX_THREADS = 64; // Because SplitPoint::slavesMask is a uint64_t
 const int MAX_SPLITPOINTS_PER_THREAD = 8;
 
 struct Mutex {
index 2219b40becd8d929e8e73186374e2895b2411e40..785d98986ea39e1cbcab7bbb8e65562ace65efe7 100644 (file)
@@ -35,6 +35,7 @@
 ///               | only in 64-bit mode. For compiling requires hardware with
 ///               | popcnt support.
 
+#include <cassert>
 #include <cctype>
 #include <climits>
 #include <cstdlib>
@@ -391,7 +392,8 @@ inline PieceType type_of(Piece p)  {
 }
 
 inline Color color_of(Piece p) {
-  return p == NO_PIECE ? NO_COLOR : Color(p >> 3);
+  assert(p != NO_PIECE);
+  return Color(p >> 3);
 }
 
 inline bool is_ok(Square s) {