From 51ff5c3df96fc5e09c72e85798ad8f9c615ea2a4 Mon Sep 17 00:00:00 2001 From: tensorlink-dev Date: Wed, 2 Dec 2026 21:07:35 +0000 Subject: [PATCH] feat(website): lane D kings on the Benchmarks tab (Pareto points, models table, public-benchmark tiles) Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01BMT4D7f8wd5dXsASyWUBwe --- cascade/website/index.html | 161 ++++++++++++++++++++++------ tests/unit/test_website_pareto.py | 87 +++++++++++++++ tests/unit/test_website_training.py | 4 +- 3 files changed, 219 insertions(+), 33 deletions(-) diff --git a/cascade/website/index.html b/cascade/website/index.html index 68404f098..c71c4758a 100644 --- a/cascade/website/index.html +++ b/cascade/website/index.html @@ -1084,6 +1084,8 @@ .train-big ~ .chart-meta .legend { gap:14px 20px; flex-wrap:wrap; } .train-big ~ .chart-meta .swatch { width:18px; height:3px; } .train-legend .swatch.dashed { height:0; border-top:2px dashed var(--ink); background:transparent; } +.train-legend .swatch.pareto-laned { width:9px; height:9px; background:var(--ink); border-radius:0; } +.train-legend .swatch.laned-hollow { width:9px; height:9px; background:transparent; border:1.5px solid var(--ink); border-radius:0; } .chart-meta > .legend { flex-wrap:wrap; max-width:100%; } .train-tiles { display:grid; grid-template-columns:repeat(5, minmax(0,1fr)); gap:12px; } .score-matrix, .lineage-heading { grid-column:1 / -1; } @@ -1588,6 +1590,8 @@ Pareto frontier Current king Prior kings + Lane D king + Lane D prior kings @@ -3738,6 +3742,53 @@ out.forEach(function(x){ var g=byGen[x.gen]; x.steps=g.steps/g.n; x.tokens=g.tokens/g.n; }); return {rows:out, pending:pending, missing:missing}; } +// ── lane D kings on the Benchmarks tab ────────────────────────────────── +// status/lane_d.json king and prior_kings[] may carry `bench` +// (lane-d-king-bench/1): the validator's public-benchmark sweep of that +// king's weights, flat _crps / _mase in the lane A BenchScores +// keys, `complete` false while suites are still being swept (one suite per +// settlement). Display only, never scoring. A suite without both numbers is +// pending, never filled in; a king without any suite is left out. The house +// (king.house) is the lane A king cast to BF16 and is already plotted as +// lane A, so it is not repeated. Size: lane D's architecture is fixed, the +// 120m cascade_pyramid contract (docs/LANE_D.md: an entry's tensor names and +// shapes must equal the contract's), so its total parameters are the +// packaged catalog's cascade_presets[LANE_D_PRESET] count (counted on the +// meta device); without the catalog the size is unavailable and lane D shows +// on MASE × CRPS only. +var LANE_D_PRESET="cascade-moe-v2-120m"; +function ldBenchSix(b){ + if(!b||typeof b!=="object") return null; + var six={}, n=0; + SUITES.forEach(function(su){ + var c=b[su.key+"_crps"], m=b[su.key+"_mase"], ok=validLoss(c)&&validLoss(m); + six[su.key+"_crps"]=ok?c:null; six[su.key+"_mase"]=ok?m:null; if(ok) n++; + }); + return n?{six:six, n:n}:null; +} +// lane D names the GIFT-Eval revision "gift"; lane A's reports say "gift-eval" +function ldRevisions(b){ + var r=b&&b.data_revisions, out={}; if(!r||typeof r!=="object") return null; + for(var k in r) if(typeof r[k]==="string") out[k==="gift"?"gift-eval":k]=r[k]; + return out; +} +function laneDKings(ld){ + var out=[]; if(!ld||typeof ld!=="object") return out; + function add(k, current){ + if(!k||typeof k!=="object"||k.house===true) return; + var b=k.bench, s=ldBenchSix(b); if(!s) return; + var since=k.since_boundary!=null&&isFinite(Number(k.since_boundary))?Number(k.since_boundary):null; + out.push({current:current, label:current?"Lane D king":"Lane D prior king · "+shortHk(k.hotkey?String(k.hotkey):""), + hotkey:k.hotkey?String(k.hotkey):"", digest:k.digest?String(k.digest):"", since:since, + six:s.six, n:s.n, complete:b.complete===true&&s.n===SUITES.length, revisions:ldRevisions(b), + asOf:typeof b.as_of==="string"?b.as_of:""}); + } + add(ld.king, true); + (Array.isArray(ld.prior_kings)?ld.prior_kings:[]).forEach(function(k){ add(k, false); }); + return out; +} +function ldPartial(k){ return "partial ("+k.n+"/"+SUITES.length+" suites)"; } +function isLaneDPoint(p){ return p.kind==="laned"||p.kind==="laned-prior"; } // ── model Pareto frontier ──────────────────────────────────────────────── function loadParetoCatalog(){ if(_paretoLoading||(_paretoFetched&&Date.now()-_paretoFetched'; } - var history=points.filter(function(p){ return p.kind!=="reference"; }); + var history=points.filter(function(p){ return p.kind==="current"||p.kind==="king"; }); for(var h=1;h'+ ''+esc(description)+''; if(current) out+=''; + else if(ldKing||p.kind==="laned-prior"){ var half=ldKing?7:5; + out+=''; } else out+=''; - if(current||p.frontier&&!narrow){ + if(current||ldKing||p.frontier&&!narrow){ var anchor=x>W-160?'end':'start', dx=anchor==='end'?-12:12, ly=Math.max(top+10,current?y-14:y-10); var labelWidth=p.label.length*7, labelLeft=anchor==='end'?x+dx-labelWidth:x+dx; for(var attempt=0;attempt<12;attempt++){ @@ -3910,7 +3975,7 @@ ly-=18; if(ly'+esc(p.label)+''; + out+=''+esc(p.label)+''; } out+=''; }); @@ -3948,7 +4013,7 @@ } function renderPareto(rows){ loadParetoCatalog(); loadReference(); - var data=modelPoints(rows), all=data.references.concat(data.kings), points=[]; + var data=modelPoints(rows), all=data.references.concat(data.kings,data.laned), points=[]; all.forEach(function(point,i){ var xy=paretoCoordinates(point); if(!xy) return; point.x=xy.x; point.y=xy.y; point.order=i; points.push(point); }); @@ -3958,22 +4023,31 @@ svg.setAttribute("viewBox","0 0 "+W+" "+H); svg.setAttribute("preserveAspectRatio","none"); svg.innerHTML=paretoChartSVG(points,W,H); wireParetoChart(wrap,points); var refs=points.filter(function(p){ return p.kind==="reference"; }), front=paretoFrontier(refs); - var skipped=all.length-points.length, kings=points.length-refs.length; + var skipped=all.length-points.length, ldN=points.filter(isLaneDPoint).length, kings=points.length-refs.length-ldN; + var suiteLabel=(SUITES.filter(function(su){ return su.key===_paretoBenchmark; })[0]||{}).label||_paretoBenchmark; document.getElementById("pareto-status").textContent=refs.length+" models · "+front.length+" on frontier · "+kings+" king"+(kings===1?'':'s')+ + (ldN?' · '+ldN+' lane D king'+(ldN===1?'':'s'):'')+(data.ldPending.length?' · lane D '+suiteLabel+' pending':'')+ (skipped?' · '+skipped+' missing size/score or different data revision':'')+(data.pending?' · current checkpoint pending':''); var note=_paretoCatalog&&_paretoCatalog.benchmarks&&_paretoCatalog.benchmarks[_paretoBenchmark]; var pipeline=refs.some(function(p){ return p.source==="same-pipeline reference"; }); document.getElementById("train-ref-status").textContent=note?(pipeline?'Published + same-pipeline references':'Published reference')+' · '+(note.n_configs||'')+' configurations': pipeline?'Same-pipeline model reference':'Reference models pending for this benchmark'; document.getElementById("pareto-help").innerHTML=infoTip("Pareto frontier", - "A reference model is on the frontier when no other plotted reference is both smaller/better on one axis and at least as good on the other. Both axes favour lower values. Size means total checkpoint parameters, not active MoE parameters. In MASE × CRPS, dot size indicates total parameters. "+ + "A reference model is on the frontier when no other plotted reference is both smaller/better on one axis and at least as good on the other. Both axes favour lower values. Size means total checkpoint parameters, not active MoE parameters. In MASE × CRPS, dot size indicates total parameters. Lane D kings (squares) are the validator's public-benchmark sweep of the lane D king's weights, read from status/lane_d.json (display only, never scoring); a suite not swept yet is listed as pending. Lane D's architecture is fixed, so its size is the "+LANE_D_PRESET+" contract's total parameter count. "+ (note&¬e.note||"Only measured scores for this benchmark are shown; missing results are never substituted.")+" Known data-revision mismatches with the current king are excluded. Older records without revision metadata remain historical comparisons. King points use the last scored checkpoint per reign; arrows follow settlement order, not the best benchmark score. Dashed segments mark the reference frontier, not measured intermediate models."); - document.getElementById("pareto-rows").innerHTML=points.slice().sort(function(a,b){ - return (a.kind==="current"?-1:b.kind==="current"?1:0)||a.x-b.x; + function rank(p){ return p.kind==="current"?0:p.kind==="laned"?1:2; } + function status(p){ + return p.kind==="current"?'Current king':p.kind==="king"?'Prior king':isLaneDPoint(p)?(p.kind==="laned"?'Lane D king':'Lane D prior king')+(p.ld.complete?'':' · '+ldPartial(p.ld)):p.frontier?'Frontier':'Reference'; + } + document.getElementById("pareto-rows").innerHTML=(points.slice().sort(function(a,b){ + return rank(a)-rank(b)||a.x-b.x; }).map(function(p){ var label=esc(p.label); if(/^https:\/\//.test(p.url||"")) label=''+label+''; - return ''+label+''+esc(parameterLabel(p.parameters))+''+fmt(p.mase,4)+''+fmt(p.crps,4)+''+esc(p.kind==="current"?'Current king':p.kind==="king"?'Prior king':p.frontier?'Frontier':'Reference')+''; - }).join("")||'No measured model comparisons for this view'; + if(p.ld) label=''+label+''; + return ''+label+''+esc(parameterLabel(p.parameters))+''+fmt(p.mase,4)+''+fmt(p.crps,4)+''+esc(status(p))+''; + }).concat(data.ldPending.map(function(p){ + return ''+esc(p.label)+''+esc(parameterLabel(p.parameters))+'pendingpending'+esc(status(p)+' · '+suiteLabel+' pending')+''; + })).join(""))||'No measured model comparisons for this view'; } function tile(k,v,sub,o){ @@ -3985,7 +4059,8 @@ function renderTrainStats(rows, info){ var el=document.getElementById("train-stats"), when=document.getElementById("train-when"); if(!el) return; if(!_index){ el.innerHTML='
Waiting for round data…
'; when.textContent=""; return; } - if(!rows.length){ + var ldk=laneDKings(_ld).filter(function(k){ return k.current; })[0]||null; + if(!rows.length&&!ldk){ el.innerHTML='
'+(info.pending?'Loading bench reports… ('+info.pending+' pending)':'No bench reports published yet')+'
'; when.textContent=""; return; } @@ -4019,30 +4094,46 @@ } var matrix=""; // One benchmark per column; metric rows share the same order in every suite. - if(lastK){ - var s=lastK.e.six, ref=trainReference(rows); - function referenceValue(key){ - if(!ref) return null; + // The lane A king's rows come first; the lane D king (status/lane_d.json + // bench) adds its own rows, its unswept suites shown as pending. Where both + // kings have a number on the same data revision the lower one is tagged best. + if(lastK||ldk){ + var ref=trainReference(rows), lanes=[]; + if(lastK) lanes.push({name:"Lane A", six:lastK.e.six, revisions:lastK.e.revisions, ctx:lastK.row.label+".", attr:"data-metric"}); + if(ldk) lanes.push({name:"Lane D", six:ldk.six, revisions:ldk.revisions, ld:true, attr:"data-ld-metric", + ctx:"Lane D king "+shortHk(ldk.hotkey)+", validator bench"+(ldk.asOf?" as of "+ldk.asOf:"")+(ldk.complete?".":", "+ldPartial(ldk)+".")}); + function revisionOf(revisions, key){ var suite=key.split("_")[0], revisionKey=suite==="gifteval"?"gift-eval":suite; - var kr=lastK.e.revisions&&lastK.e.revisions[revisionKey]; - var rr=_refBench[REFERENCE_PRESET].data_revisions, revision=rr&&rr[revisionKey]; - return kr&&revision&&JSON.stringify(kr)!==JSON.stringify(revision)?null:ref.six[key]; + return revisions&&revisions[revisionKey]; + } + function referenceValue(key, revisions){ + if(!ref) return null; + var kr=revisionOf(revisions,key), rr=revisionOf(_refBench[REFERENCE_PRESET].data_revisions,key); + return kr&&rr&&JSON.stringify(kr)!==JSON.stringify(rr)?null:ref.six[key]; + } + function beat(lane,key){ if(!ref||lane.six[key]==null) return ""; var rv=referenceValue(key,lane.revisions); return (rv!=null&&lane.six[key]'+esc(su.label)+''; }).join("")+''+ - ["mase","crps"].map(function(metric){ - var label=metric.toUpperCase(), help=metric==="mase"?"Point-forecast loss, scaled against a seasonal-naive forecast. Lower is better.":"Probabilistic forecast loss. Lower is better."; - return ''+label+infoTip(label,help)+''+SUITES.map(function(su){ - var key=su.key+"_"+metric, tag=beat(key); - return ''+fmt(s[key],4)+infoTip(su.label+" "+label,lastK.row.label+'.'+beatTxt(key))+ - (tag?''+esc(tag)+'':'')+''; + lanes.map(function(lane){ return ["mase","crps"].map(function(metric){ + var label=(ldk?lane.name+" ":"")+metric.toUpperCase(), help=(metric==="mase"?"Point-forecast loss, scaled against a seasonal-naive forecast. Lower is better.":"Probabilistic forecast loss. Lower is better.")+ + (lane.ld?" Lane D king: the validator's public-benchmark sweep of its weights (status/lane_d.json, display only)."+(ldk.complete?"":" "+ldPartial(ldk)+"; the remaining suites are swept one per settlement."):""); + return ''+esc(label)+infoTip(label,help)+''+SUITES.map(function(su){ + var key=su.key+"_"+metric, tag=beat(lane,key), top=best(lane,key); + var v=lane.ld&&lane.six[key]==null?'pending':fmt(lane.six[key],4); + return ''+v+infoTip(su.label+" "+label,lane.ctx+beatTxt(lane,key))+ + (top?'best':'')+(tag?''+esc(tag)+'':'')+''; }).join("")+''; - }).join("")+''; + }).join(""); }).join("")+''; } el.innerHTML=matrix+(tiles.length?'
King lineage'+infoTip("King lineage","Training accumulated along the current king checkpoint's warm-start ancestry. Measured counts are used where available; unresolved legs use the contracted budget.")+'
'+tiles.join("")+'
':'')+ - (!lastK?'
Current king benchmark pending
':''); + (!lastK?'
'+(ldk?'Lane A king':'Current king')+' benchmark pending
':''); when.textContent=lastK&&lastK.row.r.published_at?"benched round settled "+timeAgo(lastK.row.r.published_at):""; } // ── best model across lanes (owner 2026-11-30) ────────────────────────── @@ -4133,6 +4224,14 @@ function renderTrainTable(rows){ var tb=document.getElementById("train-rows"); if(!tb) return; var out=[]; + // lane D kings (status/lane_d.json bench) first: unswept suites are pending + laneDKings(_ld).forEach(function(k){ + var round="Lane D"+(k.current&&k.since!=null?" · since block "+k.since:"")+(k.complete?"":" · "+ldPartial(k)); + out.push(''+esc(round)+''+(k.current?'♛ lane D king':'lane D prior king')+''+ + ''+esc(shortHk(k.hotkey))+''+esc(LANE_D_PRESET)+''+ + SCORE_KEYS.map(function(key){ return ''+(k.six[key]==null?'pending':fmt(k.six[key],4))+''; }).join("")+ + ''+fmt(sixGeomean(k.six))+'--'); + }); rows.slice().reverse().forEach(function(row){ var kg=row.king?row.king.geo:null; var es=row.entries.filter(function(e){ return _trainScope==="all"||e.role==="king"; }).slice().sort(function(a,b){ return (a.role==="king"?0:1)-(b.role==="king"?0:1)||((a.geo==null?1e9:a.geo)-(b.geo==null?1e9:b.geo)); }); diff --git a/tests/unit/test_website_pareto.py b/tests/unit/test_website_pareto.py index 03b89b605..410f47d9f 100644 --- a/tests/unit/test_website_pareto.py +++ b/tests/unit/test_website_pareto.py @@ -117,3 +117,90 @@ def test_matrix_follows_newly_crowned_king_and_its_actual_training(tmp_path): els = run_js(tmp_path, "setPage('train')", "renderTrain()", fixtures=fx) assert '0.1234' in _html(els, 'train-stats') assert '>2k<' in _html(els, 'train-stats') + + +# ── lane D kings on the Benchmarks tab (status/lane_d.json bench) ──────────── + +LD_HK, LD_PRIOR = "5LaneDKing" + "k" * 38, "5LaneDPrior" + "p" * 37 +LD_REV = {"boom": "b" * 40, "gift": "g" * 40, "time": "t" * 40} + + +def _ld_bench(**scores): + # lane-d-king-bench/1, the shape the validator publishes + flat = {f"{s}_{m}": v for s, (c, a) in scores.items() for m, v in (("crps", c), ("mase", a))} + return {"schema": "lane-d-king-bench/1", "as_of": "2026-12-02T19:52:54Z", + "bench_method": "observed_mask/3", "complete": len(scores) == 4, + "data_revisions": dict(LD_REV), "digest": "e" * 64, **flat} + + +def _lane_d_status(king_bench, prior_bench=None, house=False): + king = {"digest": "e" * 64, "hotkey": None if house else LD_HK, "house": house, + "since_boundary": 9_634_500, "tenure_blocks": 1800} + if king_bench is not None: + king["bench"] = king_bench + prior = [{"digest": "0" * 64, "hotkey": LD_PRIOR, "reveal_ts": 1, "bench": prior_bench}] if prior_bench else [] + return {"block": 9_636_300, "boundary": 9_636_300, "era": 2676, "lane": "open", + "king": king, "prior_kings": prior, "house": {"digest": "h" * 64}, "queue": []} + + +def _train_render(tmp_path, lane_d, *calls): + fx = _bucket(v2_from=1000, block=50000, lane_b=True) + if lane_d is not None: + fx["status/lane_d.json"] = lane_d + bench = next(v for k, v in fx.items() if k.startswith("benchmarks/round-")) + return run_js(tmp_path, f"_bench[{json.dumps(bench['round_id'])}]={json.dumps(bench)}", + "setPage('train')", *calls, fixtures=fx) + + +PARTIAL = _ld_bench(gifteval=(0.4824, 0.7006), boom=(0.3691, 0.6142), time=(0.5237, 0.6742)) +FULL = _ld_bench(gifteval=(0.5198, 0.7486), boom=(0.3815, 0.6457), time=(0.5, 0.6), fev=(0.6081, 0.7539)) + + +def test_lane_d_kings_join_the_pareto_rows_tiles_and_checkpoints(tmp_path): + els = _train_render(tmp_path, _lane_d_status(PARTIAL, FULL), "renderTrain()") + rows, stats, table = _html(els, "pareto-rows"), _html(els, "train-stats"), _html(els, "train-rows") + # size axis: the lane D contract preset's total parameter count (1.23B) + assert "Lane D king" in rows and "1.23B" in rows and "0.7006" in rows and "0.4824" in rows + assert "partial (3/4 suites)" in rows and "Lane D prior king" in rows and "0.7486" in rows + assert "Timestral-5M" in rows # lane A references still render + assert 'data-metric="gifteval_crps">0.4700' in stats # the lane A king's row is unchanged + ld = stats.split('data-ld-metric="gifteval_crps">', 1)[1].split("", 1)[0] + assert ld.startswith("0.4824") + fev = stats.split('data-ld-metric="fev_crps">', 1)[1].split("", 1)[0] + assert "pending" in fev and "0.6081" not in fev # the current king's FEV is not swept + assert "Lane A MASE" in stats and "Lane D CRPS" in stats and "partial (3/4 suites)" in stats + assert "lane D king" in table and "lane D prior king" in table and "cascade-moe-v2-120m" in table + assert "pending" in table + for html in (rows, stats, table): + assert "undefined" not in html and "NaN" not in html + assert "lane D king" in _html(els, "pareto-status") + + +def test_missing_lane_d_suite_is_pending_not_plotted(tmp_path): + els = _train_render(tmp_path, _lane_d_status(PARTIAL), "_paretoBenchmark='fev'; renderTrain()", + "if(modelPoints(trainRows().rows).laned.length) throw Error('plotted a suite never swept')") + rows = _html(els, "pareto-rows") + assert "Lane D king" in rows and "FEV pending" in rows + assert "lane D FEV pending" in _html(els, "pareto-status") + + +@pytest.mark.parametrize("lane_d", [None, _lane_d_status(None), _lane_d_status(PARTIAL, house=True), + _lane_d_status({"gifteval_crps": "0.1", "gifteval_mase": None}), "garbage"]) +def test_lane_a_renders_unchanged_without_a_lane_d_bench(tmp_path, lane_d): + els = _train_render(tmp_path, lane_d, "renderTrain()") + rows, stats, table = _html(els, "pareto-rows"), _html(els, "train-stats"), _html(els, "train-rows") + assert "Timestral-5M" in rows and 'data-metric="gifteval_crps">0.4700' in stats + assert 'scope="row">MASE' in stats and "king" in table + for html in (rows, stats, table): + assert "Lane D" not in html and "lane D" not in html and "data-ld-metric" not in html + + +def test_lane_d_points_never_join_the_lane_a_trajectory(tmp_path): + run_js(tmp_path, """ + _paretoAxes='mase-crps'; + var points=[{id:'1',label:'king',kind:'current',x:.8,y:.5,order:0}, + {id:'2',label:'Lane D king',kind:'laned',x:.7,y:.4,order:1}]; + var html=paretoChartSVG(points,1000,420); + if(html.includes('class="king-trajectory"')) throw Error('bridged lane A to lane D'); + if(!html.includes('class="laned-point"')||!html.includes('>Lane D king<')) throw Error('lane D marker or label missing'); + """) diff --git a/tests/unit/test_website_training.py b/tests/unit/test_website_training.py index a87907964..90a46fc35 100644 --- a/tests/unit/test_website_training.py +++ b/tests/unit/test_website_training.py @@ -202,8 +202,8 @@ def test_removed_tiles_stay_removed(page: str, gone: str): def test_benchmark_cells_are_tagged_when_the_king_beats_timestral(page: str): body = re.search(r"function renderTrainStats\(rows, info\)\{(.*?)\n\}", page, re.S) - assert body and 'return (rv!=null&&s[key]