|
1 | 1 | <script> |
| 2 | + import { getContext } from "svelte"; |
2 | 3 | import SortableTable from "$components/helpers/SortableTable.svelte"; |
3 | 4 |
|
4 | 5 | export let leaderboardData = { global: [], stratified: [] }; |
5 | 6 |
|
| 7 | + const copy = getContext("copy") || {}; |
| 8 | + const lp = copy.leaderboardPage || {}; |
| 9 | +
|
| 10 | + const pageTitle = lp.title ?? "FormulaCode Leaderboard"; |
| 11 | + const globalTitle = lp.global?.title ?? "Global Leaderboard"; |
| 12 | + const stratTitle = lp.stratified?.title ?? "Stratified Leaderboard"; |
| 13 | + const stratDesc = |
| 14 | + lp.stratified?.description ?? |
| 15 | + 'Performance broken down by optimization scope: <strong>L1</strong> (Params), <strong>L2</strong> (Function), <strong>L3</strong> (Class), <strong>L4</strong> (Module).'; |
| 16 | + const submitTitle = lp.submit?.title ?? "Submit Your Model"; |
| 17 | + const submitDesc = |
| 18 | + lp.submit?.description ?? |
| 19 | + "To evaluate your own agent on FormulaCode, follow our installation guide."; |
| 20 | + const submitButtonText = lp.submit?.buttonText ?? "Get Started"; |
| 21 | + const submitRepoUrl = |
| 22 | + lp.submit?.repoUrl ?? "https://github.com/formula-code/fc-eval"; |
| 23 | +
|
6 | 24 | const globalColumns = [ |
7 | 25 | { key: "rank", label: "RP Rank", numeric: true, decimals: 0, prefix: "#" }, |
8 | 26 | { key: "agent", label: "Agent", numeric: false }, |
|
36 | 54 | }, |
37 | 55 | { |
38 | 56 | key: "level1", |
39 | | - label: "Level 1 (Module)", |
| 57 | + label: "L1 (Params)", |
40 | 58 | numeric: true, |
41 | 59 | colorCode: true, |
42 | 60 | colorThreshold: 0 |
43 | 61 | }, |
44 | 62 | { |
45 | 63 | key: "level2", |
46 | | - label: "Level 2 (Class)", |
| 64 | + label: "L2 (Function)", |
47 | 65 | numeric: true, |
48 | 66 | colorCode: true, |
49 | 67 | colorThreshold: 0 |
50 | 68 | }, |
51 | 69 | { |
52 | 70 | key: "level3", |
53 | | - label: "Level 3 (Function)", |
| 71 | + label: "L3 (Class)", |
| 72 | + numeric: true, |
| 73 | + colorCode: true, |
| 74 | + colorThreshold: 0 |
| 75 | + }, |
| 76 | + { |
| 77 | + key: "level4", |
| 78 | + label: "L4 (Module)", |
54 | 79 | numeric: true, |
55 | 80 | colorCode: true, |
56 | 81 | colorThreshold: 0 |
|
61 | 86 | <div class="leaderboard-page"> |
62 | 87 | <section class="section"> |
63 | 88 | <div class="container"> |
64 | | - <h1>FormulaCode Leaderboard</h1> |
65 | | - |
66 | | - <ul class="metrics-list"> |
67 | | - <li class="metric-item"> |
68 | | - <h3>Advantage (Adv)</h3> |
69 | | - <p> |
70 | | - Human-relative advantage. A value of 0 means the agent performs |
71 | | - exactly as well as a human expert. Positive values indicate |
72 | | - superhuman performance. |
73 | | - </p> |
74 | | - </li> |
75 | | - <li class="metric-item"> |
76 | | - <h3>Speedup</h3> |
77 | | - <p> |
78 | | - Geometric mean of speedup ratios across all workloads. >1.0 means |
79 | | - faster than baseline. |
80 | | - </p> |
81 | | - </li> |
82 | | - <li class="metric-item"> |
83 | | - <h3>RP Rank</h3> |
84 | | - <p> |
85 | | - Ranked Pairs algorithm rank. Aggregate ranking based on pairwise |
86 | | - comparisons. |
87 | | - </p> |
88 | | - </li> |
89 | | - </ul> |
| 89 | + <h1>{pageTitle}</h1> |
90 | 90 |
|
91 | 91 | <div class="table-section"> |
92 | | - <h2>Global Leaderboard</h2> |
| 92 | + <h2>{globalTitle}</h2> |
93 | 93 | <SortableTable |
94 | 94 | columns={globalColumns} |
95 | 95 | rows={leaderboardData.global} |
|
99 | 99 | </div> |
100 | 100 |
|
101 | 101 | <div class="table-section"> |
102 | | - <h2>Stratified Leaderboard</h2> |
| 102 | + <h2>{stratTitle}</h2> |
103 | 103 | <p class="section-desc"> |
104 | | - Performance broken down by optimization scope: |
105 | | - <strong>Level 1</strong> (Module), |
106 | | - <strong>Level 2</strong> (Class), |
107 | | - <strong>Level 3</strong> (Function). |
| 104 | + {@html stratDesc} |
108 | 105 | </p> |
109 | 106 | <SortableTable |
110 | 107 | columns={stratifiedColumns} |
|
115 | 112 | </div> |
116 | 113 |
|
117 | 114 | <div class="submission-highlight"> |
118 | | - <h2>Submit Your Model</h2> |
119 | | - <p> |
120 | | - To evaluate your own agent on FormulaCode, follow our installation |
121 | | - guide. |
122 | | - </p> |
| 115 | + <h2>{submitTitle}</h2> |
| 116 | + <p>{submitDesc}</p> |
123 | 117 | <a |
124 | | - href="https://github.com/formula-code/terminal-bench" |
125 | | - class="cta-button">Get Started</a |
| 118 | + href={submitRepoUrl} |
| 119 | + class="cta-button">{submitButtonText}</a |
126 | 120 | > |
127 | 121 | </div> |
128 | 122 | </div> |
|
163 | 157 | color: var(--text-secondary); |
164 | 158 | } |
165 | 159 |
|
166 | | - .metrics-list { |
167 | | - list-style: none; |
168 | | - padding: 0; |
169 | | - margin: 0 0 4rem 0; |
170 | | - display: grid; |
171 | | - grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); |
172 | | - gap: 1.5rem; |
173 | | - } |
174 | | -
|
175 | | - .metric-item { |
176 | | - background: var(--bg-secondary); |
177 | | - padding: 1.5rem; |
178 | | - border-radius: 8px; |
179 | | - border: 1px solid var(--border-secondary); |
180 | | - } |
181 | | -
|
182 | | - .metric-item h3 { |
183 | | - font-family: var(--sans); |
184 | | - font-size: 1.1rem; |
185 | | - margin-bottom: 0.5rem; |
186 | | - color: var(--accent-secondary); |
187 | | - } |
188 | | -
|
189 | | - .metric-item p { |
190 | | - font-family: var(--sans); |
191 | | - font-size: 0.9rem; |
192 | | - line-height: 1.5; |
193 | | - color: var(--text-secondary); |
194 | | - margin: 0; |
195 | | - } |
196 | | -
|
197 | 160 | .table-section { |
198 | 161 | margin-bottom: 4rem; |
199 | 162 | } |
|
0 commit comments