if (Options["Use Search Log"])
{
+ RootMove& rm = RootMoves[0];
+ if (skill.best != MOVE_NONE)
+ rm = *std::find(RootMoves.begin(), RootMoves.end(), skill.best);
+
Log log(Options["Search Log Filename"]);
- log << pretty_pv(pos, depth, bestValue, Time::now() - SearchTime, &RootMoves[0].pv[0])
+ log << pretty_pv(pos, depth, rm.score, Time::now() - SearchTime, rm.pv.data())
<< std::endl;
}
|| Time::now() - SearchTime > (TimeMgr.available_time() * 20) / 100))
{
Value rBeta = bestValue - 2 * PawnValueMg;
- (ss+1)->excludedMove = RootMoves[0].pv[0];
- (ss+1)->skipNullMove = true;
- Value v = search<NonPV>(pos, ss+1, rBeta - 1, rBeta, (depth - 3) * ONE_PLY);
- (ss+1)->skipNullMove = false;
- (ss+1)->excludedMove = MOVE_NONE;
+ ss->excludedMove = RootMoves[0].pv[0];
+ ss->skipNullMove = true;
+ Value v = search<NonPV>(pos, ss, rBeta - 1, rBeta, (depth - 3) * ONE_PLY);
+ ss->skipNullMove = false;
+ ss->excludedMove = MOVE_NONE;
if (v < rBeta)
stop = true;
&& (ss-1)->reduction
&& threatMove != MOVE_NONE
&& allows(pos, (ss-1)->currentMove, threatMove))
- return beta - 1;
+ return alpha;
}
}
// Prune moves with negative or equal SEE and also moves with positive
// SEE where capturing piece loses a tempo and SEE < beta - futilityBase.
if ( futilityBase < beta
- && depth < DEPTH_ZERO
&& pos.see(move, beta - futilityBase) <= 0)
{
bestValue = std::max(bestValue, futilityBase);
string uci_pv(const Position& pos, int depth, Value alpha, Value beta) {
std::stringstream s;
- Time::point elaspsed = Time::now() - SearchTime + 1;
+ Time::point elapsed = Time::now() - SearchTime + 1;
size_t uciPVSize = std::min((size_t)Options["MultiPV"], RootMoves.size());
int selDepth = 0;
<< " seldepth " << selDepth
<< " score " << (i == PVIdx ? score_to_uci(v, alpha, beta) : score_to_uci(v))
<< " nodes " << pos.nodes_searched()
- << " nps " << pos.nodes_searched() * 1000 / elaspsed
- << " time " << elaspsed
+ << " nps " << pos.nodes_searched() * 1000 / elapsed
+ << " time " << elapsed
<< " multipv " << i + 1
<< " pv";