Skip to content

EMRY-058: TUI run comparison overlay - #97

Merged
vxfemboy merged 5 commits into
mainfrom
emry-058-tui-overlay
Jun 29, 2026
Merged

EMRY-058: TUI run comparison overlay#97
vxfemboy merged 5 commits into
mainfrom
emry-058-tui-overlay

Conversation

@vxfemboy

Copy link
Copy Markdown
Member

Closes #81

The last TUI-parity piece — mirrors the web dashboard's baseline overlay in the terminal.

What

emry watch RUN --compare PRIOR_RUN     # overlay a prior run on the live chart
emry tui --run-dir RUN --compare PRIOR_RUN

The matching baseline series is drawn as a dim amber curve behind the live terracotta curve, on a shared y-scale and step-aligned to the same axis (the col_steps from EMRY-059), with a · ╌ baseline legend in the chart title.

How

  • emry-storeload_baseline(path) -> Vec<BaselineSeries>: the single canonical metrics.jsonl reader (per-metric series, first-seen order).
  • chartrender_braille_steps now delegates to render_braille_steps_scaled(values, steps, w, h, s0, s1, g_min, g_max), which takes an explicit step window + shared y-scale so two series render on the same axes. New value_range helper.
  • emry-tuiUiState.baseline + set_baseline; render_chart clips the matching baseline to the live step window, folds it into a shared y-scale, and compose_chart_lines shows the baseline where the live curve doesn't occupy a cell.
  • emry-cli--compare on watch/tui; load_compare maps emry_store::BaselineSeriesemry_tui::BaselineSeries.

Review fix

Consolidated to one metrics.jsonl parser. emry-web previously had its own load_baseline that diverged (silently skipped malformed lines, hardcoded the filename). Removed it (keeping web's Serialize types for the /baseline route); cmd_web now loads via emry_store::load_baseline too, so watch/tui/web --compare all behave identically.

Verification

  • Full local gate green (fmt + clippy -D warnings + tests + 91.73% line coverage).
  • Verified end-to-end via vhs: live + baseline render as two distinct curves; TestBackend tests assert the amber overlay appears (and doesn't when the label mismatches).

vxfemboy added 5 commits June 28, 2026 23:01
Mirror the web comparison overlay in the TUI — the last TUI-parity piece.

- emry-store: load_baseline(path) reads a prior run's metrics.jsonl into
  per-metric (steps, values) series (BaselineSeries).
- chart: render_braille_steps_scaled draws a series against an explicit step
  window + shared y-scale, so live and baseline render on the same axes;
  render_braille_steps now delegates to it.
- emry-tui: UiState.baseline + set_baseline; compose_chart_lines overlays the
  baseline (amber) behind the live curve (terracotta) where the live curve
  doesn't occupy a cell, sharing one y-scale; title shows a baseline legend.
- emry-cli: 'emry watch PATH --compare PRIOR' and 'emry tui --compare PRIOR'
  load the baseline via emry-store and seed the dashboard.

Step-aligned via the col_steps axis (EMRY-059). Verified end-to-end via vhs: two
distinct curves, live + baseline.
… :3c

The web crate had a third metrics.jsonl parser that diverged (silently skipped
bad lines, hardcoded the filename). Drop emry_web::load_baseline; keep only its
Serialize types for the /baseline route. cmd_web now loads via
emry_store::load_baseline and maps into emry_web::Baseline — same single reader
the TUI uses, so 'emry watch --compare' and 'emry web --compare' behave
identically (strict parse, consistent errors). web_demo builds its synthetic
baseline in-memory.
Both now seed a synthetic prior-run baseline (slower-decaying loss/loss_ema), so
running either shows the amber comparison overlay behind the live curve — a
live, no-setup way to see/test the feature. Select loss (1) or loss_ema (3).
The dashboard only drew braille dots + borders, leaving empty cells on the
terminal's default background — so a transparent terminal showed the desktop
through the chart. Set the warm panel bg (#1a1714, matching the web dashboard)
on every block, so the dashboard is fully opaque regardless of terminal
transparency.
Per preference, the TUI should respect the terminal's own background (and any
transparency) rather than painting an opaque panel. Reverts the bg fill.
@vxfemboy
vxfemboy merged commit 9da045e into main Jun 29, 2026
6 checks passed
@vxfemboy
vxfemboy deleted the emry-058-tui-overlay branch June 29, 2026 11:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

EMRY-058: TUI run comparison overlay

1 participant