resetting killer and history tables on bench and ucinewgame | bench 1146300

This commit is contained in:
rektdie committed 2025-03-15 13:04:03 +01:00
1 parent 572b1686b5
commit 29bac3a101
4 files changed
+16 -5

No files matched your search

+6
View File
@@ -3,6 +3,7 @@
#include "stopwatch.h"
#include "tt.h"
#include <array>
#include <cstring>
const std::array<std::string, 50> fenPositions = {
"rnbq1k1r/ppp1bppp/4pn2/8/2B5/2NP1N2/PPP2PPP/R1BQR1K1 b - - 2 8",
@@ -62,7 +63,12 @@ void RunBenchmark() {
int depth = 5;
benchStarted = true;
searchStopped = false;
// Clearing
TT.Clear();
std::memset(killerMoves, 0, sizeof(killerMoves));
std::memset(historyMoves, 0, sizeof(historyMoves));
nodes = 0;
Stopwatch sw;
-5
View File
@@ -12,11 +12,6 @@ static inline int ply = 0;
static inline int timeToSearch = 0;
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;
Stopwatch sw;
+5
View File
@@ -13,6 +13,11 @@ constexpr int inf = 100000;
inline bool searchStopped = false;
// [id][ply]
inline int killerMoves[2][64];
// [stm][from][to]
inline int historyMoves[2][64][64];
class SearchResults {
public:
int score = 0;
+5
View File
@@ -1,6 +1,7 @@
#include "uci.h"
#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <thread>
#include "types.h"
@@ -112,7 +113,11 @@ void UCILoop(Board &board) {
// parse UCI "ucinewgame" command
if (input.find("ucinewgame") != std::string::npos) {
board.SetByFen(StartingFen);
// Clearing
TT.Clear();
std::memset(killerMoves, 0, sizeof(killerMoves));
std::memset(historyMoves, 0, sizeof(historyMoves));
continue;
}