// Overview: what the benchmark asks, a picture of the forecaster it tests (a general coding agent // in a daily loop, in every domain), the leaderboard across tasks, then the ideas behind it as // pictures (finding information, a live run day, continual agents) and the tasks. // The formal setup, research questions and related work are on the methods page. import { overall } from "./board.js"; import { sparkline } from "./charts.js"; import { RESULTS } from "./config.js"; import { load } from "./data.js"; import { continualLoop, runDay, twoWays, vision } from "./explainers.js"; import { bySystem, dayLabel, empty, fmt, h, kindToggles, leaderboard, logo, OVERALL, parseDay, redraws, sectionHead, segmented, setSystems, system, systemCell, } from "./util.js"; // calendar days from the first live run day of any task to the latest const daysLive = (tasks) => { const first = d3.min(tasks, (t) => t.live_since), last = d3.max(tasks, (t) => t.latest_run); return first && last ? Math.round((parseDay(last) - parseDay(first)) / 864e5) + 1 : 0; }; // Across tasks every task's own expert forecast is one system. const EXPERT = { id: "expert", kind: "expert", label: "Expert forecast", description: "Each task's own expert forecast, such as ERCOT's or the NWS's" }; /** Each scored task's live pairs, with its expert forecast under EXPERT's id, and its * continual comparisons. */ async function liveTasks(index) { const tasks = await Promise.all(index.tasks.filter((t) => t.leaderboard.length).map((t) => load(`tasks/${t.id}.json`))); return tasks.map((t) => { const systems = {}, expert = Object.keys(t.pairs.live.systems).find((id) => system(id).kind === "expert"); for (const [id, rows] of Object.entries(t.pairs.live.systems)) systems[id === expert ? EXPERT.id : id] = rows; return { id: t.id, title: t.spec.title, keys: t.pairs.keys, data: { systems }, windows: t.pairs.windows, expert, continual: t.continual || [], continualTsfm: t.continual_tsfm || [] }; }).filter((t) => Object.keys(t.data.systems).length); } function hero(index) { const { tasks } = index; const next = h("span", { class: "next-run" }); const tick = () => { const now = Date.now(); const upcoming = tasks.map((t) => ({ t, at: new Date(t.next_run).getTime() })).filter((x) => x.at > now).sort((a, b) => a.at - b.at)[0]; if (!upcoming) { next.textContent = ""; return; } const minutes = Math.round((upcoming.at - now) / 6e4); const wait = minutes < 60 ? `${minutes} min` : `${Math.floor(minutes / 60)} h ${minutes % 60} min`; next.replaceChildren("next run in ", h("strong", {}, wait), h("span", { class: "next-task" }, ` · ${upcoming.t.title}`)); }; tick(); const clock = setInterval(() => (next.isConnected ? tick() : clearInterval(clock)), 30e3); return h("section", { class: "hero" }, h("span", { class: "live-pill" }, h("span", { class: "pulse", "aria-hidden": "true" }), h("span", {}, "Live · contextual time-series forecasting · ", h("span", { class: "nowrap" }, `day ${daysLive(tasks)}`)), next), h("h1", {}, "Can coding agents beat time-series foundation models and official forecasts?"), h("p", { class: "lead" }, `Every day, general-purpose coding agents forecast ${tasks.length} contextual time series: real-world series whose future turns on events beyond their own history. `, "They get no human prior, no curated data, context or tools; with only their own general tools they explore the real digital world and gather what they need. ", "We test whether they can beat time-series foundation models and official expert forecasts, and analyze what makes the difference: what an agent finds, how it uses it, and whether it improves from day to day."), vision(index)); } /** Systems compared over every task they share, each task counting once; a second tab shows * each task's scaled CRPS for the compared agents and the best of the other systems. */ function board(index, loaded) { const body = h("div", {}, h("div", { class: "card" }, h("p", { class: "note" }, "Loading the tasks…"))); const state = { view: "overall", sort: "scaled_crps", more: false, selection: null }; loaded.then((tasks) => { setSystems([...index.systems, EXPERT]); // systems seen on at least two tasks (a task's own no-change reference is not) const seen = d3.rollup(tasks.flatMap((t) => Object.keys(t.data.systems)), (v) => v.length, (id) => id); const ids = [...seen].filter(([, n]) => n >= 2).map(([id]) => id).sort(bySystem); // by default the agents still run and the seasonal naive forecast, on every task they share, // and each other system still run that forecast all of those tasks const defaults = ids.filter((id) => !system(id).stopped && (system(id).kind === "agent" || id === "seasonal-naive")); const reach = overall(tasks, defaults).used.length; for (const id of ids) { if (!defaults.includes(id) && !system(id).stopped && id !== EXPERT.id && overall(tasks, [...defaults, id]).used.length === reach) defaults.push(id); } state.selection = [...defaults]; const set = (selection) => { state.selection = selection; draw(); }; const draw = () => { const res = overall(tasks, state.selection); const ticked = state.selection; const stuck = ticked.length > 1 && !res.used.length ? ticked.map((id) => ({ id, kept: overall(tasks, ticked.filter((x) => x !== id)).used.length })) .sort((a, b) => b.kept - a.kept || bySystem(a.id, b.id)) .map(({ id, kept }) => ({ id, on: true, note: kept ? `Unticking it lets the others be compared on ${kept} tasks.` : "" })) : []; const others = ids.filter((id) => !ticked.includes(id)).map((id) => { const r = overall(tasks, [...ticked, id]); return { id, on: false, note: stuck.length ? "" : `Adding it leaves ${r.used.length} of the ${res.used.length} tasks.` }; }); const changed = ticked.length !== defaults.length || ticked.some((id) => !defaults.includes(id)); const note = res.rows.length ? `${res.used.length} tasks · ${fmt.int(res.pairs)} forecasts that every system made · each task counts once. ` : stuck.length ? `The ${ticked.length} ticked systems share no task. Untick one of the first rows. ` : null; const table = state.view === "tasks" ? byTask(tasks, res, ticked) : h("div", {}, leaderboard(res.rows, "", state.sort, { metrics: OVERALL, onSort: (key) => { state.sort = key; draw(); }, stuck, others: state.more ? others : [], onTick: (id) => set(ticked.includes(id) ? ticked.filter((x) => x !== id) : [...ticked, id]) }), others.length ? h("button", { type: "button", class: "link-button more-systems", onclick: () => { state.more = !state.more; draw(); } }, state.more ? "Hide the systems not compared" : `+ ${others.length} more system${others.length > 1 ? "s" : ""}, with fewer tasks in common`) : null); body.replaceChildren(h("div", { class: "card" }, h("div", { class: "board-bar" }, segmented([["overall", "All tasks"], ["tasks", "By task"]], state.view, (v) => { state.view = v; draw(); }, "Leaderboard view"), kindToggles(ids, ticked, set)), h("p", { class: "note board-note" }, note, changed ? h("button", { type: "button", class: "link-button", onclick: () => set([...defaults]) }, "Reset") : null), table)); }; draw(); }).catch((error) => body.replaceChildren(h("div", { class: "card" }, empty(`The tasks could not be loaded: ${error.message}`)))); return h("section", { class: "section" }, sectionHead("leaderboard", "Leaderboard", "Scaled CRPS: the error of the whole forecast distribution relative to a seasonal naive forecast, so 1 is naive and lower is better. Click a system to see how it is set up."), body); } function byTask(tasks, res, ticked) { if (!res.used.length) return empty("No task has a forecast from every ticked system."); const agents = res.rows.map((r) => r.system).filter((id) => system(id).kind === "agent").sort(bySystem); const taskLink = (t) => { const picked = ticked.map((id) => (id === EXPERT.id ? t.expert : id)).filter(Boolean); return `#/t/${t.id}?systems=${picked.map(encodeURIComponent).join(",")}`; }; return h("div", { class: "table-wrap" }, h("table", { class: "board by-task" }, h("thead", {}, h("tr", {}, h("th", {}, "Task"), agents.map((id) => h("th", { class: "num sys-head" }, systemCell(id))), h("th", {}, "Best other system"))), h("tbody", {}, res.used.map((u) => { const t = tasks.find((x) => x.id === u.id); const ranked = [...u.rows].sort((a, b) => a.scaled_crps - b.scaled_crps); const best = ranked[0]?.scaled_crps; const other = ranked.find((r) => system(r.system).kind !== "agent"); return h("tr", {}, h("td", {}, h("a", { href: taskLink(t) }, t.title), h("span", { class: "cell-sub" }, `${u.n} forecasts`)), agents.map((id) => { const v = u.rows.find((r) => r.system === id)?.scaled_crps; return h("td", { class: `num${v === best ? " best" : ""}` }, fmt.ratio(v)); }), h("td", { class: "nowrap" }, other ? [h(other.scaled_crps === best ? "strong" : "span", {}, fmt.ratio(other.scaled_crps)), " ", systemCell(other.system)] : "—")); }))), h("p", { class: "note", style: { marginTop: "8px" } }, "Each task's best in bold. A task opens with the same systems ticked.")); } function why() { return h("section", { class: "section" }, sectionHead("why", "Two ways to forecast better", "A forecast misses because the model uses its information badly, or because the information was not enough. Benchmarks so far hand every system the same information, so they can only test the first. An agent chooses what to look up, so it can work on both."), twoWays(), h("p", { class: "note section-foot" }, "An illustration with made-up numbers. ", h("a", { href: "#/methods?at=idea" }, "The decomposition, formally"))); } function live() { return h("section", { class: "section" }, sectionHead("live", "Live, every day", "Every task runs on a fixed schedule. Agents work before the outcome exists, so nothing about it can leak in, and nothing is tuned after the fact."), h("div", { class: "card" }, runDay()), h("p", { class: "note section-foot" }, h("a", { href: "#/methods?at=definition" }, "How each task's times are set"), " · ", h("a", { href: "#/methods?at=replay" }, "How a day is archived and replayed"))); } /** Per continual agent still run: over the tasks where it and its twin share pairs, the * geometric mean of the ratio of their scaled CRPS, and on how many tasks it was lower. */ function continualResults(tasks) { const out = new Map(); for (const t of tasks) { for (const c of [...t.continual, ...t.continualTsfm]) { const rows = new Map(c.rows.map((r) => [r.system, r])); const a = rows.get(c.continual)?.scaled_crps, b = rows.get(c.fresh)?.scaled_crps; if (!(a > 0 && b > 0) || system(c.continual).stopped) continue; if (!out.has(c.continual)) out.set(c.continual, { id: c.continual, twin: c.fresh, logs: [], wins: 0 }); const o = out.get(c.continual); o.logs.push(Math.log(a / b)); o.wins += a < b; } } return [...out.values()].map((o) => ({ ...o, tasks: o.logs.length, change: Math.exp(d3.mean(o.logs)) - 1 })); } function continualSection(index, loaded) { const results = h("div", { class: "card cont-results" }, h("p", { class: "note" }, "Loading…")); loaded.then((tasks) => { const all = continualResults(tasks).filter((r) => r.tasks >= 3); const agents = [...new Set(all.map((r) => r.id.replace(/-continual(-tsfm)?$/, "")))].sort(bySystem); if (!agents.length) { results.replaceChildren(empty("No continual results yet.")); return; } const change = (c) => (Math.abs(c) < 0.005 ? h("span", { class: "delta" }, "no change") : h("span", { class: `delta ${c < 0 ? "good" : "bad"}` }, `${c < 0 ? "−" : "+"}${Math.abs(c * 100).toFixed(0)}% error`)); const line = (label, r) => h("div", { class: "cont-line" }, h("span", { class: "secondary" }, label), r ? [change(r.change), h("span", { class: "note" }, `lower on ${r.wins} of ${r.tasks} tasks`)] : h("span", { class: "muted" }, "not enough days yet")); results.replaceChildren( h("div", { class: "card-title" }, "So far"), h("div", { class: "cont-agents" }, agents.map((id) => h("div", { class: "cont-agent" }, systemCell(id, { link: true }), line("Continual vs fresh", all.find((r) => r.id === `${id}-continual`)), line("+ TSFMs vs continual", all.find((r) => r.id === `${id}-continual-tsfm`))))), h("p", { class: "note" }, "Change in scaled CRPS against the agent it is compared with, on the forecasts both made: the geometric mean over tasks. Live and preliminary.")); }).catch(() => results.replaceChildren(empty("Continual results could not be loaded."))); return h("section", { class: "section" }, sectionHead("continual", "Can agents improve themselves?", "Every run day an agent gathers information, models the series and decides. A continual agent also remembers: it resumes its own workspace and conversation, checks its earlier forecasts against what happened, and is asked to do better. What it changes is up to it."), h("div", { class: "cont-wrap" }, continualLoop(index), results), h("p", { class: "note section-foot" }, h("a", { href: "#/methods?at=continual" }, "How continual runs work"))); } function tasksSection(index) { const domains = new Map(index.taxonomy.domains.map((d, i) => [d.id, { ...d, i }])); const domainOf = (t) => domains.get(t.taxonomy?.split("/")[0]); const tasks = [...index.tasks].sort((a, b) => (domainOf(a)?.i ?? 99) - (domainOf(b)?.i ?? 99) || a.title.localeCompare(b.title)); const leader = (t) => t.leaderboard.filter((r) => system(r.system).kind !== "reference" && !system(r.system).stopped && r.scaled_crps != null) .sort((a, b) => a.scaled_crps - b.scaled_crps)[0]; const cards = tasks.map((t) => { const spark = h("div", { class: "chart" }); redraws.push(() => sparkline(spark, { truth: t.truth.slice(-60), width: Math.max(120, spark.clientWidth || 200), height: 40 })); const best = leader(t); return h("a", { class: "task-card", href: `#/t/${t.id}` }, h("span", { class: "eyebrow" }, domainOf(t)?.name || "Unclassified"), h("strong", {}, t.title), spark, h("span", { class: "task-foot" }, h("span", {}, `${t.schedule.every_days === 1 ? "daily" : t.schedule.every_days === 7 ? "weekly" : `every ${t.schedule.every_days} days`} · ${t.run_days} run day${t.run_days === 1 ? "" : "s"}`), best ? h("span", { class: "leader", title: `Leads on live forecasts: ${system(best.system).label}, scaled CRPS ${fmt.ratio(best.scaled_crps)}` }, logo(best.system), "leads") : h("span", { class: "muted" }, t.live_since ? "scoring soon" : `from ${dayLabel(t.next_run?.slice(0, 10))}`))); }); return h("section", { class: "section" }, sectionHead("tasks", "The tasks", "Real series with a precise settlement rule: energy, health, weather, markets, transport, attention. Each was proposed by a contributor and has its own data source; many have an official forecast to beat.", h("a", { class: "button", href: "#/tasks" }, "Browse by area")), h("div", { class: "task-grid" }, cards)); } export function overview(app, index) { const loaded = liveTasks(index); app.replaceChildren( hero(index), board(index, loaded), why(), live(), continualSection(index, loaded), tasksSection(index), h("section", { class: "section closing" }, h("div", { class: "card" }, h("h3", {}, "Open by design"), h("p", { class: "secondary" }, "Every task is a self-contained ALE task with its own data-fetching script. Every forecast, actual value and agent trajectory is public."), h("div", { class: "cta" }, h("a", { class: "button primary", href: "#/methods" }, "Read the methods"), h("a", { class: "button", href: `https://huggingface.co/datasets/${RESULTS}`, target: "_blank", rel: "noopener" }, "Results dataset ↗"))))); }