- Create ml/eval/elo_tracker.py:
- EloTracker class with standard ELO formula (K=32, start=1200)
- EloResult dataclass for tournament output
- EloHistory class for JSON persistence (data/elo_history.json)
- run_elo_tournament(): round-robin ELO-rated matches using
existing run_match() from tournament.py
- run_generation_tournament(): discovers gen-*/best_policy.pt
checkpoints and runs cross-generation ELO tournament
- CLI entry point: python -m ml.eval.elo_tracker
- Add ELO API endpoints to routes/ml.py:
- POST /api/ml/elo/tournament — start background ELO tournament
- GET /api/ml/elo/tournament/status — poll progress
- GET /api/ml/elo/history — load ELO history from disk
- Integrate ELO convergence in distillation_loop.py:
- New config fields: elo_convergence_enabled (default False),
elo_convergence_threshold (20.0), elo_tournament_episodes (30)
- New field: GenerationRecord.elo_rating
- _run_elo_mini_tournament() runs after quality gate pass
- _check_convergence() checks ELO delta when enabled
- Add ELO UI to distillation page:
- ELO Ratings panel with canvas multi-line chart showing per-model
ELO progression across generations
- Run Tournament button with progress indicator
- ELO leaderboard table with rank, rating, and visual bars
- Responsive chart resize handling
Closes #70
210 lines
5.6 KiB
CSS
210 lines
5.6 KiB
CSS
/* ══════════════════════════════════════════════════════════════
|
|
Commander AI Lab — Distillation Loop Dashboard
|
|
Page-specific styles only; shared tokens & components in global.css
|
|
══════════════════════════════════════════════════════════════ */
|
|
|
|
/* ── Legacy variable aliases (used by distillation.js inline styles) ── */
|
|
:root {
|
|
--lab-bg: var(--bg);
|
|
--lab-surface: var(--surface-1);
|
|
--lab-border: var(--border);
|
|
--lab-accent: var(--accent);
|
|
--lab-accent-dim: var(--accent-dim);
|
|
--lab-text: var(--text);
|
|
--lab-text-dim: var(--text-secondary);
|
|
--lab-success: var(--success);
|
|
--lab-success-dim:var(--success-dim);
|
|
--lab-warning: var(--warning);
|
|
--lab-warning-dim:var(--warning-dim);
|
|
--lab-error: var(--error);
|
|
--lab-error-dim: var(--error-dim);
|
|
--lab-purple: var(--purple);
|
|
--lab-purple-dim: var(--purple-dim);
|
|
}
|
|
|
|
/* ── Status Cards (extend global .stat-card) ───────────────── */
|
|
.status-grid {
|
|
grid-template-columns: repeat(4, 1fr);
|
|
}
|
|
|
|
.status-card {
|
|
text-align: center;
|
|
}
|
|
|
|
.status-card.active {
|
|
border-color: var(--accent);
|
|
}
|
|
|
|
.status-card.success {
|
|
border-color: var(--success);
|
|
}
|
|
|
|
.status-card.error-state {
|
|
border-color: var(--error);
|
|
}
|
|
|
|
.card-icon {
|
|
font-size: 24px;
|
|
margin-bottom: var(--sp-2);
|
|
}
|
|
|
|
/* ── Panel heading with bottom border ──────────────────────── */
|
|
.panel > .panel-header {
|
|
padding-bottom: var(--sp-3);
|
|
border-bottom: 1px solid var(--border);
|
|
}
|
|
|
|
/* ── Training Controls Layout ──────────────────────────────── */
|
|
.train-controls {
|
|
padding-top: var(--sp-4);
|
|
}
|
|
|
|
.param-grid {
|
|
margin-bottom: var(--sp-3);
|
|
}
|
|
|
|
.distill-bottom-params {
|
|
grid-template-columns: repeat(2, 1fr);
|
|
}
|
|
|
|
.distill-actions {
|
|
display: flex;
|
|
gap: var(--sp-2);
|
|
margin-top: var(--sp-2);
|
|
}
|
|
|
|
.btn-icon {
|
|
font-size: 14px;
|
|
}
|
|
|
|
/* ── Progress Sections ─────────────────────────────────────── */
|
|
.train-progress {
|
|
margin-top: var(--sp-5);
|
|
padding-top: var(--sp-4);
|
|
border-top: 1px solid var(--border);
|
|
}
|
|
|
|
.train-progress.hidden {
|
|
display: none;
|
|
}
|
|
|
|
/* ── Phase Badges ──────────────────────────────────────────── */
|
|
.phase-badge {
|
|
display: inline-block;
|
|
padding: 3px 10px;
|
|
border-radius: var(--radius-md);
|
|
font-size: 11px;
|
|
font-weight: 600;
|
|
text-transform: uppercase;
|
|
letter-spacing: 0.05em;
|
|
}
|
|
|
|
.phase-badge.running { background: var(--accent-dim); color: var(--accent); }
|
|
.phase-badge.starting { background: var(--accent-dim); color: var(--accent); }
|
|
.phase-badge.done { background: var(--success-dim); color: var(--success); }
|
|
.phase-badge.error { background: var(--error-dim); color: var(--error); }
|
|
.phase-badge.idle { background: var(--surface-3); color: var(--text-secondary); }
|
|
|
|
#progress-message {
|
|
font-size: 13px;
|
|
color: var(--text);
|
|
}
|
|
|
|
/* ── Progress Bar overrides ────────────────────────────────── */
|
|
.progress-bar-container {
|
|
margin-bottom: var(--sp-2);
|
|
}
|
|
|
|
.progress-bar {
|
|
transition: width 0.5s var(--ease);
|
|
}
|
|
|
|
.progress-bar.done {
|
|
background: var(--success);
|
|
}
|
|
|
|
.progress-bar.error {
|
|
background: var(--error);
|
|
}
|
|
|
|
/* ── Chart Containers ──────────────────────────────────────── */
|
|
.chart-container {
|
|
position: relative;
|
|
min-height: 200px;
|
|
}
|
|
|
|
.chart-container canvas {
|
|
width: 100%;
|
|
}
|
|
|
|
.chart-container .empty-state {
|
|
position: absolute;
|
|
inset: 0;
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: center;
|
|
padding: var(--sp-6);
|
|
}
|
|
|
|
/* ── History Table ─────────────────────────────────────────── */
|
|
.distill-history-table {
|
|
font-size: 13px;
|
|
}
|
|
|
|
.distill-history-table .tag {
|
|
display: inline-flex;
|
|
align-items: center;
|
|
padding: 2px 8px;
|
|
font-size: 11px;
|
|
font-weight: 600;
|
|
border-radius: var(--radius-sm);
|
|
white-space: nowrap;
|
|
text-transform: capitalize;
|
|
}
|
|
|
|
/* ── Responsive ────────────────────────────────────────────── */
|
|
@media (max-width: 768px) {
|
|
.status-grid {
|
|
grid-template-columns: repeat(2, 1fr);
|
|
}
|
|
|
|
.param-grid {
|
|
grid-template-columns: repeat(2, 1fr);
|
|
}
|
|
|
|
.distill-bottom-params {
|
|
grid-template-columns: 1fr;
|
|
}
|
|
}
|
|
|
|
@media (max-width: 480px) {
|
|
.status-grid {
|
|
grid-template-columns: 1fr;
|
|
}
|
|
|
|
.param-grid {
|
|
grid-template-columns: 1fr;
|
|
}
|
|
}
|
|
|
|
/* ── ELO Panel ─────────────────────────────────────────── */
|
|
.elo-panel-header {
|
|
display: flex;
|
|
align-items: center;
|
|
justify-content: space-between;
|
|
}
|
|
|
|
.elo-table {
|
|
margin-top: var(--sp-3);
|
|
}
|
|
|
|
.elo-table td {
|
|
vertical-align: middle;
|
|
}
|
|
|
|
/* Refresh button spin animation */
|
|
@keyframes spin {
|
|
from { transform: rotate(0deg); }
|
|
to { transform: rotate(360deg); }
|
|
}
|