mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-23 10:36:26 +08:00
Restore deterministic search state
Introduce helper function Search::reset() which clears all kind of search memory, in order to restore a deterministic search state. Generalize TT.clear() into Search::reset() for the following use cases: - bench: needed to guarantee deterministic bench (ie. if you call bench from interactive command line twice in a row you get the same value). - Clear Hash: restore clean search state, which is the purpose of this button. - ucinewgame: ditto. No functional change. Resolves #346
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
#define MOVEPICK_H_INCLUDED
|
||||
|
||||
#include <algorithm> // For std::max
|
||||
#include <cstring> // For std::memset
|
||||
|
||||
#include "movegen.h"
|
||||
#include "position.h"
|
||||
@@ -43,6 +44,7 @@ struct Stats {
|
||||
|
||||
const T* operator[](Piece pc) const { return table[pc]; }
|
||||
T* operator[](Piece pc) { return table[pc]; }
|
||||
void clear() { std::memset(table, 0, sizeof(table)); }
|
||||
|
||||
void update(Piece pc, Square to, Move m) {
|
||||
|
||||
|
||||
Reference in New Issue
Block a user