lilbanjue's picture
Publish corrected RepoNormBench leaderboard and submission guide
255c04c verified
Raw History Blame Contribute Delete
5.94 kB
"use strict";
let dataset;
const $ = (id) => document.getElementById(id);
const pct = (v) => v === null || v === undefined ? "—" : `${(v * 100).toFixed(2)}%`;
const modelOrder = { deepseek: 0, qwen: 1, gemini: 2 };
const methodOrder = { raw: 0, codewiki: 1, reponorm: 2 };
const sortValue = (e, key) => ({ functional: e.functional_rate, overall: e.scopes.overall.task_macro,
contribution: e.scopes.contribution.task_macro, omitted: e.scopes.prompt_omitted.task_macro,
joint: e.joint_rate })[key] ?? -1;
function node(tag, text, className) {
const element = document.createElement(tag);
if (text !== undefined) element.textContent = text;
if (className) element.className = className;
return element;
}
function metricCell(value, detail) {
const cell = node("td", pct(value));
cell.append(node("small", detail));
return cell;
}
function showDetails(entry) {
$("detail-title").textContent = `${entry.model_label} · ${entry.method_label}`;
const body = $("detail-body");
body.replaceChildren(node("p", `${entry.tasks} tasks · mini-swe-agent v2 · coarse_auto · corrected default tests`, "caption"));
const grid = node("div", undefined, "detail-grid");
for (const [key, title] of [["overall", "Overall"], ["contribution", "Contribution"], ["prompt_omitted", "Prompt-omitted"]]) {
const s = entry.scopes[key];
const card = node("section", undefined, "detail-card");
card.append(node("h3", `${title} NCR`),
node("p", `Task macro: ${pct(s.task_macro)} · ${s.included_tasks}/${entry.tasks} tasks included`),
node("p", `Instance micro: ${pct(s.micro)} · ${s.norm_pass}/${s.norm_decided} decided instances`),
node("p", `Coverage: ${pct(s.coverage)} · ${s.norm_decided}/${s.norm_applicable} applicable instances`),
node("p", `Statuses: ${Object.entries(s.status_counts).map(([k,v]) => `${k} ${v}`).join(" · ")}`));
grid.append(card);
}
const fs = entry.functional_subset;
const card = node("section", undefined, "detail-card");
card.append(node("h3", "Functional-subset NCR (micro)"),
node("p", `${pct(fs.micro)} · ${fs.norm_pass}/${fs.norm_decided} decided instances`),
node("p", `Restricted to ${entry.functional_pass} functionally passed tasks; not the main task-macro NCR.`),
node("p", `Functional + all norms: ${entry.joint_pass}/${entry.tasks} (${pct(entry.joint_rate)})`));
grid.append(card);
body.append(grid);
const warning = node("p", "These are released historical executions, with corrected-test rescoring where required—not fresh agent runs. A missing configuration field means unrecorded, not disabled. Provider routing, reasoning and recovery settings differ; examine the configuration IDs before drawing comparisons.", "caption");
body.append(warning);
for (const [id, count] of Object.entries(entry.configuration_counts)) {
const details = node("details");
details.append(node("summary", `Configuration ${id} · ${count} selected tasks`),
node("pre", JSON.stringify(dataset.configurations[id], null, 2)));
body.append(details);
}
const link = node("a", "Inspect complete archived configurations ↗");
link.href = `https://huggingface.co/datasets/${dataset.dataset}/blob/${dataset.dataset_revision}/historical/data/results/configurations.json`;
link.target = "_blank"; link.rel = "noopener noreferrer";
body.append(node("p"), link);
$("details").showModal();
}
function render() {
if (!dataset) return;
const model = $("model").value, method = $("method").value, sort = $("sort").value;
const entries = dataset.entries.filter(e => (model === "all" || e.model === model) && (method === "all" || e.condition === method));
entries.sort((a,b) => (sort === "group" ? 0 : sortValue(b,sort) - sortValue(a,sort)) ||
modelOrder[a.model] - modelOrder[b.model] || methodOrder[a.condition] - methodOrder[b.condition]);
const rows = $("rows"); rows.replaceChildren();
for (const e of entries) {
const row = node("tr"); row.dataset.method = e.condition;
const identity = node("td");
identity.append(node("span", e.model_label, "model-name"), node("span", e.method_label, "method"));
row.append(identity, metricCell(e.functional_rate, `${e.functional_pass}/${e.tasks} tasks`));
for (const key of ["overall", "contribution", "prompt_omitted"]) {
const s = e.scopes[key];
row.append(metricCell(s.task_macro, `${s.included_tasks} tasks included`));
}
row.append(metricCell(e.joint_rate, `${e.joint_pass}/${e.tasks} tasks`),
metricCell(e.scopes.overall.coverage, `${e.scopes.overall.norm_decided}/${e.scopes.overall.norm_applicable} instances`));
const detailsCell = node("td"); const button = node("button", "View");
button.type = "button"; button.setAttribute("aria-label", `Details: ${e.model_label}, ${e.method_label}`);
button.addEventListener("click", () => showDetails(e)); detailsCell.append(button); row.append(detailsCell); rows.append(row);
}
$("table-context").textContent = `${entries.length} entries · Full 121-task benchmark · All metrics in percent · Open Details for denominators and configuration`;
}
for (const id of ["model", "method", "sort"]) $(id).addEventListener("change", render);
$("close-details").addEventListener("click", () => $("details").close());
fetch("data/leaderboard.json").then(response => {
if (!response.ok) throw new Error(`HTTP ${response.status}`);
return response.json();
}).then(data => {
if (data.schema_version !== "leaderboard-1.0" || data.entries.length !== 9 || data.entries.some(e => e.tasks !== 121)) throw new Error("Unexpected data schema");
dataset = data; $("revision").textContent = data.dataset_revision.slice(0,12); render();
}).catch(() => {
$("table-context").textContent = "Could not load the leaderboard data. Please refresh, or download the CSV / JSON below. No placeholder scores are displayed.";
$("table-context").classList.add("error");
});