Subversion Repositories Games.Chess Giants

Rev

Rev 96 | Rev 169 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 96 Rev 154
Line 74... Line 74...
74
  "8/8/1P6/5pr1/8/4R3/7k/2K5 w - - 0 1",   // Re5 - mate
74
  "8/8/1P6/5pr1/8/4R3/7k/2K5 w - - 0 1",   // Re5 - mate
75
  "8/2p4P/8/kr6/6R1/8/8/1K6 w - - 0 1",    // Ka2 - mate
75
  "8/2p4P/8/kr6/6R1/8/8/1K6 w - - 0 1",    // Ka2 - mate
76
  "8/8/3P3k/8/1p6/8/1P6/1K3n2 b - - 0 1",  // Nd2 - draw
76
  "8/8/3P3k/8/1p6/8/1P6/1K3n2 b - - 0 1",  // Nd2 - draw
77
 
77
 
78
  // 7-man positions
78
  // 7-man positions
79
  "8/R7/2q5/8/6k1/8/1P5p/K6R w - - 0 124"  // Draw
79
  "8/R7/2q5/8/6k1/8/1P5p/K6R w - - 0 124", // Draw
-
 
80
 
-
 
81
  // Mate and stalemate positions
-
 
82
  "8/8/8/8/8/6k1/6p1/6K1 w - -",
-
 
83
  "5k2/5P2/5K2/8/8/8/8/8 b - -",
-
 
84
  "8/8/8/8/8/4k3/4p3/4K3 w - -",
-
 
85
  "8/8/8/8/8/5K2/8/3Q1k2 b - -",
-
 
86
  "7k/7P/6K1/8/3B4/8/8/8 b - -"
80
};
87
};
81
 
88
 
82
} // namespace
89
} // namespace
83
 
90
 
84
/// benchmark() runs a simple benchmark by letting Stockfish analyze a set
91
/// benchmark() runs a simple benchmark by letting Stockfish analyze a set
Line 142... Line 149...
142
      file.close();
149
      file.close();
143
  }
150
  }
144
 
151
 
145
  uint64_t nodes = 0;
152
  uint64_t nodes = 0;
146
  TimePoint elapsed = now();
153
  TimePoint elapsed = now();
-
 
154
  Position pos;
147
 
155
 
148
  for (size_t i = 0; i < fens.size(); ++i)
156
  for (size_t i = 0; i < fens.size(); ++i)
149
  {
157
  {
-
 
158
      StateListPtr states(new std::deque<StateInfo>(1));
150
      Position pos(fens[i], Options["UCI_Chess960"], Threads.main());
159
      pos.set(fens[i], Options["UCI_Chess960"], &states->back(), Threads.main());
151
 
160
 
152
      cerr << "\nPosition: " << i + 1 << '/' << fens.size() << endl;
161
      cerr << "\nPosition: " << i + 1 << '/' << fens.size() << endl;
153
 
162
 
154
      if (limitType == "perft")
163
      if (limitType == "perft")
155
          nodes += Search::perft(pos, limits.depth * ONE_PLY);
164
          nodes += Search::perft(pos, limits.depth * ONE_PLY);
156
 
165
 
157
      else
166
      else
158
      {
167
      {
159
          Search::StateStackPtr st;
-
 
160
          limits.startTime = now();
168
          limits.startTime = now();
161
          Threads.start_thinking(pos, limits, st);
169
          Threads.start_thinking(pos, states, limits);
162
          Threads.main()->wait_for_search_finished();
170
          Threads.main()->wait_for_search_finished();
163
          nodes += Threads.nodes_searched();
171
          nodes += Threads.nodes_searched();
164
      }
172
      }
165
  }
173
  }
166
 
174