feat(tui): phase-aware chart (per-phase autoscale at checkpoints) + events.jsonl in file mode - #123
Closed
vxfemboy wants to merge 5 commits into
Closed
feat(tui): phase-aware chart (per-phase autoscale at checkpoints) + events.jsonl in file mode#123vxfemboy wants to merge 5 commits into
vxfemboy wants to merge 5 commits into
Conversation
The chart set its y-axis to the union of the live curve and the --compare baseline. A baseline with a much larger range (e.g. prior-run loss 0.001..5.5 vs a current run at 0.6..2.0) crushed the live curve into a thin band and filled the panel with the baseline's noise — the live line looked broken/scattered, and sparse series (val_loss, 4 pts) became invisible. Now the y-axis scales to the live curve's own range; the baseline is drawn only where it overlaps that range (off-scale points hidden, not clamped to the border), and the title says 'baseline off-scale' when the whole baseline is out of range. Adds chart_yscale + unit tests using the real-world value shapes.
The real cause of the 'broken' chart: per-step training loss is very noisy (oscillates across its full range every step), and the chart plotted every raw point via a spike-preserving min/max band, so it rendered as confetti filling the panel. Verified against the user's actual run (loss bounces 0.6..2.0 step-to-step). Now the displayed curve is an EMA trend line (adaptive span ~8% of the visible points, clamped 3..64) — like wandb/tensorboard. Baseline is smoothed the same way for a like-for-like overlay. Adds ema_smooth + adaptive_ema_span with tests. Combined with the prior commit (scale to the live curve, hide off-scale baseline), the loss/val_loss charts render as clean lines again.
The real cause of the 'confetti' chart: the renderer placed each column's point independently (min/max per step-column + flat carry-forward) and never joined consecutive points. At low panel heights adjacent points land close so it looked connected; at tall heights the step-to-step wiggle spreads points across many rows -> disconnected dots = confetti. Reproduced from the user's real run rendered at 150x40 (live curve alone was already confetti, so it was neither the baseline nor the y-scale). Now render_braille_steps_scaled interpolates a value at each dot column and bridges it to the previous column's row, drawing a continuous line (interp_at helper). Verified against the real data at 150x40: a connected descending curve instead of scatter. Smoothing (EMA) still applies on top.
emry watch --run-dir only tailed metrics.jsonl, so the file-mode dashboard never saw checkpoints, phase/stage changes, alerts, or the metric-name table. Add EventLogTailer (same offset-polling as the metric tailer, parses each line as an Event) and poll it alongside metrics in spawn_run_dir_tailer. Checkpoint markers now appear in file mode, and this is the source of phase boundaries for the upcoming segmented chart.
Curriculum runs cycle through phases with different loss scales, so one
shared y-axis makes a healthy run look like it diverges at each phase
transition. Now the chart splits the x-axis at checkpoint steps (which
mark phase boundaries) and scales each segment to its OWN range, drawn as
connected sub-curves with a labeled title (labels from the checkpoint
path, e.g. 'reasoning | knowledge | current').
- chart::render_braille_segments + Segment (per-segment scale, breaks the
line at boundaries for a visual divider).
- ui: Checkpoint{step,label} (was bare step) + checkpoint_label() +
build_segments(); render_chart segments when checkpoints split the
window, else the single-scale path. Baseline overlay omitted in
segmented mode (can't share per-segment scales).
Verified against the real kitby-v2 run at 150x40: reasoning|knowledge|
current segments each render as their own readable curve. Builds on the
connected-line renderer (#122) and the events.jsonl tailer.
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.
Curriculum training cycles through phases with different loss scales (reasoning ~1.0, personality ~2.5, …), so one shared y-axis makes a healthy run look like it diverges at every phase transition. This makes the chart phase-aware.
Two parts
events.jsonlin file mode (EventLogTailer).emry watch --run-dironly tailedmetrics.jsonl, so checkpoints/phase-changes/alerts/metric-names never showed in file mode. Now polled alongside metrics — checkpoint markers finally appear in file mode, and they're the source of phase boundaries.reasoning │ knowledge │ current).chart::render_braille_segments+Segment;ui::Checkpoint{step,label}+build_segments. Baseline overlay omitted in segmented mode (can't share per-segment scales).Verified against the real kitby-v2 run at 150×40 — each phase renders as its own readable curve instead of one mangled cumulative mess.
Notes
run.stage()stage API, (3) stage-driven boundaries + web parity.Gate green (fmt, clippy, tests, ≥90% coverage).