EMRY-058: TUI run comparison overlay - #97
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #81
The last TUI-parity piece — mirrors the web dashboard's baseline overlay in the terminal.
What
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_stepsfrom EMRY-059), with a· ╌ baselinelegend in the chart title.How
emry-store—load_baseline(path) -> Vec<BaselineSeries>: the single canonicalmetrics.jsonlreader (per-metric series, first-seen order).chart—render_braille_stepsnow delegates torender_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. Newvalue_rangehelper.emry-tui—UiState.baseline+set_baseline;render_chartclips the matching baseline to the live step window, folds it into a shared y-scale, andcompose_chart_linesshows the baseline where the live curve doesn't occupy a cell.emry-cli—--compareonwatch/tui;load_comparemapsemry_store::BaselineSeries→emry_tui::BaselineSeries.Review fix
Consolidated to one
metrics.jsonlparser.emry-webpreviously had its ownload_baselinethat diverged (silently skipped malformed lines, hardcoded the filename). Removed it (keeping web'sSerializetypes for the/baselineroute);cmd_webnow loads viaemry_store::load_baselinetoo, sowatch/tui/web--compareall behave identically.Verification
-D warnings+ tests + 91.73% line coverage).TestBackendtests assert the amber overlay appears (and doesn't when the label mismatches).