Spaces:
Sleeping
Sleeping
Download index.html from Mushari440/benchmark: direct link, hf CLI and curl.
- Browser
- Download file 98.5 kB
-
https://huggingface.co/spaces/Mushari440/benchmark/resolve/main/index.html
- Command line
-
hf download hf://spaces/Mushari440/benchmark/index.html
-
curl -L -o index.html https://huggingface.co/spaces/Mushari440/benchmark/resolve/main/index.html
98.5 kB
<!DOCTYPE html>
<html lang="en" data-theme="dark">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Arabic LLM Leaderboard</title>
<meta name="description" content="A hard, discriminating benchmark for Modern Standard Arabic — models graded by strong LLM judges." />
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link href="https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,600;9..144,700&family=Amiri:wght@400;700&family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap" rel="stylesheet" />
<style>
:root{
--emerald-900:#04231e; --emerald-800:#063f37; --emerald-700:#0b5d50; --emerald-600:#0f766e;
--emerald-500:#10b981; --emerald-400:#34d399; --emerald-300:#6ee7b7;
--gold-600:#c99a3f; --gold-500:#dcb15a; --gold-400:#e7c877; --gold-300:#efd08a;
}
:root[data-theme="dark"]{
--bg:#071411; --bg2:#0a1a16; --surface:#0e211c; --surface2:#123029; --border:rgba(120,190,170,.16);
--ink:#eaf3ef; --ink-soft:#b7cec6; --ink-mute:#7f9a91;
--accent:var(--emerald-400); --accent-strong:var(--emerald-300); --gold:var(--gold-400);
--row-hover:rgba(16,185,129,.10); --head-bg:rgba(16,185,129,.13); --head-bd:var(--emerald-500);
--cell-heat:16,185,129;
--freeze:#0e211c; --freeze-hover:#15302a; --head-solid:#0e3529; --scroll-track:#0a1a16;
}
:root[data-theme="light"]{
--bg:#f6f3ea; --bg2:#efeadd; --surface:#fffdf7; --surface2:#f3efe4; --border:rgba(20,80,66,.16);
--ink:#122a23; --ink-soft:#3a544c; --ink-mute:#6d857c;
--accent:var(--emerald-600); --accent-strong:var(--emerald-700); --gold:var(--gold-600);
--row-hover:rgba(15,118,110,.07); --head-bg:rgba(15,118,110,.10); --head-bd:var(--emerald-600);
--cell-heat:5,150,105;
--freeze:#fffdf7; --freeze-hover:#eef4ed; --head-solid:#e7f0e9; --scroll-track:#e7e0d0;
}
*{box-sizing:border-box}
html,body{margin:0;padding:0;overscroll-behavior-x:none}
body{
background:
radial-gradient(120% 90% at 88% -8%, rgba(201,154,63,.10), transparent 55%),
radial-gradient(120% 90% at 8% -6%, rgba(16,185,129,.10), transparent 55%),
var(--bg);
color:var(--ink);
font-family:"IBM Plex Sans",ui-sans-serif,system-ui,sans-serif;
font-size:15px; line-height:1.5; -webkit-font-smoothing:antialiased;
}
.wrap{max-width:1840px;margin:0 auto;padding:20px clamp(12px,1.25vw,24px) 72px}
a{color:var(--accent); text-decoration:none}
a:hover{text-decoration:underline; text-decoration-style:dotted}
/* ---------------- Masthead ---------------- */
.masthead{
position:relative; overflow:hidden; border-radius:18px; padding:25px 34px 24px;
color:#f3efe4; margin-bottom:20px;
background:radial-gradient(130% 150% at 12% 8%, #0c6355 0%, #074237 46%, #04231e 100%);
border:1px solid rgba(201,154,63,.32);
box-shadow:0 26px 60px -30px rgba(0,0,0,.75), inset 0 1px 0 rgba(255,255,255,.05);
}
.masthead::before{content:"";position:absolute;inset:0;pointer-events:none;opacity:.15;
background-image:radial-gradient(circle at 88% 16%, rgba(231,200,119,.55) 0, transparent 42%),
repeating-linear-gradient(135deg, rgba(255,255,255,.05) 0 2px, transparent 2px 16px);
-webkit-mask-image:linear-gradient(90deg,transparent 42%,#000 100%); mask-image:linear-gradient(90deg,transparent 42%,#000 100%);}
.masthead::after{content:"";position:absolute;left:34px;right:34px;bottom:0;height:2px;
background:linear-gradient(90deg,transparent,#c99a3f 22%,#efd08a 50%,#c99a3f 78%,transparent);opacity:.75}
.mh-top{display:flex;justify-content:space-between;align-items:flex-start;gap:16px}
.eyebrow{font:600 11.5px/1 "IBM Plex Sans";letter-spacing:.3em;text-transform:uppercase;color:#ecd08a}
.titles{display:flex;align-items:baseline;gap:20px;flex-wrap:wrap;margin:13px 0 8px}
.title-en{margin:0;font:600 clamp(30px,4.6vw,48px)/1 "Fraunces",Georgia,serif;color:#fdfbf4;letter-spacing:-.012em}
.title-ar{font:700 clamp(23px,3.4vw,37px)/1.2 "Amiri",serif;color:#ecd08a;direction:rtl}
.tagline{max-width:88ch;margin:2px 0 0;font:400 15px/1.6 "IBM Plex Sans";color:#cfe6dd}
.stats{margin-top:17px;display:flex;gap:11px;flex-wrap:wrap;align-items:center;font:500 12.5px/1 "IBM Plex Sans";color:#b6d4ca}
.stats b{color:#fff;font-weight:700}.stats .dot{color:#c99a3f;font-size:8px;opacity:.85}
.theme-btn{flex:none;background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.16);color:#f3efe4;
border-radius:10px;padding:8px 12px;cursor:pointer;font:600 13px/1 "IBM Plex Sans";transition:background .15s}
.theme-btn:hover{background:rgba(255,255,255,.16)}
.mh-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap;justify-content:flex-end}
.mh-who{color:#cfe6dd;font-size:12.5px;white-space:nowrap}
.mh-who b{color:#fff}.mh-who a{color:var(--gold-300)}
.btn-submit-top{box-shadow:0 10px 24px -12px rgba(16,185,129,.8)}
/* ---------------- Controls ---------------- */
.controls{display:flex;flex-wrap:wrap;gap:14px;align-items:center;margin-bottom:16px}
/* Keep this above the results so the owner can leave an empty archive. */
.verbar{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:14px}
.verbar label{font:600 12px "IBM Plex Sans";letter-spacing:.02em;color:var(--ink-soft)}
.verbar select{padding:8px 12px;border-radius:10px;border:1px solid var(--border);
background:var(--bg2);color:var(--ink);font:500 13.5px "IBM Plex Sans"}
.verbar select:focus{outline:2px solid var(--accent);outline-offset:0;border-color:transparent}
.search{flex:1 1 260px;position:relative}
.search input{width:100%;padding:11px 14px 11px 38px;border-radius:12px;border:1px solid var(--border);
background:var(--surface);color:var(--ink);font:500 14px "IBM Plex Sans"}
.search input::placeholder{color:var(--ink-mute)}
.search svg{position:absolute;left:12px;top:50%;transform:translateY(-50%);opacity:.5}
.chips{display:flex;gap:8px;flex-wrap:wrap}
.chip{border:1px solid var(--border);background:var(--surface);color:var(--ink-soft);border-radius:999px;
padding:8px 14px;font:600 12.5px "IBM Plex Sans";cursor:pointer;transition:all .12s;user-select:none}
.chip[aria-pressed="true"]{background:var(--accent);border-color:var(--accent);color:#04231e}
.range{display:flex;align-items:center;gap:10px;background:var(--surface);border:1px solid var(--border);
border-radius:12px;padding:8px 14px;font:600 12.5px "IBM Plex Sans";color:var(--ink-soft)}
.range input[type=range]{accent-color:var(--accent);width:110px}
.range .rv{font-family:"IBM Plex Mono";color:var(--ink);min-width:22px;text-align:right}
/* ---------------- Table ---------------- */
.board-card{background:var(--surface);border:1px solid var(--border);border-radius:16px;overflow:hidden;
box-shadow:0 16px 40px -30px rgba(0,0,0,.5)}
.board-scroll{overflow-x:auto;overflow-y:hidden;-webkit-overflow-scrolling:touch;
overscroll-behavior-x:none;scrollbar-width:thin;scrollbar-color:var(--ink-mute) var(--scroll-track)}
.board-scroll::-webkit-scrollbar{height:12px}
.board-scroll::-webkit-scrollbar-track{background:var(--scroll-track)}
.board-scroll::-webkit-scrollbar-thumb{background:var(--ink-mute);border-radius:8px;border:3px solid var(--scroll-track)}
.board-scroll::-webkit-scrollbar-thumb:hover{background:var(--accent)}
table.board{border-collapse:separate;border-spacing:0;width:100%;font-variant-numeric:tabular-nums}
table.board th,table.board td{padding:10px clamp(6px,.48vw,12px);white-space:nowrap;text-align:right}
table.board th:nth-child(2),table.board td:nth-child(2){padding-inline:12px}
.board-scroll:focus-visible{outline:2px solid var(--accent-strong);outline-offset:-2px}
.sort-heading{background:none;border:0;padding:0;color:inherit;font:inherit;letter-spacing:inherit;cursor:pointer}
.sort-heading:focus-visible{outline:2px solid var(--accent-strong);outline-offset:4px;border-radius:2px}
table.board th:nth-child(-n+2),table.board td:nth-child(-n+2){text-align:left}
table.board thead th{position:sticky;top:0;z-index:4;background:var(--head-solid);
border-bottom:2px solid var(--head-bd);
font:700 12px "IBM Plex Sans";letter-spacing:.02em;color:var(--ink);cursor:pointer;user-select:none}
table.board thead th .arrow{color:var(--accent);font-size:10px;margin-left:3px;opacity:.9}
table.board thead th.sub{font-size:11px;color:var(--ink-soft);font-weight:600}
table.board tbody tr{border-bottom:1px solid var(--border)}
table.board tbody tr:hover{background:var(--row-hover)}
table.board tbody td{font-size:13.5px}
/* Frozen identity columns — keep Rank + Model pinned while scrolling the task columns. */
table.board th:nth-child(1),table.board td:nth-child(1){position:sticky;left:0;z-index:3;
background:var(--freeze);width:46px;min-width:46px;max-width:46px;padding-left:14px;padding-right:4px}
table.board th:nth-child(2),table.board td:nth-child(2){position:sticky;left:46px;z-index:3;background:var(--freeze)}
table.board thead th:nth-child(1),table.board thead th:nth-child(2){z-index:5;background:var(--head-solid)}
table.board tbody tr:hover td:nth-child(1),table.board tbody tr:hover td:nth-child(2){background:var(--freeze-hover)}
/* subtle shadow on the pinned block's edge, shown only once scrolled right */
.board-scroll.scrolled table.board th:nth-child(2),.board-scroll.scrolled table.board td:nth-child(2){
box-shadow:13px 0 15px -12px rgba(0,0,0,.6)}
.rank{font-family:"IBM Plex Mono";font-weight:700;color:var(--ink-mute)}
.rank.top{color:#04231e;display:inline-flex;align-items:center;justify-content:center;width:26px;height:26px;border-radius:8px;font-size:13px}
.rank.r1{background:linear-gradient(135deg,#f4d980,#c99a3f)}
.rank.r2{background:linear-gradient(135deg,#e6e6ea,#b8bcc6)}
.rank.r3{background:linear-gradient(135deg,#e3b489,#c0824e)}
.model-cell{display:flex;flex-direction:column;gap:2px;max-width:clamp(235px,20vw,344px)}
.model-cell .name{font-weight:600;color:var(--ink);overflow:hidden;text-overflow:ellipsis}
.model-cell .effort{font-weight:600;opacity:.95}
.org{font-size:11.5px;color:var(--ink-mute)}
.type-ico{font-size:13px;margin-right:2px}
.avg-cell{min-width:105px}
.avg-num{font:700 15px "IBM Plex Mono";color:var(--accent-strong)}
.avg-bar{height:5px;border-radius:3px;background:var(--surface2);margin-top:5px;overflow:hidden}
.avg-bar>i{display:block;height:100%;border-radius:3px;background:linear-gradient(90deg,var(--emerald-600),var(--emerald-400))}
.score{font-family:"IBM Plex Mono";font-weight:500;border-radius:7px;padding:5px 8px;display:inline-block;min-width:46px;text-align:right}
/* best score in each task column (across all shown models) */
.score.na{color:var(--muted);opacity:.55;font-weight:400}
.score.best{font-weight:800;color:var(--ink);box-shadow:inset 0 0 0 2px var(--gold),0 4px 12px -6px rgba(201,154,63,.5)}
.meta-num{font-family:"IBM Plex Mono";color:var(--ink-soft);font-size:12.5px}
.note{color:var(--ink-mute);font-size:12.5px;margin:12px 4px 0;line-height:1.55}
.note b{color:var(--ink-soft)}
/* queue + submit */
/* Author `display` rules (e.g. .grid2 below) outrank the UA stylesheet's
[hidden]{display:none}, so an element with class + hidden stays visible.
This restores the attribute as the last word. */
[hidden]{display:none!important}
.grid2{display:grid;grid-template-columns:1fr 1fr;gap:18px;margin-top:26px}
.grid2.one{grid-template-columns:1fr}
.panel{background:var(--surface);border:1px solid var(--border);border-radius:16px;padding:20px 22px}
.panel h3{margin:0 0 12px;font:700 15px "IBM Plex Sans";color:var(--ink);display:flex;align-items:center;gap:8px}
.panel h3 .k{font:600 11px "IBM Plex Sans";letter-spacing:.06em;color:var(--gold);text-transform:uppercase}
.qrow{display:flex;justify-content:space-between;align-items:center;gap:10px;padding:8px 0;border-bottom:1px dashed var(--border);font-size:13px}
.qrow:last-child{border-bottom:0}
.mrow{display:flex;align-items:center;gap:10px;padding:7px 0;border-bottom:1px dashed var(--border);font-size:13px}
.mrow:last-child{border-bottom:0}
.mrow .mname{flex:1 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.mbtn{font:600 11px "IBM Plex Sans";padding:4px 10px;border-radius:999px;border:1px solid var(--border);
background:transparent;color:var(--ink-soft);cursor:pointer}
.mbtn:hover{border-color:var(--accent);color:var(--accent)}
.mbtn.danger:hover{border-color:#e06666;color:#e06666}
.b-private{background:rgba(120,120,200,.16);color:#9aa4e0}
.vchip{font:600 10px "IBM Plex Mono";padding:2px 7px;border-radius:6px;border:1px solid var(--border);
color:var(--ink-mute);white-space:nowrap}
.vchip.on{border-color:var(--accent);color:var(--accent)}
.vchip.here{box-shadow:inset 0 0 0 1px var(--accent)}
.mbar{display:flex;align-items:center;gap:9px;flex-wrap:wrap;padding:9px 0 11px;
border-bottom:1px solid var(--border);margin-bottom:6px}
.mbar .grow{flex:1 1 auto}
.prog{margin:2px 0 12px;padding:11px 13px;border-radius:12px;background:rgba(var(--cell-heat),.07);
border:1px solid var(--border)}
.prog .ptop{display:flex;align-items:baseline;gap:9px;flex-wrap:wrap;font-size:13px}
.prog .pmodel{font-weight:700}
.prog .pphase{font:600 10.5px "IBM Plex Sans";letter-spacing:.04em;padding:2px 8px;border-radius:999px;
background:rgba(16,185,129,.16);color:var(--accent)}
.prog .pnums{margin-left:auto;font-family:"IBM Plex Mono";font-size:12px;color:var(--ink-soft)}
.pbar{height:7px;border-radius:999px;background:rgba(255,255,255,.07);margin-top:9px;overflow:hidden}
.pbar i{display:block;height:100%;background:linear-gradient(90deg,var(--accent),#6ee7b7);transition:width .5s}
.pmeta{margin-top:7px;font-size:11.5px;color:var(--ink-mute);font-family:"IBM Plex Mono"}
.qcount{float:right;font-family:"IBM Plex Mono";font-size:12px;color:var(--ink-mute);font-weight:400}
.qnum{font-family:"IBM Plex Mono";font-size:11.5px;color:var(--ink-mute);min-width:22px;text-align:right;flex:0 0 auto}
.qrow a{flex:1 1 auto;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.badge{font:600 10.5px "IBM Plex Sans";letter-spacing:.04em;text-transform:uppercase;padding:3px 8px;border-radius:999px}
.b-pending{background:rgba(201,154,63,.16);color:var(--gold)}
.b-running{background:rgba(16,185,129,.16);color:var(--accent)}
.b-failed{background:rgba(229,90,90,.16);color:#e88}
.panel ol{margin:0;padding-left:20px}.panel li{margin:6px 0;color:var(--ink-soft);font-size:13.5px}
.panel code{font-family:"IBM Plex Mono";font-size:12px;background:var(--surface2);padding:2px 6px;border-radius:6px;color:var(--ink)}
.state{padding:60px 20px;text-align:center;color:var(--ink-mute)}
.spinner{width:34px;height:34px;border-radius:50%;border:3px solid var(--border);border-top-color:var(--accent);
animation:spin .8s linear infinite;margin:0 auto 14px}
@keyframes spin{to{transform:rotate(360deg)}}
footer{margin-top:30px;text-align:center;color:var(--ink-mute);font-size:12px}
/* ---------------- Submit button + auth ---------------- */
.btn{border:0;border-radius:12px;padding:11px 18px;font:700 14px "IBM Plex Sans";cursor:pointer;
display:inline-flex;align-items:center;gap:8px;justify-content:center;transition:filter .15s,background .15s}
.btn-primary{background:linear-gradient(135deg,var(--emerald-500),var(--emerald-600));color:#04231e}
.btn-primary:hover{filter:brightness(1.07)}
.btn-ghost{background:var(--surface2);color:var(--ink);border:1px solid var(--border)}
.btn-ghost:hover{background:var(--row-hover)}
.btn:disabled{opacity:.55;cursor:not-allowed}
.who{font-size:12.5px;color:var(--ink-mute)}.who b{color:var(--ink-soft)}
.submit-intro{margin:0 0 14px;color:var(--ink-soft);font-size:13.5px;line-height:1.55}
/* ---------------- Modal ---------------- */
.modal{position:fixed;inset:0;z-index:60;display:none;align-items:center;justify-content:center;padding:20px;
background:rgba(3,12,10,.62);backdrop-filter:blur(3px)}
.modal.open{display:flex}
.modal-card{width:min(520px,100%);max-height:90vh;overflow:auto;background:var(--surface);border:1px solid var(--border);
border-radius:18px;padding:24px 26px 20px;box-shadow:0 30px 80px -30px rgba(0,0,0,.7)}
.modal-card h2{margin:0 0 3px;font:700 21px "Fraunces",Georgia,serif;color:var(--ink)}
.modal-card .sub{margin:0 0 18px;color:var(--ink-mute);font-size:13px}
.x-close{float:right;background:none;border:0;color:var(--ink-mute);font-size:24px;cursor:pointer;line-height:1;margin:-4px -6px 0 0}
.x-close:hover{color:var(--ink)}
.field{margin-bottom:14px}
.field label{display:block;font:600 12px "IBM Plex Sans";letter-spacing:.02em;color:var(--ink-soft);margin-bottom:6px}
.field input,.field select{width:100%;padding:10px 12px;border-radius:10px;border:1px solid var(--border);
background:var(--bg2);color:var(--ink);font:500 14px "IBM Plex Sans"}
.field input:focus,.field select:focus{outline:2px solid var(--accent);outline-offset:0;border-color:transparent}
.field .hint{font-size:11.5px;color:var(--ink-mute);margin-top:5px}
.field .hint code{font-family:"IBM Plex Mono";font-size:11px;background:var(--surface2);padding:1px 5px;border-radius:5px}
.row2{display:grid;grid-template-columns:1fr 1fr;gap:12px}
.modal-actions{display:flex;gap:10px;align-items:center;margin-top:10px}
.msg{margin-top:12px;padding:11px 13px;border-radius:10px;font-size:13px;display:none;line-height:1.5}
.msg.show{display:block}
.msg.ok{background:rgba(16,185,129,.14);color:var(--accent-strong);border:1px solid rgba(16,185,129,.32)}
.msg.err{background:rgba(229,90,90,.14);color:#f0a3a3;border:1px solid rgba(229,90,90,.32)}
.signin-box{text-align:center;padding:8px 0 6px}
.signin-box p{color:var(--ink-soft);font-size:13.5px;margin:0 0 16px;line-height:1.55}
.hf-btn{background:#ff9d00;color:#141414;border:0;border-radius:11px;padding:12px 20px;
font:700 14px "IBM Plex Sans";cursor:pointer;display:inline-flex;gap:9px;align-items:center}
.hf-btn:hover{filter:brightness(1.06)}
@media(max-width:720px){.wrap{padding:14px 12px 60px}.masthead{padding:24px 22px}.grid2{grid-template-columns:1fr}.row2{grid-template-columns:1fr}
.model-cell{max-width:150px}}
/* Model detail view keeps the board's colours and type, with its own narrow table. */
table.board tbody tr[data-detail-index]{cursor:pointer}
table.board tbody tr[data-detail-index]:focus-visible{outline:2px solid var(--accent-strong);outline-offset:-2px}
.model-cell button.name{background:none;border:0;padding:0;text-align:left;font:inherit;font-weight:600;cursor:pointer;white-space:nowrap}
.model-cell button.name:hover{text-decoration:underline;text-underline-offset:3px}
.model-cell button.name:focus-visible,.model-hub:focus-visible{outline:2px solid var(--accent-strong);outline-offset:3px}
.model-hub{margin-left:8px;font-size:11px;color:var(--ink-mute)}
.subtask-dialog{width:min(1000px,calc(100vw - 32px));max-height:88vh;box-sizing:border-box;padding:0;border:1px solid var(--border);border-radius:16px;background:var(--surface);color:var(--ink);box-shadow:0 24px 80px #0006}
.subtask-dialog::backdrop{background:#061b16b8;backdrop-filter:blur(3px)}
.subtask-dialog-header{position:sticky;top:0;background:var(--surface);z-index:2;border-bottom:1px solid var(--border);padding:22px 26px 18px;display:flex;gap:18px;align-items:flex-start;justify-content:space-between}
.subtask-dialog h2{font:700 22px "Fraunces",Georgia,serif;margin:0;overflow-wrap:anywhere}
.subtask-dialog-header p{color:var(--ink-mute);font-size:13px;margin:7px 0 0}
.subtask-close{flex:none;border:1px solid var(--border);background:var(--surface2);color:var(--ink);border-radius:8px;padding:8px 13px;cursor:pointer;font:inherit}
.subtask-close:focus-visible{outline:2px solid var(--accent-strong);outline-offset:3px}
.subtask-body{padding:8px 26px 26px}
.subtask-policy,.subtask-empty{color:var(--ink-mute);font-size:13px;line-height:1.6}
.subtask-group{margin-top:24px}
.subtask-group h3{display:flex;justify-content:space-between;gap:12px;align-items:baseline;font-size:16px;margin:0 0 10px}
.subtask-group h3 span{font-size:12px;font-weight:400;color:var(--ink-mute);white-space:nowrap}
.subtask-table-scroll{overflow-x:auto}
.subtask-table{width:100%;border-collapse:collapse;font-size:13px}
.subtask-table th,.subtask-table td{padding:10px 12px;border-bottom:1px solid var(--border);text-align:right;font-variant-numeric:tabular-nums}
.subtask-table th{font-size:11px;color:var(--ink-mute);font-weight:600}
.subtask-table th:first-child,.subtask-table td:first-child{text-align:left;min-width:230px}
.subtask-table .subtask-score{font-weight:600;color:var(--accent-strong)}
@media(max-width:600px){.subtask-dialog-header{padding:18px 16px}.subtask-dialog h2{font-size:19px}.subtask-body{padding:4px 16px 20px}.subtask-group h3{display:block}.subtask-group h3 span{display:block;margin-top:5px}}
.compare-open{border:1px solid var(--accent);border-radius:10px;padding:10px 14px;font:600 13px "IBM Plex Sans",sans-serif;background:var(--surface2);color:var(--accent-strong);cursor:pointer}
.compare-open:disabled{opacity:.5;cursor:default}
.compare-open:focus-visible,.comparison-controls button:focus-visible,.comparison-pickers select:focus-visible,.comparison-controls select:focus-visible{outline:2px solid var(--gold);outline-offset:3px}
.comparison-dialog{width:min(1120px,calc(100vw - 32px))}
.comparison-pickers{display:grid;grid-template-columns:minmax(0,1fr) auto minmax(0,1fr);gap:12px;align-items:end;margin:18px 0}
.comparison-pickers label{display:flex;flex-direction:column;gap:7px;min-width:0;font-size:13px;color:var(--ink-soft)}
.comparison-pickers select,.comparison-controls select{width:100%;min-width:0;border:1px solid var(--border);border-radius:8px;padding:10px;background:var(--surface2);color:var(--ink);font:inherit}
.comparison-controls{display:flex;gap:12px;align-items:center;justify-content:space-between;flex-wrap:wrap;margin:18px 0 10px}
.comparison-modes{display:flex;gap:6px}
.comparison-controls button,.comparison-swap{border:1px solid var(--border);border-radius:8px;padding:9px 14px;font:inherit;background:var(--surface2);color:var(--ink);cursor:pointer}
.comparison-modes button[aria-pressed="true"]{border-color:var(--accent);background:var(--head-bg);color:var(--accent-strong);font-weight:600}
.comparison-sort{display:flex;gap:8px;align-items:center;font-size:12px;color:var(--ink-mute)}
.comparison-sort select{width:auto}
.comparison-counts{font-size:13px;color:var(--ink-soft);margin:12px 0}
.comparison-warning{font-size:13px;border-left:3px solid var(--gold);padding:10px 14px;background:var(--surface2);color:var(--ink-soft)}
.comparison-table td:not(:first-child){white-space:nowrap;font-variant-numeric:tabular-nums}
.comparison-table small{display:block;font:400 11px/1.5 "IBM Plex Sans",sans-serif;color:var(--ink-mute);margin-top:3px}
.comparison-delta{font-weight:600}.comparison-delta.positive{color:var(--accent-strong)}.comparison-delta.negative{color:#ed9c92}.comparison-delta.tied,.comparison-na{color:var(--ink-mute)}
:root[data-theme="light"] .comparison-delta.negative{color:#a63f35}
@media(max-width:600px){.comparison-pickers{grid-template-columns:minmax(0,1fr);gap:10px}.comparison-swap{justify-self:start}.comparison-controls{align-items:flex-start}.comparison-table th:first-child,.comparison-table td:first-child{min-width:180px}.comparison-sort{width:100%}}
</style>
</head>
<body>
<div class="wrap">
<header class="masthead">
<div class="mh-top">
<div class="eyebrow">Modern Standard Arabic · LLM Evaluation</div>
<div class="mh-actions">
<span class="mh-who" id="whoami"></span>
<button class="btn btn-primary btn-submit-top" id="openSubmit">+ Submit your model</button>
<button class="theme-btn" id="themeBtn" title="Toggle light / dark">◐ Theme</button>
</div>
</div>
<div class="titles">
<h1 class="title-en">Arabic LLM Leaderboard</h1>
<span class="title-ar">لوحة صدارة نماذج اللغة العربية</span>
</div>
<p class="tagline">Compare language models across Arabic language, reasoning, knowledge and dialogue tasks.</p>
<div class="stats">
<span><b id="itemCount">31,846</b> items</span><i class="dot">◆</i>
<span><b id="subtaskCount">75</b> subtasks</span><i class="dot">◆</i>
<span><b id="catCount">11</b> categories</span><i class="dot">◆</i>
<span><b>5</b> formats</span><i class="dot">◆</i>
<span><b id="modelCount">—</b> models</span><i class="dot">◆</i>
<span>LLM-as-Judge</span>
</div>
</header>
<div class="verbar" id="versionBar" hidden>
<label for="verSel">Benchmark version</label>
<select id="verSel"></select>
</div>
<div class="controls" id="controls" hidden>
<div class="search">
<svg width="16" height="16" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><circle cx="11" cy="11" r="7"/><path d="M21 21l-4.3-4.3"/></svg>
<input id="search" type="search" placeholder="Search models…" autocomplete="off" />
</div>
<button type="button" id="openComparison" class="compare-open" aria-haspopup="dialog" disabled>Compare models</button>
<div class="chips" id="typeChips"></div>
<div class="chips" id="precChips"></div>
<label class="range">Params ≤ <input id="paramMax" type="range" min="0" max="72" step="1" value="72"><span class="rv" id="paramRV">72</span>B</label>
</div>
<div class="board-card">
<div class="board-scroll" tabindex="0" aria-label="Leaderboard scores">
<div class="state" id="state"><div class="spinner"></div>Loading the leaderboard…</div>
<table class="board" id="board" hidden><thead id="thead"></thead><tbody id="tbody"></tbody></table>
</div>
</div>
<p class="note" id="note" hidden>The <b>Average</b> is the <b>item-weighted</b> mean across <span id="dimCount">13</span> capability & domain dimensions — every benchmark item counts equally, so a small bucket never outweighs a large one. <b>Knowledge & STEM</b> includes medicine and biology. Category cells are shaded by score, and the <b>gold-outlined</b> cell is the top score in each task column. Click a model row to view subtask results. Click any column header to sort.</p>
<div class="grid2 one" id="managePanel" hidden>
<div class="panel">
<h3><span class="k">Manage</span> Your submitted models<span id="manageCount" class="qcount"></span></h3>
<div class="mbar" id="manageBar" hidden>
<span class="vchip here" id="mbarVer"></span>
<span class="grow" style="font-size:12px;color:var(--ink-mute)" id="mbarNote"></span>
<button class="mbtn" id="btnQueueMissing">Queue models missing here</button>
<button class="mbtn" id="btnQueueAll">Re-queue all, scored included</button>
</div>
<div id="manageList"><div class="mrow" style="color:var(--ink-mute)">Loading…</div></div>
<div class="msg" id="manageMsg"></div>
</div>
</div>
<div class="grid2 one">
<div class="panel">
<h3><span class="k">Queue</span> Evaluation status<span id="queueCount" class="qcount"></span></h3>
<div id="progress" hidden></div>
<div id="queue"><div class="qrow" style="color:var(--ink-mute)">Loading queue…</div></div>
</div>
</div>
<footer>
Data read live from <a href="https://huggingface.co/datasets/Mushari440/results" target="_blank" rel="noopener">Mushari440/results</a> ·
<span id="updated"></span> · Built for Modern Standard Arabic.
</footer>
</div>
<!-- ---------------- Submit modal ---------------- -->
<div class="modal" id="submitModal" aria-hidden="true">
<div class="modal-card" role="dialog" aria-modal="true" aria-labelledby="smTitle">
<button class="x-close" id="closeSubmit" aria-label="Close">×</button>
<h2 id="smTitle">Submit a model</h2>
<p class="sub">Evaluate a public Hugging Face model on the Arabic benchmark.</p>
<div id="signinView" class="signin-box" hidden>
<p>Sign in with your Hugging Face account to submit a model. Your username is recorded with the
request — your access token is never used and never leaves your browser.</p>
<button class="hf-btn" id="hfLogin">🤗 Sign in with Hugging Face</button>
</div>
<form id="submitForm" hidden>
<div class="field">
<label for="f-model">Model repository</label>
<input id="f-model" placeholder="org/model-name" autocomplete="off" spellcheck="false" required />
<div class="hint" id="f-model-hint">A public model repo on the Hub, loadable with <code>AutoModel</code> (must have a <code>config.json</code>).</div>
</div>
<div class="field" id="sourceField" hidden>
<label for="f-source">Model source</label>
<select id="f-source">
<option value="open">Open-weight — runs on our GPUs</option>
<option value="closed">Closed-source — evaluated via OpenRouter API</option>
</select>
<div class="hint">Closed-source models are billed per token, so this option is limited to the leaderboard maintainer.</div>
</div>
<div class="field" id="visField" hidden>
<label for="f-vis">Leaderboard visibility</label>
<select id="f-vis">
<option value="public">Public — show on the leaderboard</option>
<option value="private">Private — only visible to me</option>
</select>
<div class="hint">Private scores go to a separate private dataset; nobody else can read them, on the board or on the Hub.</div>
</div>
<div class="field" id="maxField" hidden>
<label for="f-max">Items per subtask <span style="font-weight:400;opacity:.7">— blank = every item</span></label>
<input id="f-max" type="number" min="1" max="1000" placeholder="e.g. 5 for a smoke test" autocomplete="off" />
<div class="hint">Caps every subtask. A capped run is for testing — its score is not comparable with the full-corpus board.</div>
</div>
<div class="field" id="subtaskField" hidden>
<label for="f-subtasks">Subtasks <span style="font-weight:400;opacity:.7">— none selected = all 75</span></label>
<select id="f-subtasks" multiple size="9">
<optgroup label="Answerability & Abstention">
<option value="answer_not_in_context_rag">answer_not_in_context_rag (500)</option>
<option value="irrelevant_context_summarization">irrelevant_context_summarization (500)</option>
<option value="missing_context_rag">missing_context_rag (500)</option>
<option value="missing_context_summarization">missing_context_summarization (500)</option>
<option value="none_of_options_mcq">none_of_options_mcq (500)</option>
</optgroup>
<optgroup label="Arabic">
<option value="rare_words_lexicons">rare_words_lexicons (381)</option>
</optgroup>
<optgroup label="Arabic Language Understanding">
<option value="arabic_diacritization">arabic_diacritization (296)</option>
<option value="arabic_figurative">arabic_figurative (306)</option>
<option value="arabic_grammar_correction">arabic_grammar_correction (242)</option>
<option value="arabic_irab">arabic_irab (336)</option>
<option value="arabic_morphology">arabic_morphology (354)</option>
<option value="arabic_semantics">arabic_semantics (316)</option>
<option value="contextual_error">contextual_error (343)</option>
<option value="general_aptitude_tahsili_verbal">general_aptitude_tahsili_verbal (557)</option>
<option value="odd_one_out">odd_one_out (289)</option>
<option value="text_correction_msa_mixed_ar_en">text_correction_msa_mixed_ar_en (1,300)</option>
<option value="verbal_analogy">verbal_analogy (394)</option>
</optgroup>
<optgroup label="Completion">
<option value="completion">completion (365)</option>
</optgroup>
<optgroup label="Generation & Instruction">
<option value="gen_constrained">gen_constrained (273)</option>
<option value="gen_creative_writing">gen_creative_writing (391)</option>
<option value="gen_formal_documents">gen_formal_documents (363)</option>
<option value="gen_rewriting">gen_rewriting (244)</option>
<option value="gen_structured_output">gen_structured_output (344)</option>
<option value="gen_summarization">gen_summarization (1,500)</option>
<option value="gen_translation">gen_translation (360)</option>
</optgroup>
<optgroup label="Information Extraction">
<option value="core_entities_persons_orgs_locations">core_entities_persons_orgs_locations (400)</option>
<option value="instructed_extraction_arbitrary_targets_scoping">instructed_extraction_arbitrary_targets_scoping (800)</option>
<option value="temporal_numeric_expressions">temporal_numeric_expressions (300)</option>
</optgroup>
<optgroup label="Islam">
<option value="arabic_islamic_studies">arabic_islamic_studies (425)</option>
<option value="creed">creed (367)</option>
<option value="fiqh_sciences_maxims">fiqh_sciences_maxims (1,123)</option>
<option value="hadith_commentaries">hadith_commentaries (825)</option>
<option value="hadith_defects_questions">hadith_defects_questions (304)</option>
<option value="hadith_sciences">hadith_sciences (769)</option>
<option value="hanafi_fiqh">hanafi_fiqh (928)</option>
<option value="history">history (314)</option>
<option value="logic">logic (22)</option>
<option value="sects_refutations">sects_refutations (339)</option>
<option value="shariah_politics_judiciary">shariah_politics_judiciary (898)</option>
<option value="takhrij_atraf">takhrij_atraf (625)</option>
<option value="usul_al_fiqh">usul_al_fiqh (899)</option>
</optgroup>
<optgroup label="Knowledge & STEM">
<option value="biology">biology (286)</option>
<option value="chemistry">chemistry (249)</option>
<option value="knowledge_humanities">knowledge_humanities (370)</option>
<option value="knowledge_islamic">knowledge_islamic (232)</option>
<option value="knowledge_qa_rag">knowledge_qa_rag (268)</option>
<option value="knowledge_qa_short">knowledge_qa_short (228)</option>
<option value="knowledge_social_sciences">knowledge_social_sciences (297)</option>
<option value="knowledge_stem">knowledge_stem (438)</option>
<option value="mathematics">mathematics (166)</option>
<option value="medicine_bio">medicine_bio (415)</option>
<option value="physics">physics (226)</option>
</optgroup>
<optgroup label="Multi-Turn Dialogue">
<option value="dialogue_debate">dialogue_debate (380)</option>
<option value="dialogue_info_seeking">dialogue_info_seeking (456)</option>
<option value="dialogue_instruction_revision">dialogue_instruction_revision (440)</option>
<option value="dialogue_task_oriented">dialogue_task_oriented (403)</option>
</optgroup>
<optgroup label="Reasoning & Logic">
<option value="reasoning_causal">reasoning_causal (360)</option>
<option value="reasoning_commonsense">reasoning_commonsense (500)</option>
<option value="reasoning_logical">reasoning_logical (573)</option>
<option value="reasoning_math">reasoning_math (693)</option>
<option value="reasoning_reading_comprehension">reasoning_reading_comprehension (550)</option>
<option value="reasoning_word_problems">reasoning_word_problems (485)</option>
</optgroup>
<optgroup label="Safety, Trust & Bias">
<option value="safety_bias_detection">safety_bias_detection (582)</option>
<option value="safety_hallucination">safety_hallucination (438)</option>
<option value="safety_refusal">safety_refusal (558)</option>
<option value="safety_toxicity">safety_toxicity (456)</option>
</optgroup>
<optgroup label="Sentiment & Meaning">
<option value="sentiment_analysis">sentiment_analysis (827)</option>
<option value="sentiment_emotion">sentiment_emotion (667)</option>
<option value="sentiment_implicature">sentiment_implicature (541)</option>
<option value="sentiment_sarcasm">sentiment_sarcasm (514)</option>
</optgroup>
<optgroup label="Translation">
<option value="expository_analytical_english_arabic">expository_analytical_english_arabic (450)</option>
<option value="expository_literary_msa_arabic_english">expository_literary_msa_arabic_english (450)</option>
<option value="specialized_technical_arabic_english">specialized_technical_arabic_english (350)</option>
<option value="specialized_technical_english_arabic">specialized_technical_english_arabic (350)</option>
<option value="translation_fidelity_mcq_both_directions">translation_fidelity_mcq_both_directions (400)</option>
</optgroup>
</select>
<div class="hint">Ctrl/⌘-click to pick several. Restricting subtasks produces a partial score, so use it for testing only.</div>
</div>
<div class="row2">
<div class="field">
<label for="f-type">Model type</label>
<select id="f-type">
<option value="fine-tuned">🔶 Fine-tuned</option>
<option value="instruction-tuned">⭕ Instruction-tuned</option>
<option value="pretrained">🟢 Pretrained</option>
<option value="RL-tuned">🟦 RL-tuned</option>
</select>
</div>
<div class="field">
<label for="f-prec">Precision</label>
<select id="f-prec">
<option value="bfloat16">bfloat16</option>
<option value="float16">float16</option>
</select>
</div>
</div>
<div class="row2">
<div class="field">
<label for="f-rev">Revision</label>
<input id="f-rev" value="main" autocomplete="off" spellcheck="false" />
</div>
<div class="field">
<label for="f-weight">Weights</label>
<select id="f-weight">
<option value="Original">Original</option>
<option value="Adapter">Adapter (LoRA)</option>
<option value="Delta">Delta</option>
</select>
</div>
</div>
<div class="msg" id="submitMsg"></div>
<div class="modal-actions">
<span class="who" id="whoamiModal" style="margin-right:auto"></span>
<button type="button" class="btn btn-ghost" id="cancelSubmit">Cancel</button>
<button type="submit" class="btn btn-primary" id="doSubmit">Submit for evaluation</button>
</div>
</form>
</div>
</div>
<dialog id="subtaskDialog" class="subtask-dialog" aria-labelledby="subtaskTitle" aria-describedby="subtaskSummary">
<header class="subtask-dialog-header"><div><h2 id="subtaskTitle">Subtask results</h2><p id="subtaskSummary"></p></div>
<button type="button" id="closeSubtasks" class="subtask-close" autofocus>Close</button></header>
<div id="subtaskBody" class="subtask-body"></div>
</dialog>
<dialog id="comparisonDialog" class="subtask-dialog comparison-dialog" aria-labelledby="comparisonTitle" aria-describedby="comparisonVersion">
<header class="subtask-dialog-header"><div><h2 id="comparisonTitle">Compare two models</h2><p id="comparisonVersion"></p></div><button type="button" id="closeComparison" class="subtask-close" autofocus>Close</button></header>
<div class="subtask-body">
<div class="comparison-pickers"><label for="compareA">Model A · baseline<select id="compareA"></select></label><button type="button" id="swapComparison" class="comparison-swap">Swap A/B</button><label for="compareB">Model B · comparison<select id="compareB"></select></label></div>
<p id="comparisonSummary" class="comparison-counts"></p>
<p class="subtask-policy">Difference = Model B − Model A in percentage points (pp). Positive means Model B scores higher. Differences use the saved scores before display rounding, so subtracting the displayed percentages can differ by 0.01 pp. Missing results are not treated as zero.</p>
<div class="comparison-controls"><div class="comparison-modes" aria-label="Comparison level"><button type="button" data-comparison-mode="tasks" aria-pressed="true">Tasks</button><button type="button" data-comparison-mode="subtasks" aria-pressed="false">Subtasks</button></div><label class="comparison-sort" for="comparisonOrder">Order<select id="comparisonOrder"><option value="benchmark">Benchmark order</option><option value="gain">Biggest B gain</option><option value="loss">Biggest B drop</option></select></label></div>
<p id="comparisonCounts" class="comparison-counts"></p><p id="comparisonWarning" class="comparison-warning" role="status" hidden></p><div id="comparisonBody"></div>
</div>
</dialog>
<script>
const RESULTS="Mushari440/results", REQUESTS="Mushari440/requests";
const TREE=r=>`https://huggingface.co/api/datasets/${r}/tree/main?recursive=1`;
const FILE=(r,p)=>`https://huggingface.co/datasets/${r}/resolve/main/${p.split('/').map(encodeURIComponent).join('/')}`;
// 13 dimensions: [key, short label, item count (weight)].
// Weights are item counts in the v2 corpus (combined_34137, 2026-07-29): they sum
// to 34,137. Translation and Information Extraction arrived with v2. Knowledge &
// STEM absorbs the standalone Medicine (400) + Biology (15) buckets: 3825+400+15=4240.
// Item counts in the combined_34137 corpus (2026-07-29). They sum to 34,137.
const DIMS_34137=[
["reasoning_logic","Reasoning",3310],["generation_instruction","Generation",2685],
["sentiment_emotion_meaning","Sentiment",2549],["safety_trust_bias","Safety",2034],
["arabic_language_understanding","Arabic Lang.",3531],["knowledge_stem","Knowledge",4240],
["multi_turn_dialogue","Multi-Turn",1688],["translation","Translation",2000],
["information_extraction","Extraction",1500],["islam","Islam",9143],
["completion","Completion",366],["contextual","Contextual",383],
["semantic","Semantic",708]
];
// ── Benchmark versions ────────────────────────────────────────────────────────
// Each version is a separate results namespace in the dataset repo:
// <version>/<org>/results_<model>.json
// `legacy:true` also admits the un-prefixed files at the repo root, which is where
// every result lived before versioning; a model found in both is taken from the
// prefixed copy. Weights are the corpus item counts for THAT version — v8 runs on
// the revised corpus, so its counts must be updated once that corpus is final.
// Item counts in the revised corpus (benchmarkDataset, 2026-08-19). They sum to
// The live corpus. Recounted from benchmarkDataset on 2026-08-28.
// Derived by running the worker's own bucket_for() over the corpus, not by hand.
// Item counts in the live corpus (benchmarkDataset, recounted 2026-08-28 with the
// same bucket_for() the results builder uses, so these weights match the buckets
// the scores land in). They sum to 32,890. Previously these still held the
// 31,925 figures: generation_instruction was 1,000 items light, so every
// item-weighted Average was computed against a corpus that no longer existed.
const DIMS_V8=[
["reasoning_logic","Reasoning",3161],["generation_instruction","Generation",3475],
["sentiment_emotion_meaning","Sentiment",2549],["safety_trust_bias","Safety",2034],
["arabic_language_understanding","Arabic Lang.",3531],["knowledge_stem","Knowledge",3732],
["multi_turn_dialogue","Multi-Turn",1679],["translation","Translation",2000],
["information_extraction","Extraction",1500],["islam","Islam",7838],
["completion","Completion",365],["contextual","Contextual",343],
["semantic","Semantic",683]
];
const KS_34137=[["knowledge_stem",3825],["medicine",400],["biology",15]];
const KS_V8=[["knowledge_stem",3318],["medicine",400],["biology",14]];
let KS_PARTS=KS_34137;
// v9 runs the same corpus as v8 (main_dataset, 32,890 items) but a different
// judge: judge-prompts-v8.1 replaced v4, and diacritization moved from the prose
// judge to a real DER metric. Scores are therefore NOT comparable across v8/v9,
// which is exactly why it is a separate board rather than a re-score of v8.
const DIMS_V9=DIMS_V8;
const KS_V9=KS_V8;
// v10 freezes the current 32,890-row corpus together with 2,500 deterministic
// answerability/abstention items. The new capability has its own leaderboard
// column and fixed denominator; all earlier dimension weights remain unchanged.
// 2026-09-06: the two missing-context abstention subtasks (missing_context_rag,
// missing_context_summarization, 500 each) render no context block; half the
// items bait the model with a fact it knows, half embed a false premise.
const DIMS_V10=[
["reasoning_logic","Reasoning",3161],["generation_instruction","Generation",3475],
["sentiment_emotion_meaning","Sentiment",2549],["safety_trust_bias","Safety",2034],
["arabic_language_understanding","Arabic Lang.",3531],["knowledge_stem","Knowledge",3732],
["multi_turn_dialogue","Multi-Turn",1679],["translation","Translation",2000],
["information_extraction","Extraction",1500],["answerability_abstention","Answerability",2500],
["islam","Islam",7838],["completion","Completion",365],
["contextual","Contextual",343],["semantic","Semantic",683]
];
const KS_V10=KS_V8;
// v11 scores the TEST split of the v10 corpus (train/dev/test 4/6/90 in every stratum). Since
// 2026-09-15 train/dev are filled first with items google/gemma-4-31B-it answers and at least 5
// of the 8 Mushari440 models miss, and every category and subtask has train and dev items.
// Weights are test-item counts from SPLIT_MANIFEST_v11.json.
const DIMS_V11=[["reasoning_logic","Reasoning",2835],["generation_instruction","Generation",3131],["sentiment_emotion_meaning","Sentiment",2294],["safety_trust_bias","Safety",1830],["arabic_language_understanding","Arabic Lang.",3178],["knowledge_stem","Knowledge",3359],["multi_turn_dialogue","Multi-Turn",1512],["translation","Translation",1800],["information_extraction","Extraction",1350],["answerability_abstention","Answerability",2249],["islam","Islam",7056],["completion","Completion",329],["contextual","Contextual",309],["semantic","Semantic",614]];
const KS_V11=[["knowledge_stem",2986],["medicine",361],["biology",12]];
// v12: the v11 split and the same saved answers, re-judged by gemma-4-31b-it (2026-09-29) because the
// GLM-5.1 judge host is gone. gemma grades ~7 points more generously, so v12 and v11 are separate boards.
// Weights are test-item counts from SPLIT_MANIFEST_v12.json (the split file is byte-identical to v11's).
const DIMS_V12=[["reasoning_logic","Reasoning",2835],["generation_instruction","Generation",3131],["sentiment_emotion_meaning","Sentiment",2294],["safety_trust_bias","Safety",1830],["arabic_language_understanding","Arabic Lang.",3178],["knowledge_stem","Knowledge",3359],["multi_turn_dialogue","Multi-Turn",1512],["translation","Translation",1800],["information_extraction","Extraction",1350],["answerability_abstention","Answerability",2249],["islam","Islam",7056],["completion","Completion",329],["contextual","Contextual",309],["semantic","Semantic",614]];
const KS_V12=[["knowledge_stem",2986],["medicine",361],["biology",12]];
const ARABIC_TASK="arabic_language_understanding";
const V12_ARABIC_MERGES=new Set(["completion","contextual","semantic"]);
const V12_ARABIC_PARTS=DIMS_V12.filter(([key])=>key===ARABIC_TASK||V12_ARABIC_MERGES.has(key));
const DIMS_V12_DISPLAY=DIMS_V12.filter(([key])=>!V12_ARABIC_MERGES.has(key)).map(([key,label,count])=>[
key,label,key===ARABIC_TASK?V12_ARABIC_PARTS.reduce((sum,[,,n])=>sum+n,0):count
]);
const VERSIONS=[
{id:"v7", label:"v7 — corpus 34,137", dims:DIMS_34137, ks:KS_34137, legacy:true, subtasks:70},
{id:"v8", label:"v8 — corpus 32,890", dims:DIMS_V8, ks:KS_V8, subtasks:70},
{id:"v9", label:"v9 — corpus 32,890", dims:DIMS_V9, ks:KS_V9, subtasks:70},
{id:"v10", label:"v10 — corpus 35,390", dims:DIMS_V10, ks:KS_V10, subtasks:75},
{id:"v11", label:"v11 — test split 31,846", dims:DIMS_V11, ks:KS_V11, subtasks:75},
{id:"v12", label:"v12 — test split 31,846", dims:DIMS_V12_DISPLAY, ks:KS_V12, subtasks:75}
];
const DEFAULT_VERSION="v12";
const PUBLIC_VERSION=VERSIONS.find(v=>v.id===DEFAULT_VERSION);
let ownerVersions=null;
let CURRENT=PUBLIC_VERSION;
let DIMS=CURRENT.dims;
let KS=CURRENT.ks;
let WSUM=DIMS.reduce((s,d)=>s+d[2],0);
// Results published BEFORE the merge carry medicine/biology as separate keys; fold them back
// into Knowledge & STEM by item count. Results published after the fix already contain the
// merged value under knowledge_stem alone, so this degrades gracefully to a plain read.
function sourceDimScore(res,key){
if(key!=="knowledge_stem"){
const v=res?.[key]?.acc; return typeof v==="number"?v*100:null;
}
let s=0,w=0;
for(const [k,n] of KS_PARTS){const v=res?.[k]?.acc; if(typeof v==="number"){s+=v*n;w+=n;}}
return w?(s/w)*100:null;
}
function dimScore(res,key){
if(CURRENT.id!=="v12"||key!==ARABIC_TASK)return sourceDimScore(res,key);
let points=0,count=0;
for(const [part,,n] of V12_ARABIC_PARTS){
const score=sourceDimScore(res,part);
if(score===null)return null;
points+=score*n;count+=n;
}
return points/count;
}
const TYPE_ICON={"fine-tuned":"🔶","instruction-tuned":"⭕","pretrained":"🟢","RL-tuned":"🟦"};
function typeKey(t){t=(t||"").toLowerCase();
if(t.includes("fine"))return"fine-tuned";if(t.includes("instruction"))return"instruction-tuned";
if(t.includes("pretrain"))return"pretrained";if(t.includes("rl"))return"RL-tuned";return"other";}
function precKey(p){p=(p||"").toLowerCase();return p.includes("float16")&&!p.includes("b")?"float16":p.includes("bfloat")?"bfloat16":(p||"other");}
const state={models:[],sort:"avg",dir:-1,q:"",types:new Set(),precs:new Set(),pmax:72};
async function getJSON(u){const r=await fetch(u);if(!r.ok)throw new Error(r.status);return r.json();}
async function loadDir(repo,version){
const archived=version&&version.id!==DEFAULT_VERSION;
const tree=await getJSON(archived
? "/api/benchmark-result-files?version="+encodeURIComponent(version.id)
: TREE(repo));
let files=tree.filter(f=>f.type==="file"&&f.path.endsWith(".json"));
if(version){
const pre=version.id+"/";
// A prefixed file is that version's. Un-prefixed files at the repo root predate
// versioning and belong to the legacy version only. Anything under some OTHER
// version's prefix is ignored — the tree is fetched recursively.
files=files.filter(f=>{
if(f.path.startsWith(pre))return true;
if(!version.legacy)return false;
return f.path.split("/").length===2&&!VERSIONS.some(v=>f.path.startsWith(v.id+"/"));
});
// Prefer the prefixed copy while a migration is only half-done, so a model that
// exists at both paths is not counted twice.
files.sort((a,b)=>(b.path.startsWith(pre)?1:0)-(a.path.startsWith(pre)?1:0));
}
const out=await Promise.all(files.map(async f=>{try{return await getJSON(FILE(repo,f.path));}catch(e){return null;}}));
const seen=new Set(),uniq=[];
for(const r of out.filter(Boolean)){
const k=r?.config?.model_name;
if(k&&seen.has(k))continue;
if(k)seen.add(k);
uniq.push(r);
}
return uniq;
}
function itemWeightedAvg(res){
let s=0,w=0;
// Use the archived dimensions in their original order for exact V12 headline scores.
const weights=CURRENT.id==="v12"?DIMS_V12:DIMS;
for(const [k,,wt] of weights){const v=sourceDimScore(res,k);if(v!==null){s+=v*wt;w+=wt;}}
return w?s/w:0;
}
let boardLoadSeq=0;
async function init(){
const seq=++boardLoadSeq;
const version=CURRENT;
const requestedVersion=version.id;
const showPrivate=!!ownerVersions?.size;
document.getElementById("openComparison").disabled=true;
for(const id of ["comparisonDialog","subtaskDialog"]){
const dialog=document.getElementById(id);if(dialog.open)dialog.close();
}
state.models=[];
state.extra={};
document.getElementById("tbody").innerHTML="";
DIMS=CURRENT.dims; KS_PARTS=CURRENT.ks; WSUM=DIMS.reduce((s,d)=>s+d[2],0);
// The corpus size belongs to the version: v7 is 34,137 items and v8 is 32,890.
const ic=document.getElementById("itemCount");
if(ic)ic.textContent=WSUM.toLocaleString("en-US");
// So do the subtask and dimension counts: v10 has 75 subtasks in 14 dimensions,
// and the masthead said "70 subtasks · 13 categories" for every version.
const sc=document.getElementById("subtaskCount");
if(sc&&CURRENT.subtasks)sc.textContent=String(CURRENT.subtasks);
for(const id of ["catCount","dimCount"]){const e=document.getElementById(id);if(e)e.textContent=String(DIMS.length);}
const st=document.getElementById("state");
st.hidden=false; st.innerHTML='<div class="spinner"></div>Loading the leaderboard…';
document.getElementById("board").hidden=true;
document.getElementById("controls").hidden=true;
document.getElementById("note").hidden=true;
let results,requests,privateRows,metrics;
const optional=(promise,fallback)=>promise.catch(()=>fallback);
const versionQuery="?version="+encodeURIComponent(requestedVersion);
try{
[results,requests,privateRows,metrics]=await Promise.all([
loadDir(RESULTS,version),
optional(loadDir(REQUESTS),[]),
showPrivate?optional(getJSON("/api/private-results"+versionQuery),null):null,
showPrivate?optional(getJSON("/api/private-metrics"+versionQuery),null):null
]);
}catch(e){
if(seq===boardLoadSeq)st.textContent="Could not load leaderboard results. Refresh to try again.";
if(showPrivate&&(e.message==="401"||e.message==="403"))refreshMe();
return;
}
if(seq!==boardLoadSeq)return;
if(Array.isArray(privateRows?.results))results=results.concat(privateRows.results);
state.extra=metrics?.models||{};
// the progress card cross-checks against these to see if a run is really live
state.requests=requests;
if(typeof loadProgress==='function')loadProgress();
// index request metadata by model name
const meta={};
for(const q of requests){if(q&&q.model)meta[q.model]={params:q.params,likes:q.likes,type:q.model_type,prec:q.precision,status:q.status};}
const KEYS=DIMS.map(d=>d[0]);
const V2_ONLY=["translation","information_extraction"];
const REQUIRED=KEYS.filter(k=>!V2_ONLY.includes(k));
const models=[];
for(const r of results){
const name=r?.config?.model_name;if(!name)continue;
const res=r.results||{};
// Models scored before the v2 corpus have no translation / information_extraction
// results. Requiring those would drop every pre-v2 row from the board, so they are
// exempt; itemWeightedAvg already renormalises over whichever dimensions exist.
if(!REQUIRED.every(k=>dimScore(res,k)!==null))continue;
const m=meta[name]||{};
models.push({
benchmarkVersion:requestedVersion,
name, org:name.split("/")[0], short:name.split("/").slice(1).join("/")||name,
avg:itemWeightedAvg(res),
scores:Object.fromEntries(DIMS.map(d=>[d[0],dimScore(res,d[0])])),
params:typeof m.params==="number"?m.params:null,
likes:typeof m.likes==="number"?m.likes:null,
type:typeKey(m.type), prec:precKey(m.prec),
dtype:r?.config?.model_dtype,
// Reasoning models run at an explicit effort level (GLM-5.3 cannot disable
// thinking); the row shows it so a score is read against its setting.
effort:r?.config?.reasoning_effort||null,
polA:(state.extra&&state.extra[name])?state.extra[name].overall_accuracy*100:null,
polB:(state.extra&&state.extra[name])?state.extra[name].overall_strict*100:null,
mcqFmt:(state.extra&&state.extra[name])?state.extra[name].mcq_format_ok*100:null,
judged:(state.extra&&state.extra[name])?state.extra[name].judged_at:null,
subtasks:r?.subtask_results||null,
isPrivate:r?._private===true
});
}
state.models=models;
refreshComparisonOptions();
if(!models.length){
st.hidden=false;
st.innerHTML='<div style="text-align:center;padding:26px 12px">'
+'<div style="font-size:15px;font-weight:600;margin-bottom:6px">No model results yet.</div>'
+'<div class="muted" style="font-size:13px">Scores appear as evaluations finish.</div></div>';
document.getElementById("board").hidden=true;
document.getElementById("tbody").innerHTML=""; // drop the previous version's rows
document.getElementById("modelCount").textContent="0";
document.getElementById("updated").textContent="0 models";
renderQueue(requests);
return;
}
// Params slider: default range 0–72B, but never hide a larger model — grow the cap to fit.
const maxP=Math.max(72,Math.ceil(Math.max(0,...models.map(m=>m.params||0))));
const slider=document.getElementById("paramMax");
slider.max=maxP; slider.value=maxP; state.pmax=maxP;
document.getElementById("paramRV").textContent=maxP;
document.getElementById("modelCount").textContent=models.length;
document.getElementById("updated").textContent=`${models.length} models`;
// build filter chips
const types=[...new Set(models.map(m=>m.type))];
const precs=[...new Set(models.map(m=>m.prec))];
state.types=new Set(types); state.precs=new Set(precs);
const tc=document.getElementById("typeChips"), pc=document.getElementById("precChips");
tc.innerHTML=""; pc.innerHTML=""; // init() re-runs on every version switch
types.forEach(t=>tc.appendChild(mkChip(t,(TYPE_ICON[t]?TYPE_ICON[t]+" ":"")+t,()=>toggle(state.types,t))));
precs.forEach(p=>pc.appendChild(mkChip(p,p,()=>toggle(state.precs,p))));
document.getElementById("controls").hidden=false;
document.getElementById("state").hidden=true;
document.getElementById("board").hidden=false;
document.getElementById("note").hidden=false;
renderQueue(requests);
render();
}
function mkChip(val,label,onclick){const b=document.createElement("button");b.className="chip";b.textContent=label;
b.setAttribute("aria-pressed","true");b.onclick=()=>{b.setAttribute("aria-pressed",b.getAttribute("aria-pressed")==="true"?"false":"true");onclick();render();};return b;}
function toggle(set,v){set.has(v)?set.delete(v):set.add(v);}
function heat(v){ // 0..100 -> subtle emerald tint + readable text
const t=Math.max(0,Math.min(1,v/100));
return `background:rgba(var(--cell-heat),${(0.05+t*0.30).toFixed(3)})`;
}
// Built from the CURRENT version's dimensions on every render. This used to be a
// const captured once at load from the default (v7) DIMS: v8/v9 share v7's 13
// keys in the same order so nothing showed, but v10 inserts Answerability before
// Islam — the row had 14 cells under 13 headers, every column from Islam onward
// sat under the wrong label, and clicking "Islam" sorted by Answerability.
function baseHeads(){
return [["rank","#"],["model","Model"],["avg","Average"],...DIMS.map(d=>[d[0],d[1]])];
}
// Owner-only columns. `state.extra` is populated only when /api/private-metrics
// answered, which it does only for the leaderboard owner — so a public viewer
// sees exactly the columns they saw before.
const OWNER_HEADS=[["polA","A: Acc"],["polB","B: Strict"],["mcqFmt","MCQ Fmt"],["judged","Judged"]];
function heads(){
const base=baseHeads();
const hasExtra=state.extra&&Object.keys(state.extra).length;
return hasExtra?base.concat(OWNER_HEADS):base;
}
function extraCells(m){
if(!(state.extra&&Object.keys(state.extra).length))return "";
const pct=v=>v==null?'<span class="score na">n/a</span>':`<span class="score" style="${heat(v)}">${v.toFixed(2)}%</span>`;
const drop=(m.polA!=null&&m.polB!=null)?(m.polA-m.polB):null;
const bTitle=drop!=null?` title="${drop.toFixed(2)} points lost to instruction-following"`:"";
const ts=m.judged?String(m.judged).replace("T"," ").slice(0,16):"—";
return `<td>${pct(m.polA)}</td><td${bTitle}>${pct(m.polB)}</td>`
+ `<td>${pct(m.mcqFmt)}</td>`
+ `<td><span class="score na" style="font-size:11px;white-space:nowrap">${ts}</span></td>`;
}
function comparisonDelta(a,b){
if(a===null||b===null)return null;
const value=Number((b-a).toFixed(2));
return Object.is(value,-0)?0:value;
}
function subtaskBreakdown(data,version){
if(!data||data.version!==version||!Array.isArray(data.rows))return null;
if(version!=="v12")return data;
return {...data,rows:data.rows.map(row=>V12_ARABIC_MERGES.has(row?.task_id)
?{...row,task_id:ARABIC_TASK,task_label:"Arabic language understanding"}
:row)};
}
function compareModels(a,b,mode,version,dims){
const empty=notice=>({rows:[],notice});
if(!a||!b)return empty('Choose two models to compare.');
if(a.name===b.name)return empty('Choose two different models.');
if((a.benchmarkVersion&&a.benchmarkVersion!==version)||(b.benchmarkVersion&&b.benchmarkVersion!==version))return empty('Choose models from the current benchmark version.');
const validScore=v=>typeof v==='number'&&Number.isFinite(v)?v:null;
const detail=m=>subtaskBreakdown(m.subtasks,version);
const da=detail(a),db=detail(b);
if(da&&db&&((da.split&&db.split&&da.split!==db.split)||(da.split_sha256&&db.split_sha256&&da.split_sha256!==db.split_sha256)))return empty('These breakdowns use different evaluation splits; differences are unavailable.');
const delta=comparisonDelta;
if(mode==='tasks'){
const stats=(data,key,n)=>{
const rs=data?data.rows.filter(r=>r.task_id===key):[];
return {count:rs.length?rs.reduce((s,r)=>s+r.count,0):n,unresolved:rs.length?rs.reduce((s,r)=>s+r.unresolved_count,0):null};
};
let mismatch=false;
const rows=dims.map(([id,label,n])=>{
const x=validScore(a.scores[id]),y=validScore(b.scores[id]);const sa=stats(da,id,n),sb=stats(db,id,n);const same=sa.count===sb.count;mismatch||=!same;
return {id,label,taskLabel:'',a:x,b:y,delta:same?delta(x,y):null,countA:sa.count,countB:sb.count,unresolvedA:sa.unresolved,unresolvedB:sb.unresolved};
});
return {rows,notice:mismatch?'Some item counts differ; those differences are unavailable.':''};
}
const ma=new Map((da?.rows||[]).map(r=>[r.task_id+'|'+r.subtask_id,r]));
const mb=new Map((db?.rows||[]).map(r=>[r.task_id+'|'+r.subtask_id,r]));
if(!ma.size&&!mb.size)return empty('Subtask breakdowns are unavailable for both models on this version.');
const order=new Map(dims.map((d,i)=>[d[0],i]));
const ids=[...new Set([...ma.keys(),...mb.keys()])].sort((x,y)=>(order.get(x.split('|')[0])??999)-(order.get(y.split('|')[0])??999));
let mismatch=false;
const rows=ids.map(id=>{
const x=ma.get(id),y=mb.get(id),label=x||y;const av=validScore(x?.score),bv=validScore(y?.score);const sa=av===null?null:av*100,sb=bv===null?null:bv*100;const same=!x||!y||x.count===y.count;mismatch||=!same;
return {id,label:label.label||label.subtask_id,taskLabel:label.task_label||label.task_id,a:sa,b:sb,delta:same?delta(sa,sb):null,countA:x?.count??null,countB:y?.count??null,unresolvedA:x?.unresolved_count??null,unresolvedB:y?.unresolved_count??null};
});
const notices=[];
if(!ma.size)notices.push('Subtask breakdown is unavailable for Model A.');
if(!mb.size)notices.push('Subtask breakdown is unavailable for Model B.');
if(mismatch)notices.push('Some item counts differ; those differences are unavailable.');
return {rows,notice:notices.join(' ')};
}
function comparisonTableHTML(result,order){
if(!result.rows.length)return '<p class="subtask-empty">'+esc(result.notice||'No comparable results are available.')+'</p>';
const rows=[...result.rows];
if(order==='gain'||order==='loss')rows.sort((a,b)=>a.delta===null?(b.delta===null?0:1):b.delta===null?-1:(order==='gain'?b.delta-a.delta:a.delta-b.delta));
const score=(v,n,u)=>v===null?'<span class="comparison-na">Unavailable</span>':v.toFixed(2)+'%'+(Number.isInteger(n)?'<small>'+n.toLocaleString('en-US')+' items'+(Number.isInteger(u)?' · '+u+' unresolved':'')+'</small>':'');
const diff=v=>v===null?'<span class="comparison-na">—</span>':'<span class="comparison-delta '+(v>0?'positive':v<0?'negative':'tied')+'">'+(v>0?'+':'')+(Object.is(v,-0)?0:v).toFixed(2)+'</span>';
return '<div class="subtask-table-scroll"><table class="subtask-table comparison-table"><thead><tr><th scope="col">Task / subtask</th><th scope="col">Model A</th><th scope="col">Model B</th><th scope="col">B − A (pp)</th></tr></thead><tbody>'
+rows.map(r=>'<tr class="comparison-result"><td>'+esc(r.label)+(r.taskLabel?'<small>'+esc(r.taskLabel)+'</small>':'')+'</td><td>'+score(r.a,r.countA,r.unresolvedA)+'</td><td>'+score(r.b,r.countB,r.unresolvedB)+'</td><td>'+diff(r.delta)+'</td></tr>').join('')+'</tbody></table></div>';
}
let comparisonMode='tasks';
function refreshComparisonOptions(){
const models=[...state.models].sort((a,b)=>b.avg-a.avg||a.name.localeCompare(b.name));
const sa=document.getElementById('compareA'),sb=document.getElementById('compareB');const oldA=sa.value,oldB=sb.value;
for(const select of [sa,sb]){
select.innerHTML='';
for(const model of models){const option=document.createElement('option');option.value=model.name;option.textContent=model.name;select.appendChild(option);}
}
sa.value=models.some(m=>m.name===oldA)?oldA:(models[0]?.name||'');
sb.value=models.some(m=>m.name===oldB&&m.name!==sa.value)?oldB:(models.find(m=>m.name!==sa.value)?.name||'');
document.getElementById('openComparison').disabled=models.length<2;
}
function renderComparison(){
const a=state.models.find(m=>m.name===document.getElementById('compareA').value),b=state.models.find(m=>m.name===document.getElementById('compareB').value);
const result=compareModels(a,b,comparisonMode,CURRENT.id,DIMS);
const overallDelta=a&&b?comparisonDelta(a.avg,b.avg):0;
document.getElementById('comparisonSummary').textContent=a&&b&&result.rows.length?'Overall: A '+a.avg.toFixed(2)+'% · B '+b.avg.toFixed(2)+'% · B − A '+(overallDelta>0?'+':'')+(Object.is(overallDelta,-0)?0:overallDelta).toFixed(2)+' pp':'Overall comparison unavailable for this selection.';
document.getElementById('comparisonVersion').textContent=ownerVersions?.size?CURRENT.label:"Current public benchmark";
const warning=document.getElementById('comparisonWarning');warning.textContent=result.notice;warning.hidden=!result.notice;
document.getElementById('comparisonBody').innerHTML=comparisonTableHTML(result,document.getElementById('comparisonOrder').value);
const comparable=result.rows.filter(r=>r.delta!==null);
document.getElementById('comparisonCounts').textContent=result.rows.length?`${comparable.filter(r=>r.delta>0).length} B higher · ${comparable.filter(r=>r.delta<0).length} A higher · ${comparable.filter(r=>r.delta===0).length} tied · ${result.rows.length-comparable.length} unavailable`:'';
for(const button of document.querySelectorAll('[data-comparison-mode]'))button.setAttribute('aria-pressed',String(button.dataset.comparisonMode===comparisonMode));
}
function openComparison(){
refreshComparisonOptions();renderComparison();
const dialog=document.getElementById('comparisonDialog');if(!dialog.open)dialog.showModal();dialog.scrollTop=0;
}
function subtaskDetailsHTML(block,version){
const data=subtaskBreakdown(block,version);
const unavailable='<p class="subtask-empty">Subtask results are not available for this evaluation yet.</p>';
if(!data?.rows.length)return unavailable;
const groups=new Map();
for(const row of data.rows){
if(!row||!Number.isInteger(row.count)||row.count<1)continue;
if(!groups.has(row.task_id))groups.set(row.task_id,{label:row.task_label||row.task_id,rows:[]});
groups.get(row.task_id).rows.push(row);
}
if(!groups.size)return unavailable;
const pct=v=>typeof v==='number'&&Number.isFinite(v)?(v*100).toFixed(2)+'%':'—';
const count=v=>Number.isInteger(v)&&v>=0?v.toLocaleString('en-US'):'—';
let body='<p class="subtask-policy">'+esc(data.version)+' · '+esc(data.split||'')+' split · '+data.rows.length+' subtasks · '+count(data.expected_count)+' items.';
if(data.primary_score_policy==='failures_as_zero')body+=' Unresolved judgments count as zero.';
body+='</p>';
for(const group of groups.values()){
const n=group.rows.reduce((s,r)=>s+r.count,0);
const score=group.rows.every(r=>typeof r.score==='number'&&Number.isFinite(r.score))?group.rows.reduce((s,r)=>s+r.score*r.count,0)/n:null;
body+='<section class="subtask-group"><h3>'+esc(group.label)+'<span>'+pct(score)+' · '+count(n)+' items</span></h3>'
+'<div class="subtask-table-scroll"><table class="subtask-table"><thead><tr><th scope="col">Subtask</th><th scope="col">Score</th><th scope="col">Items</th><th scope="col">Unresolved</th><th scope="col">Errors</th></tr></thead><tbody>';
for(const r of group.rows)body+='<tr class="subtask-result"><td>'+esc(r.label||r.subtask_id)+'</td><td class="subtask-score">'+pct(r.score)+'</td><td>'+count(r.count)+'</td><td>'+count(r.unresolved_count)+'</td><td>'+count(r.error_count)+'</td></tr>';
body+='</tbody></table></div></section>';
}
return body;
}
function openSubtasks(model){
const dialog=document.getElementById('subtaskDialog');
document.getElementById('subtaskTitle').textContent=model.name;
document.getElementById('subtaskSummary').textContent='Subtask results · Overall '+model.avg.toFixed(2)+'%';
document.getElementById('subtaskBody').innerHTML=subtaskDetailsHTML(model.subtasks,CURRENT.id);
if(!dialog.open)dialog.showModal();
dialog.scrollTop=0;
}
function bindSubtaskRows(table,models){
table.onclick=event=>{
if(event.target.closest('a'))return;
const row=event.target.closest('tr[data-detail-index]');if(!row)return;
const model=models[Number(row.dataset.detailIndex)];if(!model)return;
const trigger=row.querySelector('button.name');if(trigger)trigger.focus();
openSubtasks(model);
};
table.onkeydown=event=>{
if(event.target.matches('tr[data-detail-index]')&&(event.key==='Enter'||event.key===' ')){
event.preventDefault();openSubtasks(models[Number(event.target.dataset.detailIndex)]);
}
};
}
function render(){
let rows=state.models.filter(m=>
(!state.q||m.name.toLowerCase().includes(state.q))&&
state.types.has(m.type)&&state.precs.has(m.prec)&&
(m.params==null||m.params<=state.pmax));
const k=state.sort,dir=state.dir;
rows.sort((a,b)=>{
let va,vb;
if(k==="model"){va=a.name.toLowerCase();vb=b.name.toLowerCase();return va<vb?-dir:va>vb?dir:0;}
if(k==="avg"){va=a.avg;vb=b.avg;}
else if(k==="rank"){va=a.avg;vb=b.avg;dir*1;}
else if(k==="judged"){va=a.judged||"";vb=b.judged||"";return va<vb?-dir:va>vb?dir:0;}
else if(k==="polA"||k==="polB"||k==="mcqFmt"){va=a[k];vb=b[k];}
else {va=a.scores[k];vb=b.scores[k];}
// Unscored cells sort last in both directions — (null-60) is NaN, which makes the
// comparator inconsistent and scrambles the order of every other row.
if(va==null&&vb==null)return 0;
if(va==null)return 1;
if(vb==null)return -1;
return (va-vb)*dir;
});
const thead=document.getElementById("thead");
const HEADS=heads();
thead.innerHTML="<tr>"+HEADS.map(([key,label])=>{
const active=(state.sort===key)||(key==="rank"&&state.sort==="avg");
const arrow=active?`<span class="arrow">${state.dir<0?"▼":"▲"}</span>`:"";
const cls=(key!=="rank"&&key!=="model"&&key!=="avg")?' class="sub"':"";
const sort=active&&key!=="rank"?` aria-sort="${state.dir<0?"descending":"ascending"}"`:"";
return `<th scope="col" data-k="${key}"${cls}${sort}><button type="button" class="sort-heading">${label}${arrow}</button></th>`;}).join("")+"</tr>";
thead.querySelectorAll("th").forEach(th=>th.onclick=()=>{
const key=th.dataset.k;
if(state.sort===key||(key==="rank"&&state.sort==="avg")){state.dir*=-1;}
else{state.sort=key==="rank"?"avg":key;state.dir=(key==="model")?1:-1;}
render();
});
const tb=document.getElementById("tbody");
// Best score in each task column across the shown models — highlight the leader(s).
const best={};
if(rows.length>1){for(const d of DIMS){const vs=rows.map(m=>m.scores[d[0]]).filter(v=>v!=null);
best[d[0]]=vs.length?Math.max(...vs):null;}}
tb.innerHTML=rows.map((m,i)=>{
const rank=i+1;
const rk=rank<=3?`<span class="rank top r${rank}">${rank}</span>`:`<span class="rank">${rank}</span>`;
const cats=DIMS.map(d=>{const v=m.scores[d[0]];
// Not every model has every dimension: anything scored before the v2 corpus has
// no translation / information_extraction result. Show "n/a" rather than a made-up
// number — and never call .toFixed on it, which is what emptied the whole board.
if(v==null)return `<td><span class="score na" title="Not evaluated on this task (scored before the v2 corpus)">n/a</span></td>`;
const isBest=(best[d[0]]!=null)&&(best[d[0]]>0)&&(best[d[0]]-v<0.05);
return `<td><span class="score${isBest?' best':''}" style="${heat(v)}"${isBest?' title="Best in this task"':''}>${v.toFixed(1)}</span></td>`;}).join("");
return `<tr data-detail-index="${i}" tabindex="0" aria-haspopup="dialog" aria-label="View subtask results for ${esc(m.name)}">
<td>${rk}</td>
<td><div class="model-cell">
<button type="button" class="name" aria-haspopup="dialog" title="View subtask results for ${esc(m.name)}"><span class="type-ico">${TYPE_ICON[m.type]||"·"}</span>${esc(m.short)}</button>${m.isPrivate?'<span class="badge b-private" title="Private — only you can see this row">PRIVATE</span>':""}
<span class="org">${m.org}${m.params!=null?` · ${m.params.toFixed(1)}B`:""}${m.prec?` · ${m.prec}`:""}${m.effort?` · <b class="effort" title="reasoning effort used for this run">effort: ${m.effort}</b>`:""}${m.likes?` · ♥ ${m.likes}`:""}<a class="model-hub" href="https://huggingface.co/${esc(m.name)}" target="_blank" rel="noopener" title="Open model on Hugging Face">Hub ↗</a></span>
</div></td>
<td class="avg-cell"><span class="avg-num">${m.avg.toFixed(2)}%</span><div class="avg-bar"><i style="width:${Math.min(100,m.avg)}%"></i></div></td>
${cats}${extraCells(m)}</tr>`;
}).join("")||`<tr><td colspan="${HEADS.length}" class="state" style="padding:40px">No models match the filters.</td></tr>`;
bindSubtaskRows(tb,rows);
}
function renderQueue(requests){
const q=document.getElementById("queue");
const active=requests.filter(r=>r&&["PENDING","RUNNING","RERUN","FAILED","REJECTED"].includes((r.status||"").toUpperCase()));
if(!active.length){
const c0=document.getElementById("queueCount"); if(c0)c0.textContent="";
q.innerHTML='<div class="qrow" style="color:var(--ink-mute)">No pending or running evaluations.</div>';return;}
const order={RUNNING:0,QUEUED:1,PENDING:1,RERUN:1,FAILED:2,REJECTED:3};
// Within a status group, order by submitted_time — that is precisely how the
// worker chooses its next job (auto_hf_queue.list_requests sorts oldest-first
// and next_todo takes todo[0]), so the panel reads as the real run order.
// Without this tiebreak every PENDING row ties and the list falls back to
// repo file order, which is alphabetical and tells you nothing.
active.sort((a,b)=>(order[a.status?.toUpperCase()]??3)-(order[b.status?.toUpperCase()]??3)
||String(a.submitted_time||"").localeCompare(String(b.submitted_time||"")));
const cnt=document.getElementById("queueCount");
if(cnt)cnt.textContent=`${active.length} in queue`;
// No cap: truncating here once hid 5 of 17 queued models and read as "they
// were never queued". A long list is better than a silently short one.
q.innerHTML=active.map((r,i)=>{
let s=(r.status||"").toUpperCase();
// The worker marks every model it has claimed as RUNNING, but it works
// through them one at a time. Only the model the progress feed names is
// really running; the rest are waiting their turn, so say so.
if(s==="RUNNING"&&state.activeModel){
const m=r.model||"";
const isActive=(m===state.activeModel)||m.endsWith("/"+state.activeModel);
if(!isActive)s="QUEUED";
}
const cls=s==="RUNNING"?"b-running":(s==="FAILED"||s==="REJECTED")?"b-failed":"b-pending";
const tip=s==="REJECTED"?' title="Closed-source models may only be submitted by the leaderboard maintainer."':"";
return `<div class="qrow"><span class="qnum">${i+1}</span><a href="https://huggingface.co/${r.model}" target="_blank" rel="noopener" title="${r.model}">${r.model}</a><span class="badge ${cls}"${tip}>${s}</span></div>`;
}).join("");
}
// controls
document.getElementById("search").addEventListener("input",e=>{state.q=e.target.value.trim().toLowerCase();render();});
const pm=document.getElementById("paramMax");
pm.addEventListener("input",e=>{state.pmax=+e.target.value;document.getElementById("paramRV").textContent=e.target.value;render();});
// theme toggle (persist)
const root=document.documentElement, tbtn=document.getElementById("themeBtn");
const saved=localStorage.getItem("all-theme"); if(saved)root.setAttribute("data-theme",saved);
else if(window.matchMedia&&window.matchMedia("(prefers-color-scheme: light)").matches)root.setAttribute("data-theme","light");
tbtn.onclick=()=>{const n=root.getAttribute("data-theme")==="dark"?"light":"dark";root.setAttribute("data-theme",n);localStorage.setItem("all-theme",n);};
// ---------------- submission + Hugging Face sign-in ----------------
const modal=document.getElementById('submitModal');
const signinView=document.getElementById('signinView');
const submitForm=document.getElementById('submitForm');
const submitMsg=document.getElementById('submitMsg');
const esc=s=>String(s).replace(/[&<>"']/g,c=>({'&':'&','<':'<','>':'>','"':'"',"'":'''}[c]));
function setUser(u,isOwner){
const who=document.getElementById('whoami');
const whoM=document.getElementById('whoamiModal');
if(u){
who.innerHTML=`Signed in as <b>@${esc(u)}</b> · <a href="/logout">sign out</a>`;
whoM.innerHTML=`Signed in as <b>@${esc(u)}</b>`;
signinView.hidden=true; submitForm.hidden=false;
// Owner-only: reveal the closed-source option. Cosmetic — /api/submit enforces it.
const sf=document.getElementById('sourceField');
if(sf){sf.hidden=!isOwner; if(!isOwner)document.getElementById('f-source').value='open';}
for(const id of ['visField','maxField','subtaskField']){
const el=document.getElementById(id); if(el)el.hidden=!isOwner;
}
if(!isOwner){
const vs=document.getElementById('f-vis'); if(vs)vs.value='public';
const mx=document.getElementById('f-max'); if(mx)mx.value='';
const st=document.getElementById('f-subtasks');
if(st)[...st.options].forEach(o=>o.selected=false);
}
}else{
who.textContent=''; whoM.textContent='';
for(const id of ['sourceField','visField','maxField','subtaskField']){
const el0=document.getElementById(id); if(el0)el0.hidden=true;
}
const mp=document.getElementById('managePanel'); if(mp)mp.hidden=true;
signinView.hidden=false; submitForm.hidden=true;
}
}
let sessionSeq=0;
async function refreshMe(){
const seq=++sessionSeq;
let data={};
try{
const response=await fetch("/api/me",{credentials:"same-origin",cache:"no-store"});
if(response.ok)data=await response.json();
}catch(e){/* Default to public access if the session cannot be checked. */}
if(seq!==sessionSeq)return;
setUser(data.user||null,!!data.is_owner);
syncVersionPicker(data.is_owner&&Array.isArray(data.benchmark_versions)?data.benchmark_versions:[]);
}
function smsg(t,kind){submitMsg.className='msg'+(t?(' show '+kind):'');submitMsg.textContent=t||'';}
function openModal(){modal.classList.add('open');modal.setAttribute('aria-hidden','false');smsg('');refreshMe();}
function closeModal(){modal.classList.remove('open');modal.setAttribute('aria-hidden','true');smsg('');}
document.getElementById('openSubmit').onclick=openModal;
document.getElementById('closeSubmit').onclick=closeModal;
document.getElementById('cancelSubmit').onclick=closeModal;
modal.addEventListener('click',e=>{if(e.target===modal)closeModal();});
document.addEventListener('keydown',e=>{if(e.key==='Escape'&&modal.classList.contains('open'))closeModal();});
document.getElementById('hfLogin').onclick=()=>{
// If embedded in an iframe (huggingface.co Space page), open sign-in in a new tab so
// the HF authorize page loads top-level and cookies work; otherwise redirect in place.
if(window.top!==window.self){window.open('/login','_blank','noopener');}
else{window.location.href='/login';}
};
// pick up a sign-in that completed in another tab / after returning
function refreshActiveSession(){
if(ownerVersions?.size||modal.classList.contains("open"))refreshMe();
}
window.addEventListener("focus",refreshActiveSession);
document.addEventListener("visibilitychange",()=>{if(!document.hidden)refreshActiveSession();});
submitForm.addEventListener('submit',async e=>{
e.preventDefault();
const btn=document.getElementById('doSubmit');
const payload={
model:document.getElementById('f-model').value.trim(),
model_type:document.getElementById('f-type').value,
precision:document.getElementById('f-prec').value,
revision:(document.getElementById('f-rev').value.trim()||'main'),
weight_type:document.getElementById('f-weight').value,
source:(document.getElementById('f-source')||{value:'open'}).value,
};
// Owner-only extras: omitted entirely when blank/unselected, so a normal
// submission sends exactly what it sent before this feature existed.
const vsEl=document.getElementById('f-vis');
if(vsEl&&vsEl.value==='private')payload.visibility='private';
const mxEl=document.getElementById('f-max');
if(mxEl&&mxEl.value.trim()!=='')payload.max_examples=parseInt(mxEl.value,10);
const stEl=document.getElementById('f-subtasks');
if(stEl){
const picked=[...stEl.selectedOptions].map(o=>o.value);
if(picked.length)payload.subtasks=picked;
}
if(!/^[\w.-]+\/[\w.-]+$/.test(payload.model)){smsg('Enter a model id like org/name.','err');return;}
btn.disabled=true;btn.textContent='Submitting…';smsg('');
try{
const r=await fetch('/api/submit',{method:'POST',credentials:'same-origin',
headers:{'Content-Type':'application/json'},body:JSON.stringify(payload)});
const d=await r.json().catch(()=>({}));
if(r.ok){
smsg(d.message||'Submitted!','ok');
document.getElementById('f-model').value='';
setTimeout(()=>{closeModal();location.reload();},2000);
}else if(r.status===401){smsg('Please sign in with Hugging Face first.','err');refreshMe();}
else{smsg(d.detail||d.message||('Error '+r.status),'err');}
}catch(err){smsg('Network error — please try again.','err');}
finally{btn.disabled=false;btn.textContent='Submit for evaluation';}
});
// ---------------- Live progress ----------------
// Published by the worker to a small dataset (one commit only when the numbers
// change), so the board can show how far the running evaluation has got.
const PROGRESS_URL="https://huggingface.co/datasets/Mushari440/progress/raw/main/progress.json";
// Remembers when the run last made progress, so a frozen run can be called
// stalled. It must track BOTH counters: during the judge phase `inferred` is
// frozen by design (inference finished), and watching it alone reported a
// healthy judging run as "no new answers for 15 min — STALLED".
let _prog={model:null,inferred:-1,scored:-1,since:0};
async function loadProgress(){
const el=document.getElementById('progress');
try{
const r=await fetch(PROGRESS_URL+"?t="+Date.now(),{cache:"no-store"});
if(!r.ok){el.hidden=true;return;}
const p=await r.json();
// Which model the worker is actually on. The worker claims every queued model
// as RUNNING up front but works through them one at a time, so without this
// the queue showed three simultaneous RUNNING rows. Recorded before the
// liveness gates below: even a stale feed names the one job that was active,
// which beats implying all of them are.
if(p&&p.model){
const wasActive=state.activeModel;
state.activeModel=p.model;
if(wasActive!==state.activeModel&&state.requests)renderQueue(state.requests);
}
if(!p||!p.model||p.idle){el.hidden=true;return;} // nothing running
// Freshness of the FILE is not liveness of the RUN. The worker republishes every
// 60s regardless, so a killed run stayed "fresh" forever: a stopped ox-alpha sat
// here reading "INFERENCE 16,177 / 31,925" while the queue underneath correctly
// showed FAILED. Three checks now, in order of authority.
const age=(Date.now()-Date.parse(p.updated_at||0))/1000;
if(!isFinite(age)||age>900){el.hidden=true;return;}
// 1. The worker says so outright (published once the fix is running).
if(p.live===false){el.hidden=true;return;}
// 2. The queue is the authority on whether this model is being worked on.
// progress carries the run NAME ("ox-alpha"); the queue carries the model id
// ("stealth/ox-alpha"), so match on either.
const ACTIVE_ST=new Set(['RUNNING','PENDING','RERUN']);
// The queue has not loaded yet on the first pass -- loadProgress runs before
// init() finishes. Painting now would show an unverified card for up to a full
// poll interval, which is exactly how the dead ox-alpha run stayed on screen.
// init() calls this again the moment the queue is in.
if(!state.requests){el.hidden=true;return;}
const q=(state.requests||[]).find(r=>{
const m=r&&r.model; if(!m)return false;
return m===p.model||m.endsWith('/'+p.model);
});
if(q&&!ACTIVE_ST.has(String(q.status||'').toUpperCase())){el.hidden=true;return;}
// 3. Nothing has been answered for a while -> say stalled rather than "INFERENCE".
// ox-alpha sat rate-limited at 429 for hours still captioned as running.
const now=Date.now();
if(_prog.model!==p.model||_prog.inferred!==p.inferred||_prog.scored!==p.scored){
_prog={model:p.model,inferred:p.inferred,scored:p.scored,since:now};
}
const stalledFor=(now-_prog.since)/1000;
const stalled=stalledFor>600;
const stalledWhat=String(p.phase||"").toUpperCase().includes("JUDGE")?"judgements":"answers";
const pct=p.total?Math.min(100,100*p.inferred/p.total):0;
const spct=p.total?Math.min(100,100*p.scored/p.total):0;
el.hidden=false;
el.innerHTML=`<div class="prog">
<div class="ptop">
<span class="pmodel">${esc(p.model)}</span>
<span class="pphase"${stalled?' style="background:rgba(224,102,102,.18);color:#e06666"':''}>${
stalled?'STALLED':esc(p.phase||'')}</span>
${p.max_per_subtask?`<span class="pphase" style="background:rgba(201,154,63,.16);color:var(--gold)">MAX ${p.max_per_subtask}/subtask</span>`:''}
<span class="pnums">${(p.inferred||0).toLocaleString()} / ${(p.total||0).toLocaleString()} answered · ${(p.scored||0).toLocaleString()} judged</span>
</div>
<div class="pbar"><i style="width:${pct.toFixed(1)}%"></i></div>
<div class="pmeta">subtasks ${p.subtasks_done}/${p.subtasks_total} done · ${p.subtasks_active} running · ${p.subtasks_left} not started · judged ${spct.toFixed(0)}%</div>
${p.current?`<div class="pmeta">now: ${esc(p.current)} — ${p.current_done}/${p.current_total}</div>`:''}
${stalled?`<div class="pmeta" style="color:#e06666">no new ${stalledWhat} for ${Math.round(stalledFor/60)} min — the run may be rate-limited or stopped</div>`:''}
</div>`;
}catch(e){el.hidden=true;}
}
loadProgress(); setInterval(loadProgress,30000);
// ---------------- Manage panel (owner only) ----------------
function mmsg(t,kind){const e=document.getElementById('manageMsg');
e.className='msg'+(t?(' show '+kind):'');e.textContent=t||'';}
// loadManage runs on page load, on sign-in and on every version switch, so several
// can be in flight at once. Without a guard the last response to arrive wins even if
// it is the oldest, which left the panel showing one version's counts while its
// delete buttons named another. Only the newest call may paint.
let _manageSeq=0;
async function loadManage(){
if(!ownerVersions?.size)return;
const seq=++_manageSeq;
const panel=document.getElementById('managePanel');
const list=document.getElementById('manageList');
try{
const want=CURRENT.id;
// /api/manage lists three repos and reads every request file, so it takes a good
// few seconds. Until it lands the rows on screen still belong to the version we
// just left, and their buttons are labelled and wired for it -- a "Delete v7
// score" button sitting live on the v8 panel. Say which version is loading and
// freeze the controls until the new rows replace them.
const bar=document.getElementById('mbarNote');
if(bar)bar.textContent='loading '+want+'…';
for(const b of [document.getElementById('btnQueueMissing'),
document.getElementById('btnQueueAll'),
...list.querySelectorAll('button[data-act]')]){
if(b)b.disabled=true;
}
const r=await fetch('/api/manage?version='+encodeURIComponent(want),{credentials:'same-origin'});
if(seq!==_manageSeq)return; // a newer load started while we waited
if(!r.ok){
// 401/403 = not signed in, or not the maintainer. Hide rather than explain:
// this panel simply does not exist for anyone else.
panel.hidden=true;
list.innerHTML='<div class="mrow" style="color:var(--ink-mute)">Sign in as the maintainer to manage models.</div>';
return;
}
const d=await r.json();
if(seq!==_manageSeq)return;
panel.hidden=false;
const models=Array.isArray(d.models)?d.models:[];
const versions=Array.isArray(d.versions)&&d.versions.length?d.versions:VERSIONS.map(v=>v.id);
document.getElementById('manageCount').textContent=`${models.length} submitted`;
const missing=models.length-models.filter(m=>((m.results_by_version||{})[CURRENT.id]||[]).length).length;
document.getElementById('manageBar').hidden=false;
document.getElementById('mbarVer').textContent='managing '+CURRENT.id;
document.getElementById('mbarNote').textContent=
`${models.length-missing} scored on ${CURRENT.id}, ${missing} missing`;
if(!models.length){list.innerHTML='<div class="mrow" style="color:var(--ink-mute)">Nothing submitted yet.</div>';return;}
list.innerHTML=models.map(m=>{
const s=(m.status||'').toUpperCase();
const cls=s==='RUNNING'?'b-running':(s==='FAILED'||s==='REJECTED')?'b-failed':'b-pending';
const tags=[`<span class="badge ${cls}">${s}</span>`];
if(m.visibility==='private')tags.push('<span class="badge b-private">PRIVATE</span>');
if(m.source==='closed')tags.push('<span class="badge b-pending">API</span>');
// Where this model actually has a score. The status badge above is global —
// one request serves every version — so it says nothing about which board the
// model is on. These chips do.
const byv=m.results_by_version||{};
const chips=versions.map(v=>{
const on=Array.isArray(byv[v])&&byv[v].length;
const priv=on&&byv[v].includes('private')&&!byv[v].includes('public');
return `<span class="vchip${on?' on':''}${v===CURRENT.id?' here':''}" title="${
on?`scored on ${v}${priv?' (private)':''}`:`no score on ${v}`}">${v}${on?(priv?' ●':' ✓'):' —'}</span>`;
}).join('');
const hasHere=Array.isArray(byv[CURRENT.id])&&byv[CURRENT.id].length;
return `<div class="mrow" data-model="${esc(m.model)}">
<span class="mname" title="${esc(m.model)}">${esc(m.model)}</span>
${tags.join('')}${chips}
<button class="mbtn" data-act="rerun">Re-run</button>
<button class="mbtn danger" data-act="delete"${hasHere?'':' disabled title="no score on this version"'}>Delete ${esc(CURRENT.id)} score</button>
<button class="mbtn danger" data-act="purge">Remove entirely</button>
</div>`;}).join('');
list.querySelectorAll('button[data-act]').forEach(b=>b.onclick=()=>manageAct(b));
const bm=document.getElementById('btnQueueMissing'), ba=document.getElementById('btnQueueAll');
bm.textContent=`Queue ${missing} missing on ${CURRENT.id}`;
bm.disabled=!missing;
bm.onclick=()=>requeue(true,bm);
ba.onclick=()=>requeue(false,ba);
}catch(e){
panel.hidden=true;
list.innerHTML=`<div class="mrow" style="color:var(--ink-mute)">Could not load (${esc(String(e))}).</div>`;
}
}
async function manageAct(btn){
const row=btn.closest('.mrow'), model=row.dataset.model, act=btn.dataset.act;
const label=btn.textContent;
// 'delete' drops only the score on the version being viewed. 'purge' removes the
// queue entry and every version's score — the request is shared across versions,
// so purging while looking at v8 also takes the v7 row down.
if(act==='delete'&&!confirm(
`Remove ${model}'s ${CURRENT.id} score?\n\nIts queue entry stays, so it can be evaluated again. Scores on other versions are untouched.`))return;
if(act==='purge'&&!confirm(
`Remove ${model} entirely?\n\nThis deletes its queue entry AND its score on EVERY version, ${CURRENT.id} included. It cannot be undone — only a fresh submission would bring it back.`))return;
row.querySelectorAll('button').forEach(b=>b.disabled=true);
btn.textContent=act==='rerun'?'Queuing…':'Removing…';
const url=act==='rerun'?'/api/model/rerun':'/api/model/delete';
const body={model,version:CURRENT.id};
if(act!=='rerun')body.scope=(act==='purge')?'all':'version';
try{
const r=await fetch(url,{method:'POST',credentials:'same-origin',
headers:{'Content-Type':'application/json'},body:JSON.stringify(body)});
const d=await r.json().catch(()=>({}));
if(r.ok){mmsg(d.message||'Done.','ok');await loadManage();
if(act!=='rerun')setTimeout(()=>location.reload(),1200);}
else{mmsg(d.detail||d.message||('Error '+r.status),'err');
row.querySelectorAll('button').forEach(b=>b.disabled=false);
btn.textContent=label;}
}catch(e){mmsg('Network error — please try again.','err');
row.querySelectorAll('button').forEach(b=>b.disabled=false);
btn.textContent=label;}
}
async function requeue(onlyMissing,btn){
const what=onlyMissing?`every model with no ${CURRENT.id} score`:`ALL models, including the ${CURRENT.id} ones already scored`;
if(!confirm(`Queue ${what} for re-evaluation?\n\nOnly finished and failed models are queued. Anything HELD, CANCELLED, SUPERSEDED or REJECTED is left exactly as it is.\n\nThey run on whichever version the worker has as its RUN_ID — make sure that is ${CURRENT.id} before you start it.`))return;
const label=btn.textContent; btn.disabled=true; btn.textContent='Queuing…';
try{
const r=await fetch('/api/requeue-all',{method:'POST',credentials:'same-origin',
headers:{'Content-Type':'application/json'},
body:JSON.stringify({version:CURRENT.id,only_missing:onlyMissing})});
const d=await r.json().catch(()=>({}));
mmsg(r.ok?(d.message||'Queued.'):(d.detail||d.message||('Error '+r.status)),r.ok?'ok':'err');
if(r.ok)await loadManage();
}catch(e){mmsg('Network error — please try again.','err');}
btn.disabled=false; btn.textContent=label;
}
// show the pinned-column edge shadow only while the table is scrolled right
const boardScroll=document.querySelector('.board-scroll');
if(boardScroll)boardScroll.addEventListener('scroll',
()=>boardScroll.classList.toggle('scrolled',boardScroll.scrollLeft>2),{passive:true});
function syncVersionPicker(ids){
const allowed=VERSIONS.filter(v=>ids.includes(v.id));
const next=new Set(allowed.map(v=>v.id));
if(ownerVersions&&[...ownerVersions].join(",")===[...next].join(","))return;
ownerVersions=next;
const picker=document.getElementById("verSel");
const fromHash=(location.hash.match(/(?:^|[#&])v=([^&]+)/)||[])[1];
let wanted=fromHash;
if(next.size&&!wanted){try{wanted=localStorage.getItem("benchVersion");}catch(e){}}
CURRENT=allowed.find(v=>v.id===wanted)||PUBLIC_VERSION;
picker.innerHTML="";
for(const version of allowed){
const option=document.createElement("option");
option.value=version.id;
option.textContent=version.label;
picker.appendChild(option);
}
picker.value=CURRENT.id;
document.getElementById("versionBar").hidden=!next.size;
if(fromHash&&fromHash!==CURRENT.id)history.replaceState(null,"","#v="+CURRENT.id);
if(next.size)loadManage();
else{
++_manageSeq;
document.getElementById("managePanel").hidden=true;
}
init();
}
document.getElementById("verSel").onchange=event=>{
const version=VERSIONS.find(v=>v.id===event.target.value&&ownerVersions?.has(v.id));
if(!version||CURRENT.id===version.id)return;
CURRENT=version;
try{localStorage.setItem("benchVersion",version.id);}catch(e){}
history.replaceState(null,"","#v="+version.id);
init();
loadManage();
};
document.getElementById('openComparison').onclick=openComparison;
document.getElementById('closeComparison').onclick=()=>document.getElementById('comparisonDialog').close();
for(const id of ['compareA','compareB','comparisonOrder'])document.getElementById(id).onchange=renderComparison;
for(const button of document.querySelectorAll('[data-comparison-mode]'))button.onclick=()=>{comparisonMode=button.dataset.comparisonMode;renderComparison();};
document.getElementById('swapComparison').onclick=()=>{const a=document.getElementById('compareA'),b=document.getElementById('compareB');const value=a.value;a.value=b.value;b.value=value;renderComparison();};
document.getElementById('closeSubtasks').onclick=()=>document.getElementById('subtaskDialog').close();
if(new URLSearchParams(location.search).get("signedin"))openModal();
else refreshMe();
</script>
</body>
</html>
<html lang="en" data-theme="dark">
<head>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>Arabic LLM Leaderboard</title>
<meta name="description" content="A hard, discriminating benchmark for Modern Standard Arabic — models graded by strong LLM judges." />
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link href="https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,400;9..144,600;9..144,700&family=Amiri:wght@400;700&family=IBM+Plex+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@400;500;600&display=swap" rel="stylesheet" />
<style>
:root{
--emerald-900:#04231e; --emerald-800:#063f37; --emerald-700:#0b5d50; --emerald-600:#0f766e;
--emerald-500:#10b981; --emerald-400:#34d399; --emerald-300:#6ee7b7;
--gold-600:#c99a3f; --gold-500:#dcb15a; --gold-400:#e7c877; --gold-300:#efd08a;
}
:root[data-theme="dark"]{
--bg:#071411; --bg2:#0a1a16; --surface:#0e211c; --surface2:#123029; --border:rgba(120,190,170,.16);
--ink:#eaf3ef; --ink-soft:#b7cec6; --ink-mute:#7f9a91;
--accent:var(--emerald-400); --accent-strong:var(--emerald-300); --gold:var(--gold-400);
--row-hover:rgba(16,185,129,.10); --head-bg:rgba(16,185,129,.13); --head-bd:var(--emerald-500);
--cell-heat:16,185,129;
--freeze:#0e211c; --freeze-hover:#15302a; --head-solid:#0e3529; --scroll-track:#0a1a16;
}
:root[data-theme="light"]{
--bg:#f6f3ea; --bg2:#efeadd; --surface:#fffdf7; --surface2:#f3efe4; --border:rgba(20,80,66,.16);
--ink:#122a23; --ink-soft:#3a544c; --ink-mute:#6d857c;
--accent:var(--emerald-600); --accent-strong:var(--emerald-700); --gold:var(--gold-600);
--row-hover:rgba(15,118,110,.07); --head-bg:rgba(15,118,110,.10); --head-bd:var(--emerald-600);
--cell-heat:5,150,105;
--freeze:#fffdf7; --freeze-hover:#eef4ed; --head-solid:#e7f0e9; --scroll-track:#e7e0d0;
}
*{box-sizing:border-box}
html,body{margin:0;padding:0;overscroll-behavior-x:none}
body{
background:
radial-gradient(120% 90% at 88% -8%, rgba(201,154,63,.10), transparent 55%),
radial-gradient(120% 90% at 8% -6%, rgba(16,185,129,.10), transparent 55%),
var(--bg);
color:var(--ink);
font-family:"IBM Plex Sans",ui-sans-serif,system-ui,sans-serif;
font-size:15px; line-height:1.5; -webkit-font-smoothing:antialiased;
}
.wrap{max-width:1840px;margin:0 auto;padding:20px clamp(12px,1.25vw,24px) 72px}
a{color:var(--accent); text-decoration:none}
a:hover{text-decoration:underline; text-decoration-style:dotted}
/* ---------------- Masthead ---------------- */
.masthead{
position:relative; overflow:hidden; border-radius:18px; padding:25px 34px 24px;
color:#f3efe4; margin-bottom:20px;
background:radial-gradient(130% 150% at 12% 8%, #0c6355 0%, #074237 46%, #04231e 100%);
border:1px solid rgba(201,154,63,.32);
box-shadow:0 26px 60px -30px rgba(0,0,0,.75), inset 0 1px 0 rgba(255,255,255,.05);
}
.masthead::before{content:"";position:absolute;inset:0;pointer-events:none;opacity:.15;
background-image:radial-gradient(circle at 88% 16%, rgba(231,200,119,.55) 0, transparent 42%),
repeating-linear-gradient(135deg, rgba(255,255,255,.05) 0 2px, transparent 2px 16px);
-webkit-mask-image:linear-gradient(90deg,transparent 42%,#000 100%); mask-image:linear-gradient(90deg,transparent 42%,#000 100%);}
.masthead::after{content:"";position:absolute;left:34px;right:34px;bottom:0;height:2px;
background:linear-gradient(90deg,transparent,#c99a3f 22%,#efd08a 50%,#c99a3f 78%,transparent);opacity:.75}
.mh-top{display:flex;justify-content:space-between;align-items:flex-start;gap:16px}
.eyebrow{font:600 11.5px/1 "IBM Plex Sans";letter-spacing:.3em;text-transform:uppercase;color:#ecd08a}
.titles{display:flex;align-items:baseline;gap:20px;flex-wrap:wrap;margin:13px 0 8px}
.title-en{margin:0;font:600 clamp(30px,4.6vw,48px)/1 "Fraunces",Georgia,serif;color:#fdfbf4;letter-spacing:-.012em}
.title-ar{font:700 clamp(23px,3.4vw,37px)/1.2 "Amiri",serif;color:#ecd08a;direction:rtl}
.tagline{max-width:88ch;margin:2px 0 0;font:400 15px/1.6 "IBM Plex Sans";color:#cfe6dd}
.stats{margin-top:17px;display:flex;gap:11px;flex-wrap:wrap;align-items:center;font:500 12.5px/1 "IBM Plex Sans";color:#b6d4ca}
.stats b{color:#fff;font-weight:700}.stats .dot{color:#c99a3f;font-size:8px;opacity:.85}
.theme-btn{flex:none;background:rgba(255,255,255,.08);border:1px solid rgba(255,255,255,.16);color:#f3efe4;
border-radius:10px;padding:8px 12px;cursor:pointer;font:600 13px/1 "IBM Plex Sans";transition:background .15s}
.theme-btn:hover{background:rgba(255,255,255,.16)}
.mh-actions{display:flex;align-items:center;gap:10px;flex-wrap:wrap;justify-content:flex-end}
.mh-who{color:#cfe6dd;font-size:12.5px;white-space:nowrap}
.mh-who b{color:#fff}.mh-who a{color:var(--gold-300)}
.btn-submit-top{box-shadow:0 10px 24px -12px rgba(16,185,129,.8)}
/* ---------------- Controls ---------------- */
.controls{display:flex;flex-wrap:wrap;gap:14px;align-items:center;margin-bottom:16px}
/* Keep this above the results so the owner can leave an empty archive. */
.verbar{display:flex;align-items:center;gap:10px;flex-wrap:wrap;margin-bottom:14px}
.verbar label{font:600 12px "IBM Plex Sans";letter-spacing:.02em;color:var(--ink-soft)}
.verbar select{padding:8px 12px;border-radius:10px;border:1px solid var(--border);
background:var(--bg2);color:var(--ink);font:500 13.5px "IBM Plex Sans"}
.verbar select:focus{outline:2px solid var(--accent);outline-offset:0;border-color:transparent}
.search{flex:1 1 260px;position:relative}
.search input{width:100%;padding:11px 14px 11px 38px;border-radius:12px;border:1px solid var(--border);
background:var(--surface);color:var(--ink);font:500 14px "IBM Plex Sans"}
.search input::placeholder{color:var(--ink-mute)}
.search svg{position:absolute;left:12px;top:50%;transform:translateY(-50%);opacity:.5}
.chips{display:flex;gap:8px;flex-wrap:wrap}
.chip{border:1px solid var(--border);background:var(--surface);color:var(--ink-soft);border-radius:999px;
padding:8px 14px;font:600 12.5px "IBM Plex Sans";cursor:pointer;transition:all .12s;user-select:none}
.chip[aria-pressed="true"]{background:var(--accent);border-color:var(--accent);color:#04231e}
.range{display:flex;align-items:center;gap:10px;background:var(--surface);border:1px solid var(--border);
border-radius:12px;padding:8px 14px;font:600 12.5px "IBM Plex Sans";color:var(--ink-soft)}
.range input[type=range]{accent-color:var(--accent);width:110px}
.range .rv{font-family:"IBM Plex Mono";color:var(--ink);min-width:22px;text-align:right}
/* ---------------- Table ---------------- */