resetting killer and history tables on bench and ucinewgame | bench 1146300
This commit is contained in:
1 parent
572b1686b5
commit
29bac3a101
4 files changed
+16
-5
No files matched your search
@@ -3,6 +3,7 @@
|
|||||||
#include "stopwatch.h"
|
#include "stopwatch.h"
|
||||||
#include "tt.h"
|
#include "tt.h"
|
||||||
#include <array>
|
#include <array>
|
||||||
|
#include <cstring>
|
||||||
|
|
||||||
const std::array<std::string, 50> fenPositions = {
|
const std::array<std::string, 50> fenPositions = {
|
||||||
"rnbq1k1r/ppp1bppp/4pn2/8/2B5/2NP1N2/PPP2PPP/R1BQR1K1 b - - 2 8",
|
"rnbq1k1r/ppp1bppp/4pn2/8/2B5/2NP1N2/PPP2PPP/R1BQR1K1 b - - 2 8",
|
||||||
@@ -62,7 +63,12 @@ void RunBenchmark() {
|
|||||||
int depth = 5;
|
int depth = 5;
|
||||||
benchStarted = true;
|
benchStarted = true;
|
||||||
searchStopped = false;
|
searchStopped = false;
|
||||||
|
|
||||||
|
// Clearing
|
||||||
TT.Clear();
|
TT.Clear();
|
||||||
|
std::memset(killerMoves, 0, sizeof(killerMoves));
|
||||||
|
std::memset(historyMoves, 0, sizeof(historyMoves));
|
||||||
|
|
||||||
nodes = 0;
|
nodes = 0;
|
||||||
|
|
||||||
Stopwatch sw;
|
Stopwatch sw;
|
||||||
|
|||||||
@@ -12,11 +12,6 @@ static inline int ply = 0;
|
|||||||
static inline int timeToSearch = 0;
|
static inline int timeToSearch = 0;
|
||||||
static inline bool doingNullMove = false;
|
static inline bool doingNullMove = false;
|
||||||
|
|
||||||
// [id][ply]
|
|
||||||
static inline int killerMoves[2][64];
|
|
||||||
// [stm][from][to]
|
|
||||||
static inline int historyMoves[2][64][64];
|
|
||||||
|
|
||||||
inline PVLine pvLine;
|
inline PVLine pvLine;
|
||||||
|
|
||||||
Stopwatch sw;
|
Stopwatch sw;
|
||||||
|
|||||||
@@ -13,6 +13,11 @@ constexpr int inf = 100000;
|
|||||||
|
|
||||||
inline bool searchStopped = false;
|
inline bool searchStopped = false;
|
||||||
|
|
||||||
|
// [id][ply]
|
||||||
|
inline int killerMoves[2][64];
|
||||||
|
// [stm][from][to]
|
||||||
|
inline int historyMoves[2][64][64];
|
||||||
|
|
||||||
class SearchResults {
|
class SearchResults {
|
||||||
public:
|
public:
|
||||||
int score = 0;
|
int score = 0;
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
#include "uci.h"
|
#include "uci.h"
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
#include <algorithm>
|
#include <algorithm>
|
||||||
|
#include <cstring>
|
||||||
#include <string>
|
#include <string>
|
||||||
#include <thread>
|
#include <thread>
|
||||||
#include "types.h"
|
#include "types.h"
|
||||||
@@ -112,7 +113,11 @@ void UCILoop(Board &board) {
|
|||||||
// parse UCI "ucinewgame" command
|
// parse UCI "ucinewgame" command
|
||||||
if (input.find("ucinewgame") != std::string::npos) {
|
if (input.find("ucinewgame") != std::string::npos) {
|
||||||
board.SetByFen(StartingFen);
|
board.SetByFen(StartingFen);
|
||||||
|
|
||||||
|
// Clearing
|
||||||
TT.Clear();
|
TT.Clear();
|
||||||
|
std::memset(killerMoves, 0, sizeof(killerMoves));
|
||||||
|
std::memset(historyMoves, 0, sizeof(historyMoves));
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user