enum NodeType { NonPV, PV };
// Set to true to force running with one thread.
enum NodeType { NonPV, PV };
// Set to true to force running with one thread.
// RootMove::operator<() is the comparison function used when
// sorting the moves. A move m1 is considered to be better
// RootMove::operator<() is the comparison function used when
// sorting the moves. A move m1 is considered to be better
- Move get_move(int moveNum) const { return moves[moveNum].move; }
- Value get_move_score(int moveNum) const { return moves[moveNum].score; }
+ Value move_score(int moveNum) const { return moves[moveNum].score; }
+ int64_t move_nodes(int moveNum) const { return moves[moveNum].nodes; }
+ void add_move_nodes(int moveNum, int64_t nodes) { moves[moveNum].nodes += nodes; }
// Initialize
TT.new_search();
H.clear();
init_ss_array(ss, PLY_MAX_PLUS_2);
pv[0] = pv[1] = MOVE_NONE;
// Initialize
TT.new_search();
H.clear();
init_ss_array(ss, PLY_MAX_PLUS_2);
pv[0] = pv[1] = MOVE_NONE;
for (int j = 0; j < Min(MultiPV, rml.move_count()); j++)
{
cout << "info multipv " << j + 1
for (int j = 0; j < Min(MultiPV, rml.move_count()); j++)
{
cout << "info multipv " << j + 1
<< " depth " << (j <= i ? Iteration : Iteration - 1)
<< " time " << current_search_time()
<< " nodes " << ThreadsMgr.nodes_searched()
<< " nps " << nps()
<< " pv ";
<< " depth " << (j <= i ? Iteration : Iteration - 1)
<< " time " << current_search_time()
<< " nodes " << ThreadsMgr.nodes_searched()
<< " nps " << nps()
<< " pv ";
- for (int k = 0; rml.get_move_pv(j, k) != MOVE_NONE && k < PLY_MAX; k++)
- cout << rml.get_move_pv(j, k) << " ";
+ for (int k = 0; rml.move_pv(j, k) != MOVE_NONE && k < PLY_MAX; k++)
+ cout << rml.move_pv(j, k) << " ";
assert(ply > 0 && ply < PLY_MAX);
assert(pos.thread() >= 0 && pos.thread() < ThreadsMgr.active_threads());
assert(ply > 0 && ply < PLY_MAX);
assert(pos.thread() >= 0 && pos.thread() < ThreadsMgr.active_threads());
Move ttMove, move, excludedMove, threatMove;
Depth ext, newDepth;
Value bestValue, value, oldAlpha;
Move ttMove, move, excludedMove, threatMove;
Depth ext, newDepth;
Value bestValue, value, oldAlpha;
- Value refinedValue, nullValue, futilityValueScaled; // Non-PV specific
+ Value refinedValue, nullValue, futilityBase, futilityValueScaled; // Non-PV specific
bool isCheck, singleEvasion, singularExtensionNode, moveIsCheck, captureOrPromotion, dangerous;
bool mateThreat = false;
int moveCount = 0;
bool isCheck, singleEvasion, singularExtensionNode, moveIsCheck, captureOrPromotion, dangerous;
bool mateThreat = false;
int moveCount = 0;
// We illogically ignore reduction condition depth >= 3*ONE_PLY for predicted depth,
// but fixing this made program slightly weaker.
Depth predictedDepth = newDepth - reduction<NonPV>(depth, moveCount);
// We illogically ignore reduction condition depth >= 3*ONE_PLY for predicted depth,
// but fixing this made program slightly weaker.
Depth predictedDepth = newDepth - reduction<NonPV>(depth, moveCount);
+ H.gain(pos.piece_on(move_from(move)), move_to(move));
if (futilityValueScaled < beta)
+ H.gain(pos.piece_on(move_from(move)), move_to(move));
if (futilityValueScaled < beta)
StateInfo st;
bool includeAllMoves = (searchMoves[0] == MOVE_NONE);
// Initialize search stack
init_ss_array(ss, PLY_MAX_PLUS_2);
StateInfo st;
bool includeAllMoves = (searchMoves[0] == MOVE_NONE);
// Initialize search stack
init_ss_array(ss, PLY_MAX_PLUS_2);
// Generate all legal moves
MoveStack* last = generate_moves(pos, mlist);
// Generate all legal moves
MoveStack* last = generate_moves(pos, mlist);
moves[count].score = -qsearch<PV>(pos, ss+1, -VALUE_INFINITE, VALUE_INFINITE, DEPTH_ZERO, 1);
moves[count].score = -qsearch<PV>(pos, ss+1, -VALUE_INFINITE, VALUE_INFINITE, DEPTH_ZERO, 1);