Skip to content

Commit 4965e9c

Browse files
xslingcnYiyanZhai
authored andcommitted
feat: restore leaderboard (#107)
<!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **New Features** * Leaderboard section is now visible on the main page. * Two preset threshold buttons added (Set p=1.0 and Set p=0.7) with updated "Set p=..." labels. * **Bug Fixes** * Correctness bar now reflects each entry's absolute pass-rate percentage for more accurate visualization. <!-- end of auto-generated comment: release notes by coderabbit.ai -->
1 parent e383f83 commit 4965e9c

File tree

3 files changed

+14
-22
lines changed

3 files changed

+14
-22
lines changed

web/apps/web/app/leaderboard/client.tsx

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -241,13 +241,6 @@ export function LeaderboardClient({
241241
})
242242
}, [])
243243

244-
const setTopN = useCallback(
245-
(n: number) => {
246-
setVisibleAuthors(new Set(scoreboard.slice(0, n).map((entry) => entry.name)))
247-
},
248-
[scoreboard]
249-
)
250-
251244
const showAll = useCallback(() => {
252245
const authors = Object.keys(fast.curves).filter((name) => !excludedSet.has(name))
253246
setVisibleAuthors(new Set(authors))
@@ -388,8 +381,11 @@ export function LeaderboardClient({
388381
<div className="border-t px-4 pb-2">
389382
<div className="flex flex-wrap items-center gap-2 py-2 text-xs text-muted-foreground">
390383
<div className="flex gap-2">
391-
<Button size="sm" variant="outline" onClick={() => setTopN(DEFAULT_VISIBLE)}>
392-
Show top {DEFAULT_VISIBLE}
384+
<Button size="sm" variant="outline" onClick={() => setPinnedP(1.0)}>
385+
Set p=1.0
386+
</Button>
387+
<Button size="sm" variant="outline" onClick={() => setPinnedP(0.7)}>
388+
Set p=0.7
393389
</Button>
394390
<Button size="sm" variant="outline" onClick={showAll}>
395391
Show all
@@ -485,7 +481,7 @@ export function LeaderboardClient({
485481
<div className="space-y-4">
486482
{correctnessRanking.map((entry, index) => {
487483
const percent = (entry.passRate * 100).toFixed(1)
488-
const width = maxPassRate > 0 ? `${(entry.passRate / maxPassRate) * 100}%` : "0%"
484+
const width = maxPassRate > 0 ? `${entry.passRate * 100}%` : "0%"
489485
return (
490486
<div key={entry.author} className="space-y-2">
491487
<div className="flex items-center justify-between text-sm font-medium">

web/apps/web/app/page.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,10 +61,10 @@ export default async function HomePage() {
6161

6262
return (
6363
<div className="flex flex-col">
64-
{/* <LeaderboardSection
64+
<LeaderboardSection
6565
entries={leaderboardEntries}
6666
baselineLabel="Per-definition baselines"
67-
/> */}
67+
/>
6868

6969
<ModelsSection models={models} />
7070

web/apps/web/scripts/prebuild.mjs

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,12 @@ import { spawnSync } from "node:child_process"
55
import path from "node:path"
66
import process from "node:process"
77

8-
const DEFAULT_REPO = "https://github.com/flashinfer-ai/flashinfer-trace"
9-
const repo = process.env.FLASHINFER_TRACE_REPO ?? DEFAULT_REPO
10-
const ref = process.env.FLASHINFER_TRACE_REF ?? "origin/main"
8+
const DEFAULT_REPO = "https://huggingface.co/datasets/flashinfer-ai/flashinfer-trace"
9+
const repo = process.env.FIB_DATASET_REPO ?? DEFAULT_REPO
10+
const ref = process.env.FIB_DATASET_REF ?? "origin/main"
1111
const token = process.env.GH_TOKEN
1212

13-
const datasetRootEnv = process.env.FLASHINFER_TRACE_PATH ?? "/tmp/flashinfer-trace"
13+
const datasetRootEnv = process.env.FIB_DATASET_PATH ?? "/tmp/flashinfer-trace"
1414
const datasetRoot = path.isAbsolute(datasetRootEnv)
1515
? datasetRootEnv
1616
: path.resolve(process.cwd(), datasetRootEnv)
@@ -40,15 +40,11 @@ function ensureDataset() {
4040
mkdirSync(path.dirname(datasetRoot), { recursive: true })
4141

4242
if (!existsSync(datasetRoot)) {
43-
console.log(`[prebuild] Cloning dataset from ${repo}`)
43+
console.log(`[prebuild] ${datasetRoot} does not exist; cloning from ${repo}:${ref}`)
4444
run("git", ["clone", "--depth=1", authRepo, datasetRoot])
45+
run("git", ["-C", datasetRoot, "reset", "--hard", ref])
4546
return
4647
}
47-
48-
console.log("[prebuild] Refreshing existing dataset checkout")
49-
run("git", ["-C", datasetRoot, "fetch", "--all", "--prune"])
50-
run("git", ["-C", datasetRoot, "reset", "--hard", ref])
51-
run("git", ["-C", datasetRoot, "clean", "-fd"])
5248
}
5349

5450
try {

0 commit comments

Comments
 (0)