]> git.sesse.net Git - remoteglot/commitdiff
Revert "Send information about lower depths to the JSON."
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Fri, 5 Nov 2021 14:34:26 +0000 (15:34 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Fri, 5 Nov 2021 14:34:34 +0000 (15:34 +0100)
The entire low-PV experiment didn't go as I had hoped,
so remove it as clutter.

This reverts commit 9fc4030d9b55674b73c341c815292055fcb6f05c.

remoteglot.pl

index 56554a6d6b5589a65c13764a7d9ab0c5740bf624..b9055a64d30616ff945bed8fd59c500ab8eeb62c 100755 (executable)
@@ -480,8 +480,6 @@ sub parse_infos {
                }
        }
 
                }
        }
 
-       my $prev_depth = $info->{'depth1'} // $info->{'depth'};
-
        while (scalar @x > 0) {
                if ($x[0] eq 'multipv') {
                        # Dealt with above
        while (scalar @x > 0) {
                if ($x[0] eq 'multipv') {
                        # Dealt with above
@@ -536,14 +534,6 @@ sub parse_infos {
                die "Unknown info '" . join(',', @x) . "'";
 
        }
                die "Unknown info '" . join(',', @x) . "'";
 
        }
-
-       my $now_depth = $info->{'depth1'} // $info->{'depth'};
-       if (defined($prev_depth) && POSIX::floor($now_depth / 10) > POSIX::floor($prev_depth / 10)) {
-               my $d = POSIX::floor($now_depth / 10) * 10;  # In case we skipped some.
-               my $cp = $info->{'score_cp1'} // $info->{'score_cp'};
-               my $mate = $info->{'score_mate1'} // $info->{'score_mate'};
-               push @{$info->{'lowdepth'}}, [ $d, $cp, $mate ];
-       }
 }
 
 sub parse_ids {
 }
 
 sub parse_ids {
@@ -954,13 +944,6 @@ sub output_json {
        $json->{'tablebase'} = $info->{'tablebase'};
        $json->{'pv'} = [ prettyprint_pv($pos_calculating, @{$info->{'pv'}}) ];
 
        $json->{'tablebase'} = $info->{'tablebase'};
        $json->{'pv'} = [ prettyprint_pv($pos_calculating, @{$info->{'pv'}}) ];
 
-       $json->{'lowdepth'} = {};
-       if (exists($info->{'lowdepth'})) {
-               for my $ld (@{$info->{'lowdepth'}}) {
-                       $json->{'lowdepth'}{$ld->[0]} = score_digest_inner($ld->[1], $ld->[2], undef, 0, $pos_calculating);
-               }
-       }
-
        my %refutation_lines = ();
        my @refutation_lines = ();
        if (defined($engine2)) {
        my %refutation_lines = ();
        my @refutation_lines = ();
        if (defined($engine2)) {
@@ -1189,21 +1172,14 @@ sub short_score {
 # (with side-to-play information) score_sort_key.
 sub score_digest {
        my ($info, $pos, $mpv) = @_;
 # (with side-to-play information) score_sort_key.
 sub score_digest {
        my ($info, $pos, $mpv) = @_;
-       return score_digest_inner(
-               $info->{'score_cp' . $mpv},
-               $info->{'score_mate' . $mpv},
-               $info->{'splicepos' . $mpv},
-               $info->{'tablebase'},
-               $pos);
-}
 
 
-sub score_digest_inner {
-       my ($score, $mate, $sp, $tablebase, $pos) = @_;
-       if (defined($mate)) {
+       if (defined($info->{'score_mate' . $mpv})) {
+               my $mate = $info->{'score_mate' . $mpv};
                if ($pos->{'toplay'} eq 'B') {
                        $mate = -$mate;
                }
                if ($pos->{'toplay'} eq 'B') {
                        $mate = -$mate;
                }
-               if (defined($sp)) {
+               if (exists($info->{'splicepos' . $mpv})) {
+                       my $sp = $info->{'splicepos' . $mpv};
                        if ($mate > 0) {
                                return ['T', $sp];
                        } else {
                        if ($mate > 0) {
                                return ['T', $sp];
                        } else {
@@ -1221,11 +1197,12 @@ sub score_digest_inner {
                        }
                }
        } else {
                        }
                }
        } else {
-               if (defined($score)) {
+               if (exists($info->{'score_cp' . $mpv})) {
+                       my $score = $info->{'score_cp' . $mpv};
                        if ($pos->{'toplay'} eq 'B') {
                                $score = -$score;
                        }
                        if ($pos->{'toplay'} eq 'B') {
                                $score = -$score;
                        }
-                       if ($score == 0 && $tablebase) {
+                       if ($score == 0 && $info->{'tablebase'}) {
                                return ['d', undef];
                        } else {
                                return ['cp', int($score)];
                                return ['d', undef];
                        } else {
                                return ['cp', int($score)];