mirror of
https://github.com/HChaZZY/Stockfish.git
synced 2025-12-21 17:46:26 +08:00
Cache evaluation score in qsearch
Instead of just drop evaluation score after stand pat logic save it in TT so to be reused if the same position occurs again. Note that we NEVER use the cached value apart to avoid an evaluation call, in particulary we never return to caller after a succesful tt hit. To accomodate this a new value type VALUE_TYPE_EVAL has been introduced so that ok_to_use_TT() always returns false. With this patch we cut about 15% of total evaluation calls. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
4
src/tt.h
4
src/tt.h
@@ -45,7 +45,7 @@ public:
|
||||
Depth depth() const { return Depth(depth_); }
|
||||
Move move() const { return Move(data & 0x7FFFF); }
|
||||
Value value() const { return Value(value_); }
|
||||
ValueType type() const { return ValueType((data >> 20) & 3); }
|
||||
ValueType type() const { return ValueType((data >> 20) & 7); }
|
||||
int generation() const { return (data >> 23); }
|
||||
|
||||
private:
|
||||
@@ -67,7 +67,7 @@ public:
|
||||
void set_size(unsigned mbSize);
|
||||
void clear();
|
||||
void store(const Position &pos, Value v, Depth d, Move m, ValueType type);
|
||||
const TTEntry* retrieve(const Position &pos) const;
|
||||
TTEntry* retrieve(const Position &pos) const;
|
||||
void new_search();
|
||||
void insert_pv(const Position &pos, Move pv[]);
|
||||
int full();
|
||||
|
||||
Reference in New Issue
Block a user