From 02f96fcf5ec82ddf4b94f7992acdfb548a7a218c Mon Sep 17 00:00:00 2001 From: Marco Costalba Date: Tue, 20 Jul 2010 09:16:16 +0200 Subject: [PATCH] Introduce DEPTH_NONE and use it Also better fix previous patch. Suggestions by Joona and Ralph. No functional change. Signed-off-by: Marco Costalba --- src/depth.h | 4 ++-- src/search.cpp | 4 ++-- src/tt.cpp | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/depth.h b/src/depth.h index 05008e05..86af1dff 100644 --- a/src/depth.h +++ b/src/depth.h @@ -27,8 +27,8 @@ enum Depth { DEPTH_ZERO = 0, - DEPTH_MAX = 200, // 100 * OnePly; - DEPTH_ENSURE_SIGNED = -1 + DEPTH_MAX = 200, // 100 * OnePly; + DEPTH_NONE = -254 // -127 * OnePly }; diff --git a/src/search.cpp b/src/search.cpp index 48c06fd3..a3687c07 100644 --- a/src/search.cpp +++ b/src/search.cpp @@ -1110,7 +1110,7 @@ namespace { { // Pass ss->eval to qsearch() and avoid an evaluate call if (!tte) - TT.store(posKey, ss->eval, VALUE_TYPE_EXACT, Depth(-127*OnePly), MOVE_NONE, ss->eval, ei.kingDanger[pos.side_to_move()]); + TT.store(posKey, VALUE_NONE, VALUE_TYPE_NONE, DEPTH_NONE, MOVE_NONE, ss->eval, ei.kingDanger[pos.side_to_move()]); Value rbeta = beta - razor_margin(depth); Value v = qsearch(pos, ss, rbeta-1, rbeta, Depth(0), ply); @@ -1493,7 +1493,7 @@ namespace { if (bestValue >= beta) { if (!tte) - TT.store(pos.get_key(), value_to_tt(bestValue, ply), VALUE_TYPE_LOWER, Depth(-127*OnePly), MOVE_NONE, ss->eval, ei.kingDanger[pos.side_to_move()]); + TT.store(pos.get_key(), value_to_tt(bestValue, ply), VALUE_TYPE_LOWER, DEPTH_NONE, MOVE_NONE, ss->eval, ei.kingDanger[pos.side_to_move()]); return bestValue; } diff --git a/src/tt.cpp b/src/tt.cpp index d2f983c9..1dc97f5d 100644 --- a/src/tt.cpp +++ b/src/tt.cpp @@ -175,7 +175,7 @@ void TranspositionTable::insert_pv(const Position& pos, Move pv[]) { if (!tte || tte->move() != pv[i]) { v = (p.is_check() ? VALUE_NONE : evaluate(p, ei)); - store(p.get_key(), VALUE_NONE, VALUE_TYPE_NONE, Depth(-127*OnePly), pv[i], v, ei.kingDanger[pos.side_to_move()]); + store(p.get_key(), VALUE_NONE, VALUE_TYPE_NONE, DEPTH_NONE, pv[i], v, ei.kingDanger[pos.side_to_move()]); } p.do_move(pv[i], st); } -- 2.39.2