Skip to content

Commit f221a4d

Browse files
chhzh123claude
andcommitted
Add interactive solver code viewer for per-problem results
- Extract best solver.py for all 10 new models × 9 problems into results/solvers.json (851KB, lazy-loaded on first click) - Add 'Solver' column to per-problem table with '⌨ Code' button for the 10 models that have solvers; '—' for the original 9 - Add keyboard icon on bar chart rows (appears on hover) - Code modal: dark theme (github-dark via highlight.js), syntax- highlighted Python, Copy button, Escape/backdrop-click to close - highlight.js loaded lazily from CDN on first code view - Add equal-contribution markers (*) for first 5 authors with footnote Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 820db14 commit f221a4d

File tree

2 files changed

+192
-5
lines changed

2 files changed

+192
-5
lines changed

index.html

Lines changed: 191 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -192,6 +192,12 @@
192192
white-space: nowrap;
193193
}
194194
.authors a:hover { color: var(--accent); text-decoration: underline; }
195+
.authors sup { font-size: 0.65em; color: var(--accent); vertical-align: super; }
196+
.authors-note {
197+
font-size: 0.78rem; color: var(--text-muted);
198+
margin: -0.4rem auto 1.5rem; max-width: 720px;
199+
}
200+
.authors-note sup { font-size: 0.65em; color: var(--accent); vertical-align: super; }
195201
.institutions {
196202
display: flex;
197203
justify-content: center;
@@ -493,6 +499,74 @@
493499
.copy-btn:hover { background: var(--accent-light); color: var(--accent); border-color: var(--accent); }
494500
.copy-btn.copied { color: var(--green); border-color: var(--green); background: var(--green-bg); }
495501

502+
/* ── CODE MODAL ── */
503+
.code-modal {
504+
position: fixed; inset: 0; z-index: 1000;
505+
display: flex; align-items: center; justify-content: center;
506+
}
507+
.code-modal.hidden { display: none; }
508+
.cm-backdrop {
509+
position: absolute; inset: 0; background: rgba(0,0,0,0.55);
510+
}
511+
.cm-inner {
512+
position: relative;
513+
width: min(920px, 95vw); max-height: 86vh;
514+
background: #1e1e2e; border-radius: 0.75rem;
515+
display: flex; flex-direction: column; overflow: hidden;
516+
box-shadow: 0 25px 60px rgba(0,0,0,0.4);
517+
}
518+
.cm-header {
519+
display: flex; align-items: center; justify-content: space-between;
520+
padding: 0.85rem 1.25rem;
521+
border-bottom: 1px solid rgba(255,255,255,0.1);
522+
background: #16162a; flex-shrink: 0;
523+
}
524+
.cm-title { font-size: 0.88rem; }
525+
.cm-title-model { font-weight: 700; color: #e2e8f0; }
526+
.cm-title-sep { color: #4a5568; margin: 0 0.4rem; }
527+
.cm-title-problem { color: #94a3b8; }
528+
.cm-actions { display: flex; gap: 0.5rem; align-items: center; }
529+
.cm-copy-btn {
530+
padding: 0.28rem 0.7rem; font-size: 0.78rem; font-weight: 600;
531+
border-radius: 0.375rem; border: 1px solid rgba(255,255,255,0.2);
532+
background: transparent; color: #cbd5e1; cursor: pointer;
533+
transition: background 0.15s; font-family: inherit;
534+
}
535+
.cm-copy-btn:hover { background: rgba(255,255,255,0.12); }
536+
.cm-copy-btn.copied { color: #4ade80; border-color: #4ade80; }
537+
.cm-close-btn {
538+
width: 28px; height: 28px; border-radius: 50%;
539+
border: none; background: rgba(255,255,255,0.1); color: #cbd5e1;
540+
font-size: 1.1rem; cursor: pointer; display: flex;
541+
align-items: center; justify-content: center;
542+
transition: background 0.15s; font-family: inherit; line-height: 1;
543+
}
544+
.cm-close-btn:hover { background: rgba(255,255,255,0.2); }
545+
.cm-pre {
546+
overflow: auto; margin: 0; padding: 1.1rem 1.4rem;
547+
flex: 1; font-size: 0.81rem; line-height: 1.65;
548+
font-family: 'JetBrains Mono','Fira Code','Cascadia Code','Consolas',monospace;
549+
}
550+
.cm-pre code { background: none !important; padding: 0 !important; font-size: inherit !important; }
551+
/* view-code button in table */
552+
.code-view-btn {
553+
display: inline-flex; align-items: center; gap: 0.3rem;
554+
padding: 0.22rem 0.6rem; font-size: 0.75rem; font-weight: 600;
555+
border-radius: 0.35rem; border: 1px solid var(--border);
556+
background: white; color: var(--text-muted); cursor: pointer;
557+
transition: all 0.15s; font-family: inherit; white-space: nowrap;
558+
}
559+
.code-view-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }
560+
/* code icon in bar chart */
561+
.bar-code-btn {
562+
flex-shrink: 0; padding: 0.1rem 0.4rem; font-size: 0.7rem;
563+
border-radius: 0.3rem; border: 1px solid var(--border);
564+
background: white; color: var(--text-muted); cursor: pointer;
565+
transition: all 0.15s; font-family: inherit; opacity: 0;
566+
}
567+
.bar-row:hover .bar-code-btn { opacity: 1; }
568+
.bar-code-btn:hover { border-color: var(--accent); color: var(--accent); background: var(--accent-light); opacity: 1; }
569+
496570
/* ── FOOTER ── */
497571
footer {
498572
background: var(--bg-alt);
@@ -517,6 +591,25 @@
517591
</head>
518592
<body>
519593

594+
<!-- CODE MODAL -->
595+
<div id="code-modal" class="code-modal hidden">
596+
<div class="cm-backdrop" onclick="closeCodeModal()"></div>
597+
<div class="cm-inner">
598+
<div class="cm-header">
599+
<div class="cm-title">
600+
<span class="cm-title-model" id="cm-model"></span>
601+
<span class="cm-title-sep">/</span>
602+
<span class="cm-title-problem" id="cm-problem"></span>
603+
</div>
604+
<div class="cm-actions">
605+
<button class="cm-copy-btn" id="cm-copy-btn" onclick="copyCode()">Copy</button>
606+
<button class="cm-close-btn" onclick="closeCodeModal()">×</button>
607+
</div>
608+
</div>
609+
<pre class="cm-pre"><code class="language-python" id="cm-code"></code></pre>
610+
</div>
611+
</div>
612+
520613
<!-- NAV -->
521614
<nav>
522615
<a class="nav-brand" href="#home">Heuri<span>Gym</span></a>
@@ -536,11 +629,11 @@
536629
<div class="hero-badge">ICLR 2026 Benchmark</div>
537630
<p>An agentic benchmark for evaluating how well LLMs generate and refine heuristics for real-world combinatorial optimization tasks.</p>
538631
<div class="authors">
539-
<a href="https://chhzh123.github.io/" target="_blank">Hongzheng Chen</a>,
540-
<a href="https://isjakewong.github.io/" target="_blank">Yingheng Wang</a>,
541-
<a href="https://www.csl.cornell.edu/~yc2632/" target="_blank">Yaohui Cai</a>,
542-
<a href="https://www.linkedin.com/in/hins-hu/" target="_blank">Hins Hu</a>,
543-
<a href="https://tonyjie.github.io/" target="_blank">Jiajie Li</a>,
632+
<a href="https://chhzh123.github.io/" target="_blank">Hongzheng Chen</a><sup>*</sup>,
633+
<a href="https://isjakewong.github.io/" target="_blank">Yingheng Wang</a><sup>*</sup>,
634+
<a href="https://www.csl.cornell.edu/~yc2632/" target="_blank">Yaohui Cai</a><sup>*</sup>,
635+
<a href="https://www.linkedin.com/in/hins-hu/" target="_blank">Hins Hu</a><sup>*</sup>,
636+
<a href="https://tonyjie.github.io/" target="_blank">Jiajie Li</a><sup>*</sup>,
544637
<a href="https://www.linkedin.com/in/shirley-huang-6b3ba217b/" target="_blank">Shirley Huang</a>,
545638
<a href="https://chenhui1016.github.io/" target="_blank">Chenhui Deng</a>,
546639
<a href="https://research.nvidia.com/person/rongjian-liang" target="_blank">Rongjian Liang</a>,
@@ -550,6 +643,7 @@
550643
<a href="https://www.cs.cornell.edu/gomes/" target="_blank">Carla P. Gomes</a>,
551644
<a href="https://www.csl.cornell.edu/~zhiruz/" target="_blank">Zhiru Zhang</a>
552645
</div>
646+
<div class="authors-note"><sup>*</sup> Equal contribution</div>
553647
<div class="institutions">
554648
<img class="inst-logo inst-logo-cornell" src="assets/cornell.svg" alt="Cornell University">
555649
<img class="inst-logo inst-logo-harvard" src="assets/harvard.svg" alt="Harvard University">
@@ -664,6 +758,7 @@ <h2>Per-Problem Results</h2>
664758
<th class="center" data-prob-col="QYI">QYI ↕<span class="sort-icon"></span></th>
665759
<th class="center" data-prob-col="Yield">Yield ↕<span class="sort-icon"></span></th>
666760
<th class="center" data-prob-col="Quality">Quality ↕<span class="sort-icon"></span></th>
761+
<th class="center" style="width:80px">Solver</th>
667762
</tr>
668763
</thead>
669764
<tbody></tbody>
@@ -1107,6 +1202,10 @@ <h2>Solve Metrics (T = 0)</h2>
11071202
rows.forEach(d => {
11081203
const pct = Math.max(0, Math.min(100, d.QYI * 100));
11091204
const color = `hsl(${(d.QYI*120).toFixed(0)},65%,42%)`;
1205+
const hasSolver = !!SOLVER_KEY[d.Model];
1206+
const codeBtn = hasSolver
1207+
? `<button class="bar-code-btn" onclick="showCode('${d.Model}','${currentProblem}')" title="View solver code">⌨</button>`
1208+
: "";
11101209
const div = document.createElement("div");
11111210
div.className = "bar-row";
11121211
div.innerHTML = `
@@ -1115,6 +1214,7 @@ <h2>Solve Metrics (T = 0)</h2>
11151214
<div class="bar-fill" style="width:${pct}%;background:${color}"></div>
11161215
</div>
11171216
<div class="bar-val" style="color:${color}">${fmt(d.QYI)}</div>
1217+
${codeBtn}
11181218
`;
11191219
inner.appendChild(div);
11201220
});
@@ -1124,12 +1224,17 @@ <h2>Solve Metrics (T = 0)</h2>
11241224
tbody.innerHTML = "";
11251225
rows.forEach(d => {
11261226
const meta = metadata.find(m => m.Model === d.Model) || {};
1227+
const hasSolver = !!SOLVER_KEY[d.Model];
1228+
const codeCell = hasSolver
1229+
? `<td class="metric-cell center"><button class="code-view-btn" onclick="showCode('${d.Model}','${currentProblem}')">⌨ Code</button></td>`
1230+
: `<td class="metric-cell center" style="color:var(--text-muted);font-size:0.8rem">—</td>`;
11271231
const tr = document.createElement("tr");
11281232
tr.innerHTML = `
11291233
<td class="model-cell"><a href="${meta.URL||'#'}" target="_blank">${d.Model}</a></td>
11301234
<td class="metric-cell center"><span class="heat" style="background:${heatColor(d.QYI)};color:${heatText(d.QYI)}">${fmt(d.QYI)}</span></td>
11311235
<td class="metric-cell center"><span class="heat" style="background:${heatColor(d.Yield)};color:${heatText(d.Yield)}">${fmt(d.Yield)}</span></td>
11321236
<td class="metric-cell center"><span class="heat" style="background:${heatColor(d.Quality)};color:${heatText(d.Quality)}">${fmt(d.Quality)}</span></td>
1237+
${codeCell}
11331238
`;
11341239
tbody.appendChild(tr);
11351240
});
@@ -1266,6 +1371,87 @@ <h2>Solve Metrics (T = 0)</h2>
12661371
}
12671372

12681373
init();
1374+
1375+
// ── SOLVER VIEWER ──────────────────────────────────────────────────────────────
1376+
const SOLVER_KEY = {
1377+
"Gemini-3.1-Pro": "gemini-3.1-pro-preview",
1378+
"GPT-5.3-Codex": "gpt-5.3-codex",
1379+
"Claude-Opus-4.6": "claude-opus-4-6",
1380+
"GLM-5": "glm-5",
1381+
"Gemini-3-Flash": "gemini-3-flash-preview",
1382+
"Grok-4": "grok-4",
1383+
"Kimi-K2.5": "kimi-k2.5",
1384+
"Qwen3.5-397B": "qwen3.5-397b-a17b",
1385+
"MiniMax-M2.5": "minimax-m2.5",
1386+
"DeepSeek-V3.2": "deepseek-v3.2",
1387+
};
1388+
let solversData = null;
1389+
1390+
async function loadSolvers() {
1391+
if (solversData) return solversData;
1392+
const r = await fetch("results/solvers.json");
1393+
solversData = await r.json();
1394+
return solversData;
1395+
}
1396+
1397+
async function showCode(modelName, problemKey) {
1398+
const solverKey = SOLVER_KEY[modelName];
1399+
if (!solverKey) return;
1400+
const data = await loadSolvers();
1401+
const code = data?.[solverKey]?.[problemKey];
1402+
if (!code) return;
1403+
1404+
const pInfo = PROBLEMS.find(p => p.key === problemKey);
1405+
document.getElementById("cm-model").textContent = modelName;
1406+
document.getElementById("cm-problem").textContent = pInfo ? pInfo.label : problemKey;
1407+
1408+
const codeEl = document.getElementById("cm-code");
1409+
codeEl.removeAttribute("data-highlighted");
1410+
codeEl.textContent = code;
1411+
if (!window.hljs) await loadHljs();
1412+
hljs.highlightElement(codeEl);
1413+
1414+
const modal = document.getElementById("code-modal");
1415+
modal.classList.remove("hidden");
1416+
document.body.style.overflow = "hidden";
1417+
document.getElementById("cm-copy-btn").textContent = "Copy";
1418+
document.getElementById("cm-copy-btn").classList.remove("copied");
1419+
}
1420+
1421+
function closeCodeModal() {
1422+
document.getElementById("code-modal").classList.add("hidden");
1423+
document.body.style.overflow = "";
1424+
}
1425+
1426+
function copyCode() {
1427+
const code = document.getElementById("cm-code").textContent;
1428+
navigator.clipboard.writeText(code).then(() => {
1429+
const btn = document.getElementById("cm-copy-btn");
1430+
btn.textContent = "Copied!";
1431+
btn.classList.add("copied");
1432+
setTimeout(() => { btn.textContent = "Copy"; btn.classList.remove("copied"); }, 1800);
1433+
});
1434+
}
1435+
1436+
function loadHljs() {
1437+
return new Promise(resolve => {
1438+
const link = document.createElement("link");
1439+
link.rel = "stylesheet";
1440+
link.href = "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/styles/github-dark.min.css";
1441+
document.head.appendChild(link);
1442+
const s = document.createElement("script");
1443+
s.src = "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/highlight.min.js";
1444+
s.onload = () => {
1445+
const py = document.createElement("script");
1446+
py.src = "https://cdnjs.cloudflare.com/ajax/libs/highlight.js/11.9.0/languages/python.min.js";
1447+
py.onload = resolve;
1448+
document.head.appendChild(py);
1449+
};
1450+
document.head.appendChild(s);
1451+
});
1452+
}
1453+
1454+
document.addEventListener("keydown", e => { if (e.key === "Escape") closeCodeModal(); });
12691455
</script>
12701456
</body>
12711457
</html>

results/solvers.json

Lines changed: 1 addition & 0 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)