mirror of
https://github.com/official-stockfish/Stockfish.git
synced 2026-07-25 14:17:13 +00:00
Lookup TT for eval also in PV nodes
We don't need to evaluate the position if it is already cached in TT. We already do this in non-PV case. No functional change. Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
+3
-3
@@ -1025,8 +1025,8 @@ namespace {
|
|||||||
// search<>() is the main search function for both PV and non-PV nodes
|
// search<>() is the main search function for both PV and non-PV nodes
|
||||||
|
|
||||||
template <NodeType PvNode>
|
template <NodeType PvNode>
|
||||||
Value search(Position& pos, SearchStack ss[], Value alpha, Value beta,
|
Value search(Position& pos, SearchStack ss[], Value alpha, Value beta, Depth depth,
|
||||||
Depth depth, int ply, bool allowNullmove, int threadID, Move excludedMove) {
|
int ply, bool allowNullmove, int threadID, Move excludedMove) {
|
||||||
|
|
||||||
assert(alpha >= -VALUE_INFINITE && alpha <= VALUE_INFINITE);
|
assert(alpha >= -VALUE_INFINITE && alpha <= VALUE_INFINITE);
|
||||||
assert(beta > alpha && beta <= VALUE_INFINITE);
|
assert(beta > alpha && beta <= VALUE_INFINITE);
|
||||||
@@ -1098,7 +1098,7 @@ namespace {
|
|||||||
isCheck = pos.is_check();
|
isCheck = pos.is_check();
|
||||||
if (!isCheck)
|
if (!isCheck)
|
||||||
{
|
{
|
||||||
if (!PvNode && tte && (tte->type() & VALUE_TYPE_EVAL))
|
if (tte && (tte->type() & VALUE_TYPE_EVAL))
|
||||||
ss[ply].eval = value_from_tt(tte->value(), ply);
|
ss[ply].eval = value_from_tt(tte->value(), ply);
|
||||||
else
|
else
|
||||||
ss[ply].eval = evaluate(pos, ei, threadID);
|
ss[ply].eval = evaluate(pos, ei, threadID);
|
||||||
|
|||||||
Reference in New Issue
Block a user