feat: live framed search dashboard for a terminal

The terminal output is now a framed dashboard that is redrawn in place
ten times a second instead of a growing list of lines:

- the root position as a coloured board, with the best move's squares
  highlighted;
- the score, white's expected score as an evaluation bar, depth, playouts,
  speed, time with a progress bar (time or playout limit), tree fill and
  notes on tree reuse and collections;
- the principal variation in SAN with move numbers, wrapped and fading
  with depth;
- the most visited root moves (SAN) with a bar for their share of the
  visits, score and prior;
- a spinner while searching, "done" at the end, and bestmove in SAN.

Each frame moves the cursor back to the top of the previous one and
clears below it; lines the user typed under the dashboard (e.g. stop)
are counted and drawn over. The box adapts to the terminal's width and
height (fewer root moves, then no blank lines, the board only when it
fits). RIGBY_PRETTY=1 forces the dashboard into a pipe.

Checked: UCI output is unchanged (node-limited searches identical to
main, including tree reuse and a stalemate root; time-limited ones
differ only in node counts); go wtime, go infinite + stop and quit
work; the dashboard was driven in a real console, including the redraw,
a reused tree and the switch to UCI, and its colours were checked
rendered to HTML. Search is untouched, so the bench is unchanged.

Bench: 546018

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
rektdieandclaude committed 2026-11-15 14:30:47 +01:00
1 parent 31a35fd84f
commit c859163e2c
6 files changed
+606 -181

No files matched your search

+6 -1
View File
@@ -5,6 +5,7 @@
#include <vector>
#include "position.h"
#include "pretty.h"
namespace rigby {
@@ -126,6 +127,9 @@ private:
int seldepth_ = 0;
bool gc_pending_ = false;
int gc_runs_ = 0;
size_t reused_ = 0;
u64 node_limit_ = 0;
pretty::LiveView live_;
// Share of the arena kept after a collection.
static constexpr double GC_KEEP_FRACTION = 0.5;
@@ -150,7 +154,8 @@ private:
u32 best_child(u32 idx) const;
void print_info() const;
void print_root_moves() const;
std::vector<Move> principal_variation() const;
void draw_dashboard(bool done);
};
} // namespace rigby