struct RootMove {
- RootMove() : mp_score(0), nodes(0), cumulativeNodes(0) {}
+ RootMove() : mp_score(0), nodes(0) {}
// RootMove::operator<() is the comparison function used when
// sorting the moves. A move m1 is considered to be better
Move move;
Value score;
int mp_score;
- int64_t nodes, cumulativeNodes;
+ int64_t nodes;
Move pv[PLY_MAX_PLUS_2];
};
Value get_move_score(int moveNum) const { return moves[moveNum].score; }
void set_move_score(int moveNum, Value score) { moves[moveNum].score = score; }
Move get_move_pv(int moveNum, int i) const { return moves[moveNum].pv[i]; }
- int64_t get_move_cumulative_nodes(int moveNum) const { return moves[moveNum].cumulativeNodes; }
+ int64_t get_move_nodes(int moveNum) const { return moves[moveNum].nodes; }
void score_moves(const Position& pos);
- void set_move_nodes(int moveNum, int64_t nodes);
+ void add_move_nodes(int moveNum, int64_t nodes) { moves[moveNum].nodes += nodes; }
void set_move_pv(int moveNum, const Move pv[]);
void sort();
void sort_multipv(int n);
int64_t nodes = ThreadsMgr.nodes_searched();
if ( Iteration >= 8
&& EasyMove == pv[0]
- && ( ( rml.get_move_cumulative_nodes(0) > (nodes * 85) / 100
+ && ( ( rml.get_move_nodes(0) > (nodes * 85) / 100
&& current_search_time() > TimeMgr.available_time() / 16)
- ||( rml.get_move_cumulative_nodes(0) > (nodes * 98) / 100
+ ||( rml.get_move_nodes(0) > (nodes * 98) / 100
&& current_search_time() > TimeMgr.available_time() / 32)))
stopSearch = true;
break;
// Remember searched nodes counts for this move
- rml.set_move_nodes(i, ThreadsMgr.nodes_searched() - nodes);
+ rml.add_move_nodes(i, ThreadsMgr.nodes_searched() - nodes);
assert(value >= -VALUE_INFINITE && value <= VALUE_INFINITE);
assert(value < beta);
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;
CheckInfo ci(pos);
ss->bestMove = MOVE_NONE;
singleEvasion = isCheck && mp.number_of_evasions() == 1;
+ futilityBase = ss->eval + margins[pos.side_to_move()];
singularExtensionNode = depth >= SingularExtensionDepth[PvNode]
&& tte
&& tte->move()
// 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);
- futilityValueScaled = ss->eval + futility_margin(predictedDepth, moveCount)
+ futilityValueScaled = futilityBase + futility_margin(predictedDepth, moveCount)
+ H.gain(pos.piece_on(move_from(move)), move_to(move));
if (futilityValueScaled < beta)
// RootMoveList simple methods definitions
- void RootMoveList::set_move_nodes(int moveNum, int64_t nodes) {
-
- moves[moveNum].nodes = nodes;
- moves[moveNum].cumulativeNodes += nodes;
- }
-
void RootMoveList::set_move_pv(int moveNum, const Move pv[]) {
int j;