fruity wrote:
I'm currently running a 60,000 games match at 2'', SF default against my final proposal.
40,000 games have been already played and my proposal is +5 Elo ahead.
The only differences compared to what Marco Costalba had posted finally are
(1) I use TT hits for pruning also in qsearch() in PV case
(2) I accept mate(d) values in PV case (if tte->depth() < depth)
(3) I use "inline bool ok_to_use_TT<PvNode>(....)" for clean and fast code.
Code snippets and test result later.
Result: +16426 -15522 =28052
function signature
Code: Select all
template <NodeType PvNode>
bool ok_to_use_TT(const TTEntry* tte, Depth depth, Value alpha, Value beta, int ply);
function def
Code: Select all
template <NodeType PvNode>
inline bool ok_to_use_TT(const TTEntry* tte, Depth depth, Value alpha, Value beta, int ply) {
Value v = value_from_tt(tte->value(), ply);
return
PvNode ? tte->type() == VALUE_TYPE_EXACT
&& ( tte->depth() >= depth
|| v >= value_mate_in(PLY_MAX)
|| v <= value_mated_in(PLY_MAX))
: ( tte->depth() >= depth
|| v >= Max(value_mate_in(PLY_MAX), beta)
|| v <= Min(value_mated_in(PLY_MAX), alpha))
&& ( ((tte->type() & VALUE_TYPE_LOWER) && v >= beta)
|| ((tte->type() & VALUE_TYPE_UPPER) && v <= alpha));
}
function call from search()
Code: Select all
if (tte && ok_to_use_TT<PvNode>(tte, depth, alpha, beta, ply))
{
TT.refresh(tte);
ss->bestMove = ttMove; // Can be MOVE_NONE
return value_from_tt(tte->value(), ply);
}
function call from qsearch()
Code: Select all
if (tte && ok_to_use_TT<PvNode>(tte, ttDepth, alpha, beta, ply))
{
ss->bestMove = ttMove; // Can be MOVE_NONE
return value_from_tt(tte->value(), ply);
}