From: Marco Costalba Date: Mon, 10 Dec 2012 08:22:13 +0000 (+0100) Subject: Merge branch 'eval_cache' X-Git-Url: https://git.sesse.net/?p=stockfish;a=commitdiff_plain;h=9edc7d6958fd616daecb0ab9ae2aa92042b3d34a;hp=55db87147237e84a4a2341ca10fb56c1ccfac32c Merge branch 'eval_cache' Unusually good result. Defenitly needs further verifications. After 2160 games at 15"+0.05 Mod vs Orig 486 - 367 - 1307 ELO +19 bench: 6261882 --- diff --git a/Readme.txt b/Readme.txt index ab4eec08..9c80a876 100644 --- a/Readme.txt +++ b/Readme.txt @@ -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 diff --git a/src/position.cpp b/src/position.cpp index a0d5730c..37b5c049 100644 --- a/src/position.cpp +++ b/src/position.cpp @@ -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) diff --git a/src/thread.h b/src/thread.h index 488feeb5..6c3c18af 100644 --- a/src/thread.h +++ b/src/thread.h @@ -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 { diff --git a/src/types.h b/src/types.h index 2219b40b..785d9898 100644 --- a/src/types.h +++ b/src/types.h @@ -35,6 +35,7 @@ /// | only in 64-bit mode. For compiling requires hardware with /// | popcnt support. +#include #include #include #include @@ -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) {