]> git.sesse.net Git - remoteglot/commitdiff
Merge remote-tracking branch 'origin/master'
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Fri, 5 Nov 2021 14:36:30 +0000 (15:36 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Fri, 5 Nov 2021 14:36:30 +0000 (15:36 +0100)
remoteglot.pl
www/css/remoteglot.css
www/index.html
www/js/remoteglot.js

index abbbd983a7127abf317ef1c61916d2038db70c76..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
@@ -536,22 +534,6 @@ sub parse_infos {
                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.
-               complete_using_tbprobe($pos_calculating, $info, exists($info->{'depth1'}) ? '1' : '');
-               my $cp = $info->{'score_cp1'} // $info->{'score_cp'};
-               my $mate = $info->{'score_mate1'} // $info->{'score_mate'};
-               my $splicepos = $info->{'splicepos1'} // $info->{'splicepos'};
-               my $bestmove;
-               if (defined($info->{'pv1'})) {  # Avoid autovivification.
-                       $bestmove = $info->{'pv1'}[0];
-               } else {
-                       $bestmove = $info->{'pv'}[0];
-               }
-               push @{$info->{'lowdepth'}}, [ $d, $cp, $mate, $splicepos, $bestmove ];
-       }
 }
 
 sub parse_ids {
@@ -962,15 +944,6 @@ sub output_json {
        $json->{'tablebase'} = $info->{'tablebase'};
        $json->{'pv'} = [ prettyprint_pv($pos_calculating, @{$info->{'pv'}}) ];
 
-       $json->{'lowdepth'} = {};
-       if (exists($info->{'lowdepth'})) {
-               for my $ld (@{$info->{'lowdepth'}}) {
-                       my $score = score_digest_inner($ld->[1], $ld->[2], $ld->[3], 0, $pos_calculating);
-                       push @$score, prettyprint_pv($pos_calculating, $ld->[4]);
-                       $json->{'lowdepth'}{$ld->[0]} = $score;
-               }
-       }
-
        my %refutation_lines = ();
        my @refutation_lines = ();
        if (defined($engine2)) {
@@ -1199,21 +1172,14 @@ sub short_score {
 # (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 (defined($sp)) {
+               if (exists($info->{'splicepos' . $mpv})) {
+                       my $sp = $info->{'splicepos' . $mpv};
                        if ($mate > 0) {
                                return ['T', $sp];
                        } else {
@@ -1231,11 +1197,12 @@ sub score_digest_inner {
                        }
                }
        } else {
-               if (defined($score)) {
+               if (exists($info->{'score_cp' . $mpv})) {
+                       my $score = $info->{'score_cp' . $mpv};
                        if ($pos->{'toplay'} eq 'B') {
                                $score = -$score;
                        }
-                       if ($score == 0 && $tablebase) {
+                       if ($score == 0 && $info->{'tablebase'}) {
                                return ['d', undef];
                        } else {
                                return ['cp', int($score)];
index e0f9444138a83842253f5b7ff9b10faaae9028c8..fcd6e5759fd3bbbe5393a3e4e2454b7ab74e7601 100644 (file)
@@ -24,10 +24,6 @@ h3 {
        margin-left: 0.5em;
        margin-right: 0.5em;
 }
-#lowdepthcontainer {
-       font-size: x-small;
-       margin-top: 0;
-}
 #pvcontainer {
        clear: left;
        margin-top: 1em;
@@ -202,7 +198,7 @@ a.move:hover {
        border-right: none;
 }
 
-.pv, #pv, #history, #lowdepth .depth {  /* Mute move colors a bit. */
+.pv, #pv, #history {  /* Mute move colors a bit. */
        color: #555;
 }
 
index c8022199c78aeff9fcec3b52d9c366cd62c9fd31..5158266e2af5c55271336dca49110feeac8356aa 100644 (file)
@@ -32,9 +32,6 @@
       <span id="scorespark"></span>
     </div>
   </div>
-  <div id="lowdepthcontainer">
-    <span id="lowdepth"></span>
-  </div>
   <p id="pvcontainer"><strong id="pvtitle">PV:</strong> <span id="pv"></span></p>
   <p id="searchstats"></p>
   <h3>History and potential moves (multi-PV)</h3>
index a8c99c8edec484c609a4415d0997142674d68718..37f5c7bd1b61a034e56e9471fc4cd74f074be7ce 100644 (file)
@@ -1213,25 +1213,6 @@ var update_board = function() {
                $("#score").text(format_long_score(data['score']));
        }
 
-       // Low depth.
-       var lowdepth = '';
-       if (data['lowdepth']) {
-               lowdepth = 'Quick look: ';
-               var lds = [];
-               Object.keys(data['lowdepth']).forEach(function(depth) {
-                       let info = data['lowdepth'][depth];
-                       lds.push([parseInt(depth), format_short_score(info.slice(0,-1)), info[info.length - 1]]);
-               });
-               lds.sort(function(a, b) { return a[0] - b[0]; });
-               for (var i = 0; i < lds.length; ++i) {
-                       lowdepth += '<span class="depth">d' + lds[i][0] + ':</span> ' + lds[i][2] + ' ' + lds[i][1];
-                       if (i != lds.length - 1) {
-                               lowdepth += ', ';
-                       }
-               }
-       }
-       $("#lowdepth").html(lowdepth);
-
        // The search stats.
        if (data['searchstats']) {
                $("#searchstats").html(data['searchstats']);