1
0
Fork 0
mirror of https://github.com/sockspls/badfish synced 2025-05-01 01:03:09 +00:00

Introduce DEPTH_NONE and use it

Also better fix previous patch.

Suggestions by Joona and Ralph.

No functional change.

Signed-off-by: Marco Costalba <mcostalba@gmail.com>
This commit is contained in:
Marco Costalba 2010-07-20 09:16:16 +02:00
parent 28feb2c6b0
commit 02f96fcf5e
3 changed files with 5 additions and 5 deletions

View file

@ -28,7 +28,7 @@
enum Depth { enum Depth {
DEPTH_ZERO = 0, DEPTH_ZERO = 0,
DEPTH_MAX = 200, // 100 * OnePly; DEPTH_MAX = 200, // 100 * OnePly;
DEPTH_ENSURE_SIGNED = -1 DEPTH_NONE = -254 // -127 * OnePly
}; };

View file

@ -1110,7 +1110,7 @@ namespace {
{ {
// Pass ss->eval to qsearch() and avoid an evaluate call // Pass ss->eval to qsearch() and avoid an evaluate call
if (!tte) 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 rbeta = beta - razor_margin(depth);
Value v = qsearch<NonPV>(pos, ss, rbeta-1, rbeta, Depth(0), ply); Value v = qsearch<NonPV>(pos, ss, rbeta-1, rbeta, Depth(0), ply);
@ -1493,7 +1493,7 @@ namespace {
if (bestValue >= beta) if (bestValue >= beta)
{ {
if (!tte) 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; return bestValue;
} }

View file

@ -175,7 +175,7 @@ void TranspositionTable::insert_pv(const Position& pos, Move pv[]) {
if (!tte || tte->move() != pv[i]) if (!tte || tte->move() != pv[i])
{ {
v = (p.is_check() ? VALUE_NONE : evaluate(p, ei)); 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); p.do_move(pv[i], st);
} }