]> git.sesse.net Git - stockfish/blobdiff - src/position.h
Revert odd depths razoring
[stockfish] / src / position.h
index 8e29eb13458390ff2d4a405ffd61cebd794f46ee..e5b5f5aa4a85dd7a2aa2c26222d8c6f2822b477b 100644 (file)
@@ -38,7 +38,6 @@
 #include "direction.h"
 #include "move.h"
 #include "piece.h"
-#include "phase.h"
 #include "square.h"
 #include "value.h"
 
@@ -61,7 +60,7 @@ const int MaxGameLength = 220;
 //// Types
 ////
 
-/// Castle rights, encoded as bit fields:
+/// Castle rights, encoded as bit fields
 
 enum CastleRights {
   NO_CASTLES = 0,
@@ -72,6 +71,12 @@ enum CastleRights {
   ALL_CASTLES = 15
 };
 
+/// Game phase
+enum Phase {
+  PHASE_ENDGAME = 0,
+  PHASE_MIDGAME = 128
+};
+
 
 /// The StateInfo struct stores information we need to restore a Position
 /// object to its previous state when we retract a move. Whenever a move
@@ -312,8 +317,8 @@ private:
   template<PieceType Piece>
   void update_checkers(Bitboard* pCheckersBB, Square ksq, Square from, Square to, Bitboard dcCandidates);
 
-  template<PieceType Piece, bool FindPinned>
-  Bitboard hidden_checks(Color c, Square ksq, Bitboard& pinners) const;
+  template<bool FindPinned>
+  Bitboard hidden_checkers(Color c) const;
 
   // Computing hash keys from scratch (for initialization and debugging)
   Key compute_key() const;
@@ -650,15 +655,9 @@ inline Value Position::non_pawn_material(Color c) const {
 
 inline Phase Position::game_phase() const {
 
-  // The purpose of the Value(325) terms below is to make sure the difference
-  // between MidgameLimit and EndgameLimit is a power of 2, which should make
-  // the division at the end of the function a bit faster.
-  static const Value MidgameLimit =  2 * QueenValueMidgame
-                                   + 2 * RookValueMidgame
-                                   + 6 * BishopValueMidgame
-                                   + Value(325);
-
-  static const Value EndgameLimit = 4 * RookValueMidgame - Value(325);
+  // Values modified by Joona Kiiski
+  static const Value MidgameLimit = Value(15713);
+  static const Value EndgameLimit = Value(4428);
 
   Value npm = non_pawn_material(WHITE) + non_pawn_material(BLACK);