mirror of
https://github.com/sockspls/badfish
synced 2025-04-29 08:13:08 +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:
parent
28feb2c6b0
commit
02f96fcf5e
3 changed files with 5 additions and 5 deletions
|
@ -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
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -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<NonPV>(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;
|
||||
}
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue