@@ -342,12 +342,12 @@ void Search::UpdateKLDGain() {
342
342
if (prev_dist_.size () != 0 ) {
343
343
double sum1 = 0.0 ;
344
344
double sum2 = 0.0 ;
345
- for (int i = 0 ; i < new_visits.size (); i++) {
345
+ for (decltype (new_visits)::size_type i = 0 ; i < new_visits.size (); i++) {
346
346
sum1 += prev_dist_[i];
347
347
sum2 += new_visits[i];
348
348
}
349
349
double kldgain = 0.0 ;
350
- for (int i = 0 ; i < new_visits.size (); i++) {
350
+ for (decltype (new_visits)::size_type i = 0 ; i < new_visits.size (); i++) {
351
351
double o_p = prev_dist_[i] / sum1;
352
352
double n_p = new_visits[i] / sum2;
353
353
if (prev_dist_[i] != 0 ) {
@@ -437,8 +437,8 @@ void Search::UpdateRemainingMoves() {
437
437
if (time_since_start > kSmartPruningToleranceMs ) {
438
438
const auto nps = 1000LL *
439
439
(total_playouts_ + kSmartPruningToleranceNodes ) /
440
- time_since_start +
441
- 1 ;
440
+ time_since_start +
441
+ 1 ;
442
442
const int64_t remaining_time = GetTimeToDeadline ();
443
443
// Put early_exit scaler here so calculation doesn't have to be done on
444
444
// every node.
@@ -454,8 +454,8 @@ void Search::UpdateRemainingMoves() {
454
454
// Add kMiniBatchSize, as it's possible to exceed visits limit by that
455
455
// number.
456
456
const auto remaining_visits = limits_.visits - total_playouts_ -
457
- initial_visits_ +
458
- params_. GetMiniBatchSize () - 1 ;
457
+ initial_visits_ + params_. GetMiniBatchSize () -
458
+ 1 ;
459
459
460
460
if (remaining_visits < remaining_playouts_)
461
461
remaining_playouts_ = remaining_visits;
@@ -516,15 +516,12 @@ int Search::PopulateRootMoveLimit(MoveList* root_moves) const {
516
516
(board.ours () | board.theirs ()).count () > syzygy_tb_->max_cardinality ()) {
517
517
return 0 ;
518
518
}
519
-
520
- int best_rank = syzygy_tb_->root_probe (
521
- played_history_.Last (),
522
- params_.GetSyzygyFastPlay () ||
523
- played_history_.DidRepeatSinceLastZeroingMove (),
524
- root_moves);
525
- if (!best_rank)
526
- best_rank = syzygy_tb_->root_probe_wdl (played_history_.Last (), root_moves);
527
- return best_rank;
519
+ return syzygy_tb_->root_probe (
520
+ played_history_.Last (),
521
+ params_.GetSyzygyFastPlay () ||
522
+ played_history_.DidRepeatSinceLastZeroingMove (),
523
+ root_moves) ||
524
+ syzygy_tb_->root_probe_wdl (played_history_.Last (), root_moves);
528
525
}
529
526
530
527
// Computes the best move, maybe with temperature (according to the settings).
@@ -606,7 +603,7 @@ std::vector<EdgeAndNode> Search::GetBestChildrenNoTemperature(Node* parent,
606
603
// Final sort pass.
607
604
const auto middle = (static_cast <int >(edges.size ()) > count)
608
605
? edges.begin () + count
609
- : edges.end ();
606
+ : edges.end ();
610
607
std::partial_sort (edges.begin (), middle, edges.end (), std::greater<El>());
611
608
612
609
std::vector<EdgeAndNode> res;
0 commit comments