Redesign: Apple-minimal design system (style.css) + new 4-tab HTML structure (Build/Expert/Leaderboard/Run locally), professional copy, zero emoji/em-dash
Browse files- CODEX_BRIEF.md +92 -58
- app.py +167 -112
- style.css +379 -189
CODEX_BRIEF.md
CHANGED
|
@@ -1,61 +1,95 @@
|
|
| 1 |
-
# Codex task
|
| 2 |
-
|
| 3 |
-
You are improving a Hugging Face Gradio Space submitted to the "Build Small" hackathon.
|
| 4 |
-
The app (`app.py` + `style.css`) is a custom-JS machine-builder: a user snaps blocks
|
| 5 |
-
together (norm → ±residual → activation), presses BUILD, and a 1B model (MiniCPM5-1B) writes
|
| 6 |
-
a real Triton GPU kernel that an immutable referee compiles, correctness-checks vs PyTorch,
|
| 7 |
-
and times against `torch.compile`. Verified kernels that beat the compiler hit a leaderboard.
|
| 8 |
-
|
| 9 |
-
## The one problem to solve
|
| 10 |
-
The live backend scales to zero, so the FIRST mint of a session takes ~90 seconds while the
|
| 11 |
-
model wakes up. A hackathon judge who opens the Space, clicks BUILD, and stares at a "waking
|
| 12 |
-
up" spinner for 90s will leave. We must make the value obvious in the first ~10 seconds
|
| 13 |
-
WITHOUT lying about anything.
|
| 14 |
-
|
| 15 |
-
## What you have
|
| 16 |
-
`replays/index.json` holds THREE real, verified mints recorded from the live backend today
|
| 17 |
-
(softmax 1.052×, rmsnorm→gelu 1.045×, add+layernorm→silu 1.083×). Each entry has the real
|
| 18 |
-
`source` (the Triton kernel the 1B actually wrote), `statuses` (the per-attempt referee
|
| 19 |
-
verdicts, e.g. ["ok","ok","ok","ok"]), `speedup_compile`, `speedup_eager`, `gen_seconds`,
|
| 20 |
-
and `explanation`. These are genuine outputs, not mockups.
|
| 21 |
-
|
| 22 |
-
## What to build (in priority order)
|
| 23 |
-
1. **Instant "Watch a real mint" path.** On load, before the backend is warm, let the user
|
| 24 |
-
replay one of the three recorded mints with a button (e.g. "▶ Watch a real mint (instant)"
|
| 25 |
-
near the BUILD button, or auto-offer it when the machine matches a recorded recipe). It
|
| 26 |
-
must animate the SAME result UI the live path uses — the attempts streaming in, the
|
| 27 |
-
referee verdict, the speedup, the real kernel source — sourced from `replays/index.json`.
|
| 28 |
-
Label it honestly as a recorded run ("a real mint we recorded earlier — press BUILD to mint
|
| 29 |
-
your own live"). This is the headline fix: the judge sees the whole loop in 2 seconds.
|
| 30 |
-
2. **Make the cold-start wait pleasant and honest.** While a live mint is in flight, show
|
| 31 |
-
that the referee is the point: a step ticker ("model waking…", "drafting 4 kernels…",
|
| 32 |
-
"compiling…", "checking correctness vs PyTorch…", "timing vs torch.compile…"). If the
|
| 33 |
-
backend returns the "waking up" message, keep the user engaged (offer the instant replay)
|
| 34 |
-
rather than showing a raw error.
|
| 35 |
-
3. **Tighten the visual hierarchy** so the BUILD action and the verdict are unmissable.
|
| 36 |
-
Improve the result card: clear ✅/❌, the speedup number big, "k of n attempts passed the
|
| 37 |
-
referee", and a collapsible real-kernel-source view. Keep the existing block-machine and
|
| 38 |
-
the kid-friendly tone — do not rip out the working UI, refine it.
|
| 39 |
-
4. Keep the Leaderboard and Learn pages; make sure nav still works.
|
| 40 |
-
|
| 41 |
-
## Hard constraints
|
| 42 |
-
- Pure Gradio + custom JS in `gr.HTML` (no new heavy deps). Frontend talks to the backend
|
| 43 |
-
exactly as it does now (the `do_mint` Python bridge). Do not change backend URLs or the
|
| 44 |
-
request/response contract.
|
| 45 |
-
- `replays/index.json` is bundled in the repo — load it client-side (you can inline it into
|
| 46 |
-
the page via Python at render time, or fetch it; inlining avoids a network hop).
|
| 47 |
-
- Everything must degrade gracefully if the backend is down: the instant replay still works.
|
| 48 |
-
- Do NOT invent performance numbers anywhere. Only show numbers that come from the live
|
| 49 |
-
backend or from `replays/index.json`.
|
| 50 |
-
- Test that `python app.py` imports and builds the Blocks without error (set a dummy
|
| 51 |
-
`BACKEND_URL` if needed; you don't have GPU/backend access, so verify the UI renders and the
|
| 52 |
-
replay path works, not a live mint).
|
| 53 |
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 58 |
|
| 59 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 60 |
|
| 61 |
-
-
|
|
|
|
| 1 |
+
# Codex task: rewrite APP_JS for the redesigned Kernel Mint (new DOM + Expert mode)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
|
| 3 |
+
The file `app.py` was redesigned. `style.css` (a new Apple-minimal design system) and the new
|
| 4 |
+
`APP_HTML` are DONE and must not be restyled or rewritten. Your job is to **rewrite the `APP_JS`
|
| 5 |
+
string** so the app works against the new DOM, and to add the new Expert mode. Keep the Python
|
| 6 |
+
bridge and `do_mint`/`fetch_lb` exactly as they are.
|
| 7 |
+
|
| 8 |
+
The OLD `APP_JS` is still in the file. Reuse its data dictionaries (ACTS, NORMS, MEM, CLASSICS,
|
| 9 |
+
INPUT) and its working logic for the number-flow SVG viz, the live build animation, the replay
|
| 10 |
+
system, the leaderboard render, and the Python bridge. Adapt all of it to the new DOM below.
|
| 11 |
+
|
| 12 |
+
## Hard rules
|
| 13 |
+
- NO emoji anywhere in any string. NO em-dash or en-dash characters (use a period, comma, or
|
| 14 |
+
parentheses). The whole point of the redesign is a professional, Apple-grade tone.
|
| 15 |
+
- Do not touch `style.css`, the `APP_HTML`, the Python functions, or the bridge components
|
| 16 |
+
(`#km_recipe`, `#km_result`, `#km_lb`, `#km_go`). Only rewrite the `APP_JS` string.
|
| 17 |
+
- Pure vanilla JS inside the existing `() => { ... }` IIFE that Gradio runs via `demo.load`.
|
| 18 |
+
|
| 19 |
+
## The Python bridge (unchanged, reuse the old approach)
|
| 20 |
+
`recipe()` returns JSON written into `#km_recipe` textarea; then click `#km_go`; the result blob
|
| 21 |
+
arrives in `#km_result` as `<span data-blob="base64(json)">`. A MutationObserver decodes it and
|
| 22 |
+
calls `showResult(d)`. `#km_lb` delivers `{rows:[...]}` the same way. The recipe shape is:
|
| 23 |
+
`{mode:'build'|'classic', norm, residual:bool, acts:[...], classic, spark, k, temp, pro, name}`.
|
| 24 |
+
|
| 25 |
+
## New DOM contract (IDs/classes that exist in APP_HTML now)
|
| 26 |
+
- Tabs: `#km-tabs` has 4 `.km-tab[data-tab=build|expert|lb|docs]` and a `#km-tab-pill`. Clicking a
|
| 27 |
+
tab shows the matching `.km-page[data-page=...]` (hide others with `hidden`) and slides the pill
|
| 28 |
+
under the active tab (set pill `transform: translateX()` and `width` to match the button).
|
| 29 |
+
- Build composer (replaces drag-drop): the pipeline stages are `.km-pick[data-slot=mem|norm|act|act2]`.
|
| 30 |
+
Populate each with `.km-opt` chip buttons:
|
| 31 |
+
- `mem`: two chips, "none" and "add input" (residual off/on). Default none.
|
| 32 |
+
- `norm`: "RMSNorm", "LayerNorm" (keys rmsnorm/layernorm). Default RMSNorm.
|
| 33 |
+
- `act`: one chip per ACTS key, label = ACTS[k].lbl. Default gelu.
|
| 34 |
+
- `act2`: "none" + one chip per ACTS key. Default none. (optional second activation)
|
| 35 |
+
Clicking a chip sets `.on` on it (single-select within its slot) and updates the recipe + viz +
|
| 36 |
+
`#km-info` knowledge line (use ACTS/NORMS/MEM `.info` text; on hover too). Keep `slots` state.
|
| 37 |
+
- Compose/Classics segmented: `.km-segb[data-mode=build|classic]`. Toggling shows `#km-compose` vs
|
| 38 |
+
`#km-classic`. Populate `#km-classics` with `.km-opt` chips from CLASSICS (single-select).
|
| 39 |
+
- Attempts stepper: `#km-tries` (build) and `#km-xtries` (expert) are empty containers. Fill each
|
| 40 |
+
with buttons 1..8 (`.km-stepper` is the wrapper, already styled; append `<button>` children).
|
| 41 |
+
Selected has `.on`; reflect value into `#km-tries-v` / `#km-xtries-v`.
|
| 42 |
+
- Temperature: `#km-temp` / `#km-xtemp` range inputs; mirror `(value/100).toFixed(2)` into
|
| 43 |
+
`#km-temp-v` / `#km-xtemp-v`.
|
| 44 |
+
- Pro toggle: `#km-pro` / `#km-xpro` checkboxes.
|
| 45 |
+
- Name: `#km-name` (build only).
|
| 46 |
+
- Mint buttons: `#km-build` (build), `#km-xbuild` (expert). Recorded mint button `#km-replay`
|
| 47 |
+
and `.km-replay-picks` work as before.
|
| 48 |
+
- Result targets: `#km-verdict` (build), `#km-xverdict` (expert). `showResult(d)` must render into
|
| 49 |
+
whichever page is active (track last-minted mode). Source goes to `#km-source > #km-code` (build)
|
| 50 |
+
or `#km-xsource > .km-code` (expert).
|
| 51 |
+
- Viz: `#km-svg` + `#km-stage-label` (was `#km-stage`). Keep the morph/play animation; restyle uses
|
| 52 |
+
CSS vars already. Use stroke `#34e0a1` for the line and `#34e0a1`/`#ff7a7a` for dots (or read the
|
| 53 |
+
CSS var). The old viz code is fine, just point it at `#km-stage-label`.
|
| 54 |
+
- History: `#km-hist`.
|
| 55 |
+
- Glossary: `#km-learn-blocks` (in docs). Build the block glossary as before with `.km-gloss` rows.
|
| 56 |
|
| 57 |
+
## Expert mode (new)
|
| 58 |
+
- `#km-xbrief` textarea: as the user types, resolve the text to the nearest verifiable spec and show
|
| 59 |
+
it in `#km-xresolved` (`.v` holds the resolved op label; add class `unknown` and an honest message
|
| 60 |
+
if nothing matches).
|
| 61 |
+
- Resolver: scan the lowercased brief for keywords -> build a recipe.
|
| 62 |
+
- norm: "rmsnorm"/"rms norm"/"rms" -> rmsnorm; "layernorm"/"layer norm" -> layernorm (default rmsnorm).
|
| 63 |
+
- residual: "residual"/"resid"/"skip"/"add input"/"+ input" -> true.
|
| 64 |
+
- activation: match any ACTS key or its lbl/verb words (gelu, silu/swish, relu, tanh, sigmoid,
|
| 65 |
+
relu2/"squared relu", gelu_erf/"exact gelu", leaky, elu, mish). First match = acts[0], a second
|
| 66 |
+
distinct match = acts[1].
|
| 67 |
+
- classics: if the brief clearly names softmax / scaled softmax / swiglu / geglu, use mode classic
|
| 68 |
+
with that key (takes precedence over the compose path).
|
| 69 |
+
- If no norm and no activation and no classic matched -> unknown; tell the user it could not map and
|
| 70 |
+
to pick from the supported list. Disable `#km-xbuild` when unknown.
|
| 71 |
+
- The recipe passes `spark: <the full brief text>` so the model sees the expert's exact words.
|
| 72 |
+
- `#km-oplist` (expert) and `#km-docs-ops` (docs): render `.km-optag` chips for the supported space
|
| 73 |
+
(the norm x residual x activation combos are large, so show a representative set: the classics +
|
| 74 |
+
e.g. "add_rmsnorm_gelu", "layernorm_silu", "rmsnorm_mish", etc. plus the raw activation names).
|
| 75 |
+
Clicking an `.km-optag` in the expert panel fills `#km-xbrief` with a matching brief and re-resolves.
|
| 76 |
+
- `#km-xbuild` mints using the resolved recipe via the same bridge; result renders into `#km-xverdict`.
|
| 77 |
+
|
| 78 |
+
## Docs copy buttons
|
| 79 |
+
`.km-copy` buttons inside `.km-codeblock`: on click, copy the codeblock's text (minus the button)
|
| 80 |
+
to clipboard via `navigator.clipboard.writeText`, briefly set the button text to "Copied".
|
| 81 |
+
|
| 82 |
+
## Verify before finishing
|
| 83 |
+
- `python -c "import app"` (or py_compile) passes. Use the sibling Gradio venv at
|
| 84 |
+
`/home/tihor/webllm/verifier-self-distillation-loop/domains/hackathon-build-small/glass-brain/.venv/bin/python`
|
| 85 |
+
to import and build `app.demo` with a dummy `BACKEND_URL`.
|
| 86 |
+
- Headless smoke with the playwright chromium in `/home/tihor/webllm/.venv-train/bin/python`: load
|
| 87 |
+
the app, assert all four tabs switch, the compose chips select, the stepper works, the expert
|
| 88 |
+
resolver shows a resolved op for "fused rmsnorm with residual and silu", the recorded-mint replay
|
| 89 |
+
renders a verdict, and the leaderboard table renders. Screenshot to /tmp for a sanity check.
|
| 90 |
+
- Grep your new APP_JS for emoji and em-dash/en-dash; there must be zero.
|
| 91 |
+
|
| 92 |
+
## Commit discipline
|
| 93 |
+
Commit as the repo user with this trailer on every commit (for the hackathon OpenAI prize):
|
| 94 |
|
| 95 |
+
Co-authored-by: Codex <codex@openai.com>
|
app.py
CHANGED
|
@@ -83,130 +83,185 @@ except Exception:
|
|
| 83 |
|
| 84 |
APP_HTML = r"""
|
| 85 |
<div id="km">
|
| 86 |
-
<
|
| 87 |
-
<
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
|
| 92 |
-
|
| 93 |
-
|
| 94 |
-
|
| 95 |
-
|
|
|
|
|
|
|
|
|
|
| 96 |
<script id="km-replays-data" type="application/json">__KM_REPLAYS__</script>
|
| 97 |
|
| 98 |
-
<!-- ============ BUILD
|
| 99 |
<div class="km-page" data-page="build">
|
| 100 |
-
|
| 101 |
-
|
| 102 |
-
<
|
| 103 |
-
|
| 104 |
-
|
| 105 |
-
<
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
<div id="km-machine">
|
| 110 |
-
<div class="km-slot" data-slot="mem" data-accept="mem"><span class="km-ph">+ memory <i>(optional)</i></span></div>
|
| 111 |
-
<div class="km-arrow">↓</div>
|
| 112 |
-
<div class="km-slot" data-slot="norm" data-accept="norm"><span class="km-ph">📐 a tidy-up block</span></div>
|
| 113 |
-
<div class="km-arrow">↓</div>
|
| 114 |
-
<div class="km-slot" data-slot="act" data-accept="act"><span class="km-ph">🎨 a bend block</span></div>
|
| 115 |
-
<div class="km-arrow">↓</div>
|
| 116 |
-
<div class="km-slot km-slot-opt" data-slot="act2" data-accept="act"><span class="km-ph">🌀 bend again <i>(hard mode)</i></span></div>
|
| 117 |
</div>
|
| 118 |
-
|
| 119 |
-
<div id="km-
|
| 120 |
-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
|
| 124 |
-
|
| 125 |
-
|
| 126 |
-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
|
| 130 |
-
|
| 131 |
-
|
| 132 |
-
<label><span>🎲 tries</span><input type="range" id="km-tries" min="1" max="8" value="4"><b id="km-tries-v">4</b></label>
|
| 133 |
-
<label><span>🌶️ wild</span><input type="range" id="km-temp" min="20" max="130" value="70"><b id="km-temp-v">0.70</b></label>
|
| 134 |
-
<label><span>🏷️ name</span><input id="km-name" placeholder="for the leaderboard"></label>
|
| 135 |
-
<label class="km-pro"><input type="checkbox" id="km-pro"><span>🔥 Pro mode</span> <i>the big 27B model — slower, smarter</i></label>
|
| 136 |
-
</div>
|
| 137 |
-
|
| 138 |
-
<div class="km-label">④ your call — will it beat the compiler, or just tie?</div>
|
| 139 |
-
<div id="km-guess">
|
| 140 |
-
<button class="km-gbtn on" data-g="beat">👍 It'll beat it</button>
|
| 141 |
-
<button class="km-gbtn" data-g="tie">🤝 Just a tie</button>
|
| 142 |
-
</div>
|
| 143 |
-
|
| 144 |
-
<div class="km-actions">
|
| 145 |
-
<button id="km-surprise">🎲 Surprise me</button>
|
| 146 |
-
<button id="km-build">⚒️ BUILD MY KERNEL</button>
|
| 147 |
-
</div>
|
| 148 |
-
<div id="km-replay-callout" class="km-replay-callout">
|
| 149 |
-
<div>
|
| 150 |
-
<b>Need the whole loop now?</b>
|
| 151 |
-
<span id="km-replay-note">Watch a real mint recorded earlier. Then press BUILD to mint your own live.</span>
|
| 152 |
</div>
|
| 153 |
-
<button id="km-replay" data-replay-key="rmsnorm_gelu">▶ Watch a real mint (instant)</button>
|
| 154 |
-
</div>
|
| 155 |
-
<div id="km-replay-picks" class="km-replay-picks" aria-label="recorded mints"></div>
|
| 156 |
-
</section>
|
| 157 |
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
<
|
| 162 |
-
|
| 163 |
-
<
|
| 164 |
-
|
| 165 |
-
<
|
| 166 |
-
|
| 167 |
-
|
| 168 |
-
|
| 169 |
-
|
| 170 |
-
|
| 171 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 172 |
</div>
|
| 173 |
|
| 174 |
-
<!-- ============
|
| 175 |
-
<div class="km-page" data-page="
|
| 176 |
-
<
|
| 177 |
-
<
|
| 178 |
-
<
|
| 179 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 180 |
</div>
|
| 181 |
</div>
|
| 182 |
|
| 183 |
-
<!-- ============
|
| 184 |
-
<div class="km-page" data-page="
|
| 185 |
-
<
|
| 186 |
-
<
|
| 187 |
-
<p
|
| 188 |
-
|
| 189 |
-
|
| 190 |
-
|
| 191 |
-
|
| 192 |
-
|
| 193 |
-
|
| 194 |
-
|
| 195 |
-
|
| 196 |
-
|
| 197 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 198 |
<div id="km-learn-blocks"></div>
|
| 199 |
-
|
| 200 |
-
<
|
| 201 |
-
|
| 202 |
-
|
| 203 |
-
idea and the AI follows it while staying correct.<br><b>Pro mode</b> — swaps the 1B model for
|
| 204 |
-
the 27B: slower, but it knows more and writes faster kernels.</p>
|
| 205 |
-
<h3>Why a tiny model?</h3>
|
| 206 |
-
<p>The model building your kernels is only <b>one billion</b> numbers — small enough to run
|
| 207 |
-
cheaply. The 👑 you race were set by one <b>27× bigger</b>. The secret of this whole project:
|
| 208 |
-
the clever part isn't the giant model, it's the <b>honest referee</b>.</p>
|
| 209 |
-
</div>
|
| 210 |
</div>
|
| 211 |
</div>
|
| 212 |
"""
|
|
|
|
| 83 |
|
| 84 |
APP_HTML = r"""
|
| 85 |
<div id="km">
|
| 86 |
+
<div id="km-top">
|
| 87 |
+
<div id="km-brand">
|
| 88 |
+
<span class="mark"><span class="dot"></span>Kernel Mint</span>
|
| 89 |
+
<span class="sub">an OUROBOROS demo</span>
|
| 90 |
+
</div>
|
| 91 |
+
<div id="km-tabs">
|
| 92 |
+
<span id="km-tab-pill"></span>
|
| 93 |
+
<button class="km-tab on" data-tab="build">Build</button>
|
| 94 |
+
<button class="km-tab" data-tab="expert">Expert</button>
|
| 95 |
+
<button class="km-tab" data-tab="lb">Leaderboard</button>
|
| 96 |
+
<button class="km-tab" data-tab="docs">Run locally</button>
|
| 97 |
+
</div>
|
| 98 |
+
</div>
|
| 99 |
<script id="km-replays-data" type="application/json">__KM_REPLAYS__</script>
|
| 100 |
|
| 101 |
+
<!-- ============ BUILD ============ -->
|
| 102 |
<div class="km-page" data-page="build">
|
| 103 |
+
<header id="km-hero">
|
| 104 |
+
<h1>A 1B model writes a real GPU kernel. <span class="g">A referee that can't be fooled checks it.</span></h1>
|
| 105 |
+
<p>Compose an operation, and a 1-billion-parameter model writes a fused Triton kernel for it. The kernel is compiled, checked against PyTorch on adversarial inputs, and timed against PyTorch's own compiler before anything counts as a win.</p>
|
| 106 |
+
</header>
|
| 107 |
+
<div id="km-grid">
|
| 108 |
+
<section class="km-card">
|
| 109 |
+
<div class="km-seg" role="tablist">
|
| 110 |
+
<button class="km-segb on" data-mode="build">Compose</button>
|
| 111 |
+
<button class="km-segb" data-mode="classic">Classic ops</button>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 112 |
</div>
|
| 113 |
+
|
| 114 |
+
<div id="km-compose">
|
| 115 |
+
<div class="km-section-label">Pipeline</div>
|
| 116 |
+
<div id="km-pipe">
|
| 117 |
+
<div class="km-stage fixed"><span class="km-stage-k">input</span><span class="km-dim">a row of activations</span></div>
|
| 118 |
+
<div class="km-flow">↓</div>
|
| 119 |
+
<div class="km-stage"><span class="km-stage-k">residual</span><span class="km-pick" data-slot="mem"></span></div>
|
| 120 |
+
<div class="km-flow">↓</div>
|
| 121 |
+
<div class="km-stage"><span class="km-stage-k">normalize</span><span class="km-pick" data-slot="norm"></span></div>
|
| 122 |
+
<div class="km-flow">↓</div>
|
| 123 |
+
<div class="km-stage"><span class="km-stage-k">activate</span><span class="km-pick" data-slot="act"></span></div>
|
| 124 |
+
<div class="km-flow">↓</div>
|
| 125 |
+
<div class="km-stage"><span class="km-stage-k">then</span><span class="km-pick" data-slot="act2"></span></div>
|
| 126 |
+
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 127 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
| 128 |
|
| 129 |
+
<div id="km-classic" hidden>
|
| 130 |
+
<div class="km-section-label">A named operation from a real transformer</div>
|
| 131 |
+
<div class="km-pick" id="km-classics"></div>
|
| 132 |
+
</div>
|
| 133 |
+
|
| 134 |
+
<div id="km-info"></div>
|
| 135 |
+
|
| 136 |
+
<div class="km-params">
|
| 137 |
+
<div class="km-field">
|
| 138 |
+
<label>Attempts the model drafts <b id="km-tries-v">4</b></label>
|
| 139 |
+
<div class="km-stepper" id="km-tries"></div>
|
| 140 |
+
</div>
|
| 141 |
+
<div class="km-field">
|
| 142 |
+
<label>Sampling temperature <b id="km-temp-v">0.70</b></label>
|
| 143 |
+
<input type="range" class="km-range" id="km-temp" min="20" max="130" value="70">
|
| 144 |
+
</div>
|
| 145 |
+
<div class="km-field">
|
| 146 |
+
<label>Name for the leaderboard</label>
|
| 147 |
+
<input class="km-input" id="km-name" placeholder="optional" autocomplete="off">
|
| 148 |
+
</div>
|
| 149 |
+
<label class="km-toggle"><input type="checkbox" id="km-pro"><span class="km-switch"></span>Use the 27B model (slower, knows more)</label>
|
| 150 |
+
</div>
|
| 151 |
+
|
| 152 |
+
<div class="km-actions">
|
| 153 |
+
<button class="km-btn primary" id="km-build">Mint kernel</button>
|
| 154 |
+
<button class="km-btn ghost" id="km-replay" data-replay-key="rmsnorm_gelu">Watch a recorded mint</button>
|
| 155 |
+
</div>
|
| 156 |
+
<div id="km-replay-picks" class="km-replay-picks" aria-label="recorded mints"></div>
|
| 157 |
+
</section>
|
| 158 |
+
|
| 159 |
+
<section class="km-card">
|
| 160 |
+
<div class="km-section-label">The operation, stage by stage</div>
|
| 161 |
+
<div id="km-viz"><svg id="km-svg" viewBox="0 0 320 150" preserveAspectRatio="none"></svg>
|
| 162 |
+
<div id="km-stage-label">input</div></div>
|
| 163 |
+
<div id="km-verdict"><div class="km-card"><div class="km-result-top"><div class="km-verdict-icon">→</div>
|
| 164 |
+
<div><span class="km-run-label">ready</span><b>Press Mint to begin</b></div></div>
|
| 165 |
+
<p class="km-dim" style="margin-top:10px">Compose a pipeline on the left and mint it, or watch a recorded verified mint to see the whole referee loop instantly.</p></div></div>
|
| 166 |
+
<details id="km-source" class="km-source" hidden>
|
| 167 |
+
<summary>Triton kernel source</summary>
|
| 168 |
+
<pre id="km-code"></pre>
|
| 169 |
+
</details>
|
| 170 |
+
<div class="km-section-label">This session</div>
|
| 171 |
+
<div id="km-hist" class="km-dim">No mints yet.</div>
|
| 172 |
+
</section>
|
| 173 |
+
</div>
|
| 174 |
</div>
|
| 175 |
|
| 176 |
+
<!-- ============ EXPERT ============ -->
|
| 177 |
+
<div class="km-page" data-page="expert" hidden>
|
| 178 |
+
<header id="km-hero">
|
| 179 |
+
<h1>Free-test the verifier.</h1>
|
| 180 |
+
<p>Describe the fused operation you want in plain language. The model writes a Triton kernel and the referee certifies it against PyTorch and times it against torch.compile. The referee can only certify operations it has a reference for, so your request is resolved to the nearest one it can check.</p>
|
| 181 |
+
</header>
|
| 182 |
+
<div class="km-expert-grid">
|
| 183 |
+
<section class="km-card">
|
| 184 |
+
<div class="km-section-label">Your brief</div>
|
| 185 |
+
<textarea class="km-textarea" id="km-xbrief" placeholder="e.g. fused RMSNorm with a residual add and a SiLU activation, contiguous rows"></textarea>
|
| 186 |
+
<div id="km-xresolved" class="km-resolved"><span class="k">resolves to</span><div class="v">rmsnorm with gelu</div></div>
|
| 187 |
+
<div class="km-params">
|
| 188 |
+
<div class="km-field">
|
| 189 |
+
<label>Attempts the model drafts <b id="km-xtries-v">5</b></label>
|
| 190 |
+
<div class="km-stepper" id="km-xtries"></div>
|
| 191 |
+
</div>
|
| 192 |
+
<div class="km-field">
|
| 193 |
+
<label>Sampling temperature <b id="km-xtemp-v">0.70</b></label>
|
| 194 |
+
<input type="range" class="km-range" id="km-xtemp" min="20" max="130" value="70">
|
| 195 |
+
</div>
|
| 196 |
+
<label class="km-toggle"><input type="checkbox" id="km-xpro"><span class="km-switch"></span>Use the 27B model</label>
|
| 197 |
+
</div>
|
| 198 |
+
<div class="km-actions">
|
| 199 |
+
<button class="km-btn primary" id="km-xbuild">Mint from brief</button>
|
| 200 |
+
</div>
|
| 201 |
+
</section>
|
| 202 |
+
<section class="km-card">
|
| 203 |
+
<div class="km-section-label">What the referee can verify</div>
|
| 204 |
+
<p class="km-limits">It certifies fusions of a <b>normalization</b> (RMSNorm or LayerNorm), an optional <b>residual add</b>, and one or two <b>activations</b>, plus a set of named operators from real transformers. Click one to load it into your brief.</p>
|
| 205 |
+
<div class="km-oplist" id="km-oplist"></div>
|
| 206 |
+
<div id="km-xverdict" style="margin-top:16px"></div>
|
| 207 |
+
<details id="km-xsource" class="km-source" hidden>
|
| 208 |
+
<summary>Triton kernel source</summary>
|
| 209 |
+
<pre class="km-code"></pre>
|
| 210 |
+
</details>
|
| 211 |
+
</section>
|
| 212 |
</div>
|
| 213 |
</div>
|
| 214 |
|
| 215 |
+
<!-- ============ LEADERBOARD ============ -->
|
| 216 |
+
<div class="km-page" data-page="lb" hidden>
|
| 217 |
+
<section class="km-card">
|
| 218 |
+
<div class="km-h">Leaderboard</div>
|
| 219 |
+
<p class="km-lede">The best verified kernel per operation. Crowned rows were minted by the 27B model. Every speedup here was measured by the referee, not reported by the model.</p>
|
| 220 |
+
<div id="km-lb-view" class="km-dim" style="margin-top:16px">Loading.</div>
|
| 221 |
+
<button id="km-lb-refresh" class="km-mini">Refresh</button>
|
| 222 |
+
</section>
|
| 223 |
+
</div>
|
| 224 |
+
|
| 225 |
+
<!-- ============ RUN LOCALLY / DOCS ============ -->
|
| 226 |
+
<div class="km-page" data-page="docs" hidden>
|
| 227 |
+
<section class="km-card km-docs">
|
| 228 |
+
<h2>What this is</h2>
|
| 229 |
+
<p>A GPU kernel is the small program that runs one step of a neural network on the graphics card. Fusing several steps into one kernel cuts trips to memory, which is where a lot of real inference speed comes from. Here, a 1-billion-parameter model writes those kernels, and an immutable referee decides whether each one is real.</p>
|
| 230 |
+
<p>The bet behind the project: the scarce thing is not the big model, it is a verifier the model cannot fool. Correctness is a yes or no, speed is a measurement, and the model learns from its own verified wins.</p>
|
| 231 |
+
|
| 232 |
+
<h2>The referee</h2>
|
| 233 |
+
<p>For every kernel the referee compiles it, checks it gives the same answers as PyTorch on adversarial inputs (odd shapes, large magnitudes, low precision), times it against <b>torch.compile</b> max-autotune, and blocks three specific ways of gaming the benchmark. A green result is earned, not asserted.</p>
|
| 234 |
+
|
| 235 |
+
<h2>Run it locally</h2>
|
| 236 |
+
<p>The 1B smith is published and small enough to run on a modest GPU. Install the libraries, load the adapter on its base model, and prompt it for a kernel.</p>
|
| 237 |
+
<div class="km-codeblock"><button class="km-copy">Copy</button>pip install torch transformers peft triton</div>
|
| 238 |
+
<div class="km-codeblock"><button class="km-copy">Copy</button>from transformers import AutoModelForCausalLM, AutoTokenizer
|
| 239 |
+
from peft import PeftModel
|
| 240 |
+
|
| 241 |
+
base = AutoModelForCausalLM.from_pretrained(
|
| 242 |
+
"openbmb/MiniCPM5-1B", trust_remote_code=True, device_map="cuda")
|
| 243 |
+
model = PeftModel.from_pretrained(
|
| 244 |
+
base, "YMRohit/ouroboros-kernelsmith-minicpm5-1b")
|
| 245 |
+
tok = AutoTokenizer.from_pretrained(
|
| 246 |
+
"openbmb/MiniCPM5-1B", trust_remote_code=True)</div>
|
| 247 |
+
|
| 248 |
+
<h2>How to prompt the model</h2>
|
| 249 |
+
<p>The model was trained to answer a short request for one fused operation and return a single Triton kernel with a <code>run(...)</code> entry point. Keep the request to one operation, name the pieces (normalization, residual, activation), and ask for the kernel only.</p>
|
| 250 |
+
<div class="km-codeblock"><button class="km-copy">Copy</button>Write a fused Triton kernel for: RMSNorm followed by a GELU
|
| 251 |
+
activation, with a residual add of the input. One @triton.jit
|
| 252 |
+
kernel plus a run(x, residual, weight) entry point. Triton only.</div>
|
| 253 |
+
<p>Always run whatever it writes through a verifier before trusting it. That is the entire point of the project, and the referee in this app is one you can reuse.</p>
|
| 254 |
+
|
| 255 |
+
<h2>What it can and cannot verify</h2>
|
| 256 |
+
<p>The referee needs a PyTorch reference to check against, so it certifies a fixed space of operations: a normalization (RMSNorm or LayerNorm), an optional residual add, and one or two activations, plus a set of named operators from real transformers. Anything outside that space cannot be certified here, by design.</p>
|
| 257 |
+
<div id="km-docs-ops" class="km-oplist"></div>
|
| 258 |
+
|
| 259 |
+
<h2>The pieces</h2>
|
| 260 |
<div id="km-learn-blocks"></div>
|
| 261 |
+
|
| 262 |
+
<h2>License and source</h2>
|
| 263 |
+
<p>MIT licensed. The models are <a href="https://huggingface.co/YMRohit/ouroboros-kernelsmith-minicpm5-1b" style="color:var(--accent)">MiniCPM5-1B</a> and <a href="https://huggingface.co/YMRohit/ouroboros-kernelsmith-qwen3.6-27b" style="color:var(--accent)">Qwen3.6-27B</a> (both Apache-2.0). The verified kernels and evidence reports are in the <a href="https://huggingface.co/datasets/YMRohit/ouroboros-kernel-corpus" style="color:var(--accent)">corpus</a>.</p>
|
| 264 |
+
</section>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 265 |
</div>
|
| 266 |
</div>
|
| 267 |
"""
|
style.css
CHANGED
|
@@ -1,190 +1,380 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
| 22 |
-
|
| 23 |
-
|
| 24 |
-
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
| 34 |
-
.
|
| 35 |
-
.
|
| 36 |
-
|
| 37 |
-
.
|
| 38 |
-
|
| 39 |
-
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
.km-
|
| 53 |
-
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
#km-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
| 68 |
-
|
| 69 |
-
|
| 70 |
-
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
-
.km-
|
| 76 |
-
|
| 77 |
-
|
| 78 |
-
|
| 79 |
-
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
.km-
|
| 83 |
-
|
| 84 |
-
|
| 85 |
-
|
| 86 |
-
|
| 87 |
-
|
| 88 |
-
|
| 89 |
-
|
| 90 |
-
|
| 91 |
-
.km-
|
| 92 |
-
.km-
|
| 93 |
-
@
|
| 94 |
-
|
| 95 |
-
|
| 96 |
-
|
| 97 |
-
|
| 98 |
-
|
| 99 |
-
|
| 100 |
-
|
| 101 |
-
.km-
|
| 102 |
-
|
| 103 |
-
.km-
|
| 104 |
-
.km-
|
| 105 |
-
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
|
| 109 |
-
|
| 110 |
-
|
| 111 |
-
|
| 112 |
-
|
| 113 |
-
.km-
|
| 114 |
-
|
| 115 |
-
.km-
|
| 116 |
-
|
| 117 |
-
|
| 118 |
-
|
| 119 |
-
|
| 120 |
-
.km-
|
| 121 |
-
|
| 122 |
-
|
| 123 |
-
.km-
|
| 124 |
-
.km-
|
| 125 |
-
|
| 126 |
-
.km-
|
| 127 |
-
|
| 128 |
-
|
| 129 |
-
.
|
| 130 |
-
|
| 131 |
-
.km-
|
| 132 |
-
.km-
|
| 133 |
-
|
| 134 |
-
|
| 135 |
-
|
| 136 |
-
|
| 137 |
-
|
| 138 |
-
|
| 139 |
-
|
| 140 |
-
|
| 141 |
-
|
| 142 |
-
|
| 143 |
-
|
| 144 |
-
|
| 145 |
-
.km-
|
| 146 |
-
.km-
|
| 147 |
-
|
| 148 |
-
|
| 149 |
-
|
| 150 |
-
.km-
|
| 151 |
-
|
| 152 |
-
.km-
|
| 153 |
-
|
| 154 |
-
.km-
|
| 155 |
-
.km-
|
| 156 |
-
.km-
|
| 157 |
-
|
| 158 |
-
|
| 159 |
-
|
| 160 |
-
|
| 161 |
-
|
| 162 |
-
|
| 163 |
-
/*
|
| 164 |
-
|
| 165 |
-
.km-
|
| 166 |
-
.km-
|
| 167 |
-
|
| 168 |
-
.km-
|
| 169 |
-
.km-
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
| 174 |
-
.km-
|
| 175 |
-
.km-
|
| 176 |
-
.km-
|
| 177 |
-
|
| 178 |
-
.km-
|
| 179 |
-
|
| 180 |
-
.km-
|
| 181 |
-
|
| 182 |
-
|
| 183 |
-
.km-
|
| 184 |
-
.km-
|
| 185 |
-
|
| 186 |
-
|
| 187 |
-
|
| 188 |
-
|
| 189 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 190 |
}
|
|
|
|
| 1 |
+
/* OUROBOROS Kernel Mint — design system
|
| 2 |
+
Apple-minimal: SF system type, one emerald accent on layered near-black, hairlines,
|
| 3 |
+
restrained motion. No emoji, no em-dashes, one accent, one radius scale. */
|
| 4 |
+
|
| 5 |
+
:root {
|
| 6 |
+
--bg: #0b0c0e;
|
| 7 |
+
--surface: #131519;
|
| 8 |
+
--surface-2: #181b20;
|
| 9 |
+
--surface-3: #1e2227;
|
| 10 |
+
--line: rgba(255,255,255,0.07);
|
| 11 |
+
--line-2: rgba(255,255,255,0.12);
|
| 12 |
+
--text: #f4f6f7;
|
| 13 |
+
--muted: #9aa1ab;
|
| 14 |
+
--faint: #686f79;
|
| 15 |
+
--accent: #34e0a1;
|
| 16 |
+
--accent-deep: #10b981;
|
| 17 |
+
--accent-ink: #052b1e;
|
| 18 |
+
--accent-soft: rgba(52,224,161,0.12);
|
| 19 |
+
--accent-line: rgba(52,224,161,0.32);
|
| 20 |
+
--danger: #ff7a7a;
|
| 21 |
+
--danger-soft: rgba(255,122,122,0.10);
|
| 22 |
+
--amber: #f1c47a;
|
| 23 |
+
--r: 14px;
|
| 24 |
+
--r-sm: 10px;
|
| 25 |
+
--r-pill: 980px;
|
| 26 |
+
--sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Segoe UI", system-ui, sans-serif;
|
| 27 |
+
--mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, monospace;
|
| 28 |
+
--ease: cubic-bezier(0.16, 1, 0.3, 1);
|
| 29 |
+
--shadow: 0 1px 0 rgba(255,255,255,0.04) inset, 0 12px 40px rgba(0,0,0,0.42);
|
| 30 |
+
--shadow-sm: 0 1px 0 rgba(255,255,255,0.04) inset, 0 4px 16px rgba(0,0,0,0.30);
|
| 31 |
+
}
|
| 32 |
+
|
| 33 |
+
/* Gradio host: let our surface own the page */
|
| 34 |
+
.gradio-container, .gradio-container * { font-family: var(--sans); }
|
| 35 |
+
.gradio-container { max-width: 100% !important; padding: 0 !important; background: var(--bg) !important; }
|
| 36 |
+
gradio-app { background: var(--bg); }
|
| 37 |
+
footer, .footer, #footer { display: none !important; }
|
| 38 |
+
/* hide the python bridge components but keep them in the DOM */
|
| 39 |
+
#km_recipe, #km_result, #km_lb, #km_go { position: absolute !important; width: 1px; height: 1px;
|
| 40 |
+
overflow: hidden; clip: rect(0 0 0 0); opacity: 0; pointer-events: none; }
|
| 41 |
+
|
| 42 |
+
#km {
|
| 43 |
+
--pad: clamp(16px, 4vw, 40px);
|
| 44 |
+
color: var(--text); background: var(--bg);
|
| 45 |
+
font: 15px/1.55 var(--sans); letter-spacing: -0.01em;
|
| 46 |
+
max-width: 1180px; margin: 0 auto; padding: 0 var(--pad) 64px;
|
| 47 |
+
-webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
|
| 48 |
+
}
|
| 49 |
+
#km *, #km *::before, #km *::after { box-sizing: border-box; }
|
| 50 |
+
#km h1, #km h2, #km h3 { margin: 0; font-weight: 600; letter-spacing: -0.025em; }
|
| 51 |
+
#km p { margin: 0; }
|
| 52 |
+
#km code, #km .mono, #km .num { font-family: var(--mono); font-variant-numeric: tabular-nums; }
|
| 53 |
+
|
| 54 |
+
/* ---------- top bar ---------- */
|
| 55 |
+
#km-top {
|
| 56 |
+
display: flex; align-items: center; justify-content: space-between; gap: 20px;
|
| 57 |
+
padding: 22px 0 18px; flex-wrap: wrap;
|
| 58 |
+
}
|
| 59 |
+
#km-brand { display: flex; align-items: baseline; gap: 12px; min-width: 0; }
|
| 60 |
+
#km-brand .mark {
|
| 61 |
+
font-size: 19px; font-weight: 600; letter-spacing: -0.03em; color: var(--text);
|
| 62 |
+
display: inline-flex; align-items: center; gap: 9px;
|
| 63 |
+
}
|
| 64 |
+
#km-brand .dot {
|
| 65 |
+
width: 9px; height: 9px; border-radius: 50%; background: var(--accent);
|
| 66 |
+
box-shadow: 0 0 0 4px var(--accent-soft); flex: none;
|
| 67 |
+
}
|
| 68 |
+
#km-brand .sub { color: var(--faint); font-size: 13px; letter-spacing: -0.01em; }
|
| 69 |
+
|
| 70 |
+
/* segmented tab control (Apple style) */
|
| 71 |
+
#km-tabs {
|
| 72 |
+
display: inline-flex; gap: 2px; padding: 4px; border-radius: var(--r-pill);
|
| 73 |
+
background: var(--surface); border: 1px solid var(--line); position: relative;
|
| 74 |
+
}
|
| 75 |
+
.km-tab {
|
| 76 |
+
appearance: none; border: 0; background: transparent; color: var(--muted);
|
| 77 |
+
font: 500 13.5px/1 var(--sans); letter-spacing: -0.01em; cursor: pointer;
|
| 78 |
+
padding: 9px 16px; border-radius: var(--r-pill); position: relative; z-index: 1;
|
| 79 |
+
transition: color 0.25s var(--ease);
|
| 80 |
+
}
|
| 81 |
+
.km-tab:hover { color: var(--text); }
|
| 82 |
+
.km-tab.on { color: var(--text); }
|
| 83 |
+
#km-tab-pill {
|
| 84 |
+
position: absolute; top: 4px; left: 4px; height: calc(100% - 8px);
|
| 85 |
+
background: var(--surface-3); border: 1px solid var(--line-2); border-radius: var(--r-pill);
|
| 86 |
+
box-shadow: var(--shadow-sm); transition: transform 0.34s var(--ease), width 0.34s var(--ease);
|
| 87 |
+
z-index: 0;
|
| 88 |
+
}
|
| 89 |
+
|
| 90 |
+
/* ---------- page + layout ---------- */
|
| 91 |
+
.km-page[hidden] { display: none; }
|
| 92 |
+
.km-page { animation: km-fade 0.4s var(--ease); }
|
| 93 |
+
@keyframes km-fade { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
|
| 94 |
+
#km-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,1fr); gap: 18px; }
|
| 95 |
+
@media (max-width: 880px) { #km-grid { grid-template-columns: 1fr; } }
|
| 96 |
+
|
| 97 |
+
.km-card {
|
| 98 |
+
background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
|
| 99 |
+
padding: 22px; box-shadow: var(--shadow-sm);
|
| 100 |
+
}
|
| 101 |
+
.km-eyebrow { font-size: 12px; font-weight: 600; color: var(--faint); letter-spacing: 0.02em;
|
| 102 |
+
margin-bottom: 14px; }
|
| 103 |
+
.km-h { font-size: 21px; font-weight: 600; letter-spacing: -0.03em; margin-bottom: 6px; }
|
| 104 |
+
.km-lede { color: var(--muted); font-size: 14px; max-width: 64ch; }
|
| 105 |
+
|
| 106 |
+
/* ---------- intro / hero strip ---------- */
|
| 107 |
+
#km-hero { padding: 8px 0 26px; max-width: 70ch; }
|
| 108 |
+
#km-hero h1 { font-size: clamp(28px, 5vw, 42px); font-weight: 600; letter-spacing: -0.035em; line-height: 1.05; }
|
| 109 |
+
#km-hero h1 .g { color: var(--accent); }
|
| 110 |
+
#km-hero p { color: var(--muted); font-size: clamp(15px, 2vw, 17px); margin-top: 14px; max-width: 60ch; }
|
| 111 |
+
|
| 112 |
+
/* ---------- segmented (compose/classics, model) ---------- */
|
| 113 |
+
.km-seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--surface-2);
|
| 114 |
+
border: 1px solid var(--line); border-radius: var(--r-sm); }
|
| 115 |
+
.km-seg button {
|
| 116 |
+
appearance: none; border: 0; background: transparent; color: var(--muted);
|
| 117 |
+
font: 500 13px/1 var(--sans); cursor: pointer; padding: 8px 13px; border-radius: 7px;
|
| 118 |
+
transition: background 0.2s var(--ease), color 0.2s var(--ease);
|
| 119 |
+
}
|
| 120 |
+
.km-seg button.on { background: var(--surface-3); color: var(--text); box-shadow: var(--shadow-sm); }
|
| 121 |
+
|
| 122 |
+
/* ---------- the pipeline composer ---------- */
|
| 123 |
+
.km-section-label { font-size: 12.5px; font-weight: 600; color: var(--faint); margin: 22px 0 10px; }
|
| 124 |
+
.km-section-label:first-child { margin-top: 4px; }
|
| 125 |
+
#km-pipe { display: flex; flex-direction: column; gap: 0; }
|
| 126 |
+
.km-stage {
|
| 127 |
+
display: flex; align-items: center; gap: 12px; padding: 13px 15px;
|
| 128 |
+
background: var(--surface-2); border: 1px solid var(--line); border-radius: var(--r-sm);
|
| 129 |
+
transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
|
| 130 |
+
}
|
| 131 |
+
.km-stage + .km-stage { margin-top: 8px; }
|
| 132 |
+
.km-stage .km-stage-k { font-size: 11px; color: var(--faint); width: 64px; flex: none; font-weight: 600; }
|
| 133 |
+
.km-stage.fixed { background: transparent; border-style: dashed; }
|
| 134 |
+
.km-stage .km-pick {
|
| 135 |
+
flex: 1; display: flex; gap: 6px; flex-wrap: wrap;
|
| 136 |
+
}
|
| 137 |
+
.km-opt {
|
| 138 |
+
appearance: none; border: 1px solid var(--line); background: var(--surface-3); color: var(--muted);
|
| 139 |
+
font: 500 13px/1 var(--sans); cursor: pointer; padding: 8px 12px; border-radius: var(--r-pill);
|
| 140 |
+
transition: all 0.18s var(--ease); white-space: nowrap;
|
| 141 |
+
}
|
| 142 |
+
.km-opt:hover { color: var(--text); border-color: var(--line-2); transform: translateY(-1px); }
|
| 143 |
+
.km-opt.on { background: var(--accent-soft); border-color: var(--accent-line); color: var(--accent); }
|
| 144 |
+
.km-opt.off { opacity: 0.5; }
|
| 145 |
+
.km-flow { color: var(--faint); text-align: center; font-size: 13px; line-height: 1; margin: 6px 0; }
|
| 146 |
+
.km-toggle {
|
| 147 |
+
display: inline-flex; align-items: center; gap: 9px; cursor: pointer; user-select: none;
|
| 148 |
+
font-size: 13px; color: var(--muted);
|
| 149 |
+
}
|
| 150 |
+
.km-switch { width: 38px; height: 22px; border-radius: var(--r-pill); background: var(--surface-3);
|
| 151 |
+
border: 1px solid var(--line-2); position: relative; transition: background 0.24s var(--ease); flex: none; }
|
| 152 |
+
.km-switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px;
|
| 153 |
+
border-radius: 50%; background: #c9ced6; transition: transform 0.24s var(--ease); }
|
| 154 |
+
.km-toggle input { position: absolute; opacity: 0; }
|
| 155 |
+
.km-toggle input:checked + .km-switch { background: var(--accent-deep); border-color: transparent; }
|
| 156 |
+
.km-toggle input:checked + .km-switch::after { transform: translateX(16px); background: #fff; }
|
| 157 |
+
|
| 158 |
+
/* info / knowledge line */
|
| 159 |
+
#km-info, #km-xinfo { margin-top: 16px; padding: 13px 15px; border-radius: var(--r-sm);
|
| 160 |
+
background: var(--surface-2); border: 1px solid var(--line); color: var(--muted);
|
| 161 |
+
font-size: 13px; line-height: 1.5; min-height: 44px; }
|
| 162 |
+
|
| 163 |
+
/* parameters */
|
| 164 |
+
.km-params { margin-top: 18px; display: grid; gap: 14px; }
|
| 165 |
+
.km-field { display: flex; flex-direction: column; gap: 7px; }
|
| 166 |
+
.km-field > label { font-size: 12.5px; color: var(--faint); font-weight: 600; display: flex;
|
| 167 |
+
justify-content: space-between; align-items: center; }
|
| 168 |
+
.km-field > label b { color: var(--text); font-family: var(--mono); font-size: 12.5px; }
|
| 169 |
+
.km-input, .km-textarea {
|
| 170 |
+
appearance: none; width: 100%; background: var(--surface-2); border: 1px solid var(--line);
|
| 171 |
+
border-radius: var(--r-sm); color: var(--text); font: 14px/1.5 var(--sans); padding: 11px 13px;
|
| 172 |
+
transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
|
| 173 |
+
}
|
| 174 |
+
.km-textarea { font-family: var(--mono); font-size: 13px; resize: vertical; min-height: 96px; }
|
| 175 |
+
.km-input::placeholder, .km-textarea::placeholder { color: var(--faint); }
|
| 176 |
+
.km-input:focus, .km-textarea:focus { outline: none; border-color: var(--accent-line);
|
| 177 |
+
box-shadow: 0 0 0 3px var(--accent-soft); }
|
| 178 |
+
input[type=range].km-range { -webkit-appearance: none; appearance: none; width: 100%; height: 4px;
|
| 179 |
+
border-radius: 4px; background: var(--surface-3); outline: none; }
|
| 180 |
+
input[type=range].km-range::-webkit-slider-thumb { -webkit-appearance: none; width: 16px; height: 16px;
|
| 181 |
+
border-radius: 50%; background: var(--text); cursor: pointer; border: 0;
|
| 182 |
+
box-shadow: 0 1px 4px rgba(0,0,0,0.4); transition: transform 0.15s var(--ease); }
|
| 183 |
+
input[type=range].km-range::-webkit-slider-thumb:active { transform: scale(1.15); }
|
| 184 |
+
input[type=range].km-range::-moz-range-thumb { width: 16px; height: 16px; border-radius: 50%;
|
| 185 |
+
background: var(--text); cursor: pointer; border: 0; }
|
| 186 |
+
|
| 187 |
+
/* segmented stepper for attempts */
|
| 188 |
+
.km-stepper { display: inline-flex; gap: 2px; padding: 3px; background: var(--surface-2);
|
| 189 |
+
border: 1px solid var(--line); border-radius: var(--r-sm); }
|
| 190 |
+
.km-stepper button { appearance: none; border: 0; background: transparent; color: var(--muted);
|
| 191 |
+
font: 500 13px var(--mono); cursor: pointer; width: 30px; height: 30px; border-radius: 7px;
|
| 192 |
+
transition: all 0.16s var(--ease); }
|
| 193 |
+
.km-stepper button.on { background: var(--accent-soft); color: var(--accent); }
|
| 194 |
+
.km-stepper button:hover:not(.on) { color: var(--text); }
|
| 195 |
+
|
| 196 |
+
/* ---------- buttons ---------- */
|
| 197 |
+
.km-actions { display: flex; gap: 10px; margin-top: 22px; flex-wrap: wrap; }
|
| 198 |
+
.km-btn {
|
| 199 |
+
appearance: none; border: 1px solid var(--line-2); background: var(--surface-3); color: var(--text);
|
| 200 |
+
font: 600 14px/1 var(--sans); letter-spacing: -0.01em; cursor: pointer; padding: 13px 18px;
|
| 201 |
+
border-radius: var(--r-sm); transition: transform 0.16s var(--ease), background 0.2s var(--ease), border-color 0.2s var(--ease);
|
| 202 |
+
display: inline-flex; align-items: center; gap: 8px;
|
| 203 |
+
}
|
| 204 |
+
.km-btn:hover { border-color: var(--line-2); transform: translateY(-1px); }
|
| 205 |
+
.km-btn:active { transform: scale(0.985); }
|
| 206 |
+
.km-btn.primary {
|
| 207 |
+
background: linear-gradient(180deg, var(--accent), var(--accent-deep)); color: var(--accent-ink);
|
| 208 |
+
border-color: transparent; flex: 1; justify-content: center; min-width: 180px;
|
| 209 |
+
box-shadow: 0 1px 0 rgba(255,255,255,0.18) inset, 0 8px 24px rgba(16,185,129,0.22);
|
| 210 |
+
}
|
| 211 |
+
.km-btn.primary:hover { filter: brightness(1.04); }
|
| 212 |
+
.km-btn.ghost { background: transparent; }
|
| 213 |
+
.km-btn .ic { width: 15px; height: 15px; stroke: currentColor; fill: none; stroke-width: 1.8; }
|
| 214 |
+
|
| 215 |
+
/* ---------- visualisation ---------- */
|
| 216 |
+
#km-viz { position: relative; background: var(--surface-2); border: 1px solid var(--line);
|
| 217 |
+
border-radius: var(--r-sm); height: 168px; overflow: hidden; margin-bottom: 14px; }
|
| 218 |
+
#km-svg { width: 100%; height: 100%; display: block; }
|
| 219 |
+
#km-stage-label { position: absolute; left: 14px; bottom: 12px; font-size: 12px; color: var(--muted);
|
| 220 |
+
font-family: var(--mono); letter-spacing: -0.01em; }
|
| 221 |
+
|
| 222 |
+
/* ---------- verdict / result ---------- */
|
| 223 |
+
#km-verdict .km-card, .km-result-card { padding: 20px; }
|
| 224 |
+
.km-card.ok { border-color: var(--accent-line); background:
|
| 225 |
+
radial-gradient(120% 130% at 0% 0%, rgba(52,224,161,0.07), transparent 60%), var(--surface); }
|
| 226 |
+
.km-card.err, .km-card.miss { border-color: rgba(255,122,122,0.28); }
|
| 227 |
+
.km-card.building, .km-card.replaying { border-color: var(--accent-line); }
|
| 228 |
+
.km-result-top { display: flex; align-items: flex-start; gap: 13px; margin-bottom: 4px; }
|
| 229 |
+
.km-verdict-icon { width: 34px; height: 34px; border-radius: 9px; flex: none; display: grid;
|
| 230 |
+
place-items: center; background: var(--accent-soft); color: var(--accent); font-size: 17px;
|
| 231 |
+
border: 1px solid var(--accent-line); }
|
| 232 |
+
.km-verdict-icon.bad { background: var(--danger-soft); color: var(--danger); border-color: rgba(255,122,122,0.28); }
|
| 233 |
+
.km-run-label { display: block; font-size: 11px; color: var(--faint); font-weight: 600;
|
| 234 |
+
letter-spacing: 0.02em; text-transform: uppercase; margin-bottom: 2px; }
|
| 235 |
+
.km-result-top b { font-size: 16px; font-weight: 600; letter-spacing: -0.02em; }
|
| 236 |
+
.km-result-top > div > span:last-child { display: block; color: var(--muted); font-size: 13px;
|
| 237 |
+
font-family: var(--mono); margin-top: 2px; }
|
| 238 |
+
.km-speed-hero { text-align: center; padding: 22px 0 16px; border: 1px solid var(--line);
|
| 239 |
+
border-radius: var(--r-sm); background: var(--surface-2); margin: 16px 0; }
|
| 240 |
+
.km-speed-hero big { display: block; font: 600 52px/1 var(--mono); letter-spacing: -0.04em;
|
| 241 |
+
font-variant-numeric: tabular-nums; color: var(--text); }
|
| 242 |
+
.km-speed-hero span { display: block; font-size: 11.5px; color: var(--faint); font-weight: 600;
|
| 243 |
+
letter-spacing: 0.04em; text-transform: uppercase; margin-top: 8px; }
|
| 244 |
+
.km-ref-summary { font-size: 13.5px; color: var(--muted); margin: 4px 0 10px; }
|
| 245 |
+
.km-ref-summary b { color: var(--text); font-family: var(--mono); }
|
| 246 |
+
.km-attempts { display: flex; flex-wrap: wrap; gap: 6px; margin: 4px 0 2px; }
|
| 247 |
+
.km-attempt { display: inline-flex; align-items: center; gap: 5px; font-size: 12px;
|
| 248 |
+
font-family: var(--mono); padding: 5px 10px; border-radius: var(--r-pill); border: 1px solid var(--line);
|
| 249 |
+
background: var(--surface-2); color: var(--muted); }
|
| 250 |
+
.km-attempt.ok { color: var(--accent); border-color: var(--accent-line); background: var(--accent-soft); }
|
| 251 |
+
.km-attempt.bad { color: var(--danger); border-color: rgba(255,122,122,0.24); background: var(--danger-soft); }
|
| 252 |
+
.km-stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 14px 0 4px; }
|
| 253 |
+
.km-stats > div { border: 1px solid var(--line); border-radius: var(--r-sm); padding: 13px;
|
| 254 |
+
background: var(--surface-2); text-align: center; }
|
| 255 |
+
.km-stats big { display: block; font: 600 26px/1 var(--mono); letter-spacing: -0.03em; color: var(--text);
|
| 256 |
+
font-variant-numeric: tabular-nums; }
|
| 257 |
+
.km-stats span { display: block; color: var(--faint); font-size: 11px; margin-top: 6px; }
|
| 258 |
+
.km-dim { color: var(--muted); font-size: 13px; line-height: 1.5; }
|
| 259 |
+
.km-rawerr { color: var(--faint); font-size: 12px; font-family: var(--mono); margin-top: 10px;
|
| 260 |
+
word-break: break-word; }
|
| 261 |
+
.km-pill-note { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 5px 11px;
|
| 262 |
+
border-radius: var(--r-pill); margin-bottom: 12px; letter-spacing: -0.01em; }
|
| 263 |
+
.km-pill-note.recorded { background: var(--surface-3); color: var(--muted); border: 1px solid var(--line); }
|
| 264 |
+
.km-pill-note.hit { background: var(--accent-soft); color: var(--accent); border: 1px solid var(--accent-line); }
|
| 265 |
+
.km-pill-note.miss { background: var(--danger-soft); color: var(--danger); border: 1px solid rgba(255,122,122,0.24); }
|
| 266 |
+
.km-crown { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 5px 11px; margin-bottom: 12px;
|
| 267 |
+
border-radius: var(--r-pill); background: rgba(241,196,122,0.12); color: var(--amber);
|
| 268 |
+
border: 1px solid rgba(241,196,122,0.28); margin-left: 8px; }
|
| 269 |
+
.km-board { display: inline-block; font-size: 11.5px; font-weight: 600; padding: 5px 11px; margin-bottom: 12px;
|
| 270 |
+
border-radius: var(--r-pill); background: var(--accent-soft); color: var(--accent);
|
| 271 |
+
border: 1px solid var(--accent-line); margin-left: 8px; }
|
| 272 |
+
|
| 273 |
+
/* build progress */
|
| 274 |
+
.km-build-steps { display: grid; gap: 6px; margin: 14px 0; }
|
| 275 |
+
.km-build-steps span { font-family: var(--mono); font-size: 12px; color: var(--faint);
|
| 276 |
+
padding: 8px 11px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface-2);
|
| 277 |
+
transition: all 0.25s var(--ease); }
|
| 278 |
+
.km-build-steps span.on { color: var(--text); border-color: var(--accent-line); background: var(--accent-soft); }
|
| 279 |
+
.km-build-steps span.done { color: var(--accent); }
|
| 280 |
+
.km-bar { height: 5px; border-radius: 4px; background: var(--surface-3); overflow: hidden; margin: 13px 0; }
|
| 281 |
+
.km-bar i { display: block; height: 100%; width: 6%; border-radius: 4px;
|
| 282 |
+
background: linear-gradient(90deg, var(--accent-deep), var(--accent)); transition: width 0.5s var(--ease); }
|
| 283 |
+
.km-bstage { font-size: 14px; font-weight: 600; }
|
| 284 |
+
.km-replay-stage { font-size: 13px; color: var(--text); font-weight: 600; margin: 8px 0 4px; }
|
| 285 |
+
|
| 286 |
+
/* kernel source */
|
| 287 |
+
.km-source { margin-top: 14px; border: 1px solid var(--line); border-radius: var(--r-sm);
|
| 288 |
+
background: #08090b; overflow: hidden; }
|
| 289 |
+
.km-source summary { cursor: pointer; padding: 12px 15px; font-size: 13px; font-weight: 600;
|
| 290 |
+
color: var(--text); list-style: none; display: flex; justify-content: space-between; align-items: center; }
|
| 291 |
+
.km-source summary::-webkit-details-marker { display: none; }
|
| 292 |
+
.km-source summary::after { content: "+"; color: var(--accent); font-family: var(--mono); }
|
| 293 |
+
.km-source[open] summary::after { content: "\2212"; }
|
| 294 |
+
#km-code, .km-code { margin: 0; border-top: 1px solid var(--line); padding: 14px; color: #b9e6d3;
|
| 295 |
+
font: 12px/1.6 var(--mono); overflow: auto; max-height: 320px; white-space: pre; }
|
| 296 |
+
|
| 297 |
+
/* history */
|
| 298 |
+
#km-hist .km-hrow { border: 1px solid var(--line); border-radius: 9px; padding: 9px 12px;
|
| 299 |
+
background: var(--surface-2); font-size: 13px; margin-bottom: 6px; color: var(--muted);
|
| 300 |
+
display: flex; justify-content: space-between; }
|
| 301 |
+
#km-hist code { color: var(--text); }
|
| 302 |
+
|
| 303 |
+
/* recorded replay callout */
|
| 304 |
+
.km-replay-callout { display: flex; align-items: center; justify-content: space-between; gap: 14px;
|
| 305 |
+
margin-top: 14px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--r-sm);
|
| 306 |
+
background: var(--surface-2); }
|
| 307 |
+
.km-replay-callout b { font-size: 13.5px; font-weight: 600; display: block; margin-bottom: 2px; }
|
| 308 |
+
.km-replay-callout span { color: var(--muted); font-size: 12.5px; }
|
| 309 |
+
.km-replay-picks { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
|
| 310 |
+
.km-rpick { appearance: none; border: 1px solid var(--line); background: var(--surface-2); color: var(--muted);
|
| 311 |
+
font: 500 12.5px var(--sans); cursor: pointer; padding: 8px 12px; border-radius: var(--r-pill);
|
| 312 |
+
transition: all 0.18s var(--ease); }
|
| 313 |
+
.km-rpick:hover { color: var(--text); border-color: var(--line-2); }
|
| 314 |
+
.km-rpick.on { border-color: var(--accent-line); color: var(--accent); background: var(--accent-soft); }
|
| 315 |
+
.km-rpick span { font-family: var(--mono); color: var(--accent); margin-left: 5px; }
|
| 316 |
+
.km-inline-replay { appearance: none; margin-top: 12px; background: var(--surface-3); border: 1px solid var(--line-2);
|
| 317 |
+
color: var(--text); font: 500 13px var(--sans); cursor: pointer; padding: 9px 14px; border-radius: var(--r-sm);
|
| 318 |
+
transition: all 0.18s var(--ease); }
|
| 319 |
+
.km-inline-replay:hover { border-color: var(--accent-line); color: var(--accent); }
|
| 320 |
+
|
| 321 |
+
/* ---------- expert mode ---------- */
|
| 322 |
+
.km-expert-grid { display: grid; grid-template-columns: minmax(0,1fr) minmax(0,0.9fr); gap: 18px; }
|
| 323 |
+
@media (max-width: 880px) { .km-expert-grid { grid-template-columns: 1fr; } }
|
| 324 |
+
.km-resolved { margin-top: 14px; padding: 13px 15px; border: 1px solid var(--line); border-radius: var(--r-sm);
|
| 325 |
+
background: var(--surface-2); font-size: 13px; }
|
| 326 |
+
.km-resolved .k { color: var(--faint); font-size: 11.5px; font-weight: 600; text-transform: uppercase;
|
| 327 |
+
letter-spacing: 0.03em; }
|
| 328 |
+
.km-resolved .v { color: var(--accent); font-family: var(--mono); font-size: 14px; margin-top: 4px; }
|
| 329 |
+
.km-resolved.unknown .v { color: var(--amber); }
|
| 330 |
+
.km-limits { font-size: 12.5px; color: var(--muted); line-height: 1.6; }
|
| 331 |
+
.km-limits b { color: var(--text); }
|
| 332 |
+
.km-oplist { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
|
| 333 |
+
.km-optag { font: 500 11.5px var(--mono); padding: 5px 9px; border-radius: 7px; background: var(--surface-2);
|
| 334 |
+
border: 1px solid var(--line); color: var(--muted); cursor: pointer; transition: all 0.16s var(--ease); }
|
| 335 |
+
.km-optag:hover { color: var(--accent); border-color: var(--accent-line); }
|
| 336 |
+
|
| 337 |
+
/* ---------- leaderboard ---------- */
|
| 338 |
+
.km-lbt { width: 100%; border-collapse: collapse; font-size: 13.5px; }
|
| 339 |
+
.km-lbt th { text-align: left; color: var(--faint); font-weight: 600; font-size: 11.5px;
|
| 340 |
+
text-transform: uppercase; letter-spacing: 0.04em; padding: 0 12px 12px; }
|
| 341 |
+
.km-lbt th:nth-child(4), .km-lbt td:nth-child(4), .km-lbt th:nth-child(5), .km-lbt td:nth-child(5) { text-align: right; }
|
| 342 |
+
.km-lbt td { padding: 12px; border-top: 1px solid var(--line); }
|
| 343 |
+
.km-lbt tbody tr { transition: background 0.15s var(--ease); }
|
| 344 |
+
.km-lbt tbody tr:hover { background: var(--surface-2); }
|
| 345 |
+
.km-lbt tr.champ td { background: rgba(241,196,122,0.05); }
|
| 346 |
+
.km-lbt code { color: var(--text); font-size: 12.5px; }
|
| 347 |
+
.km-lbt .hot { color: var(--accent); font-family: var(--mono); font-weight: 600; font-variant-numeric: tabular-nums; }
|
| 348 |
+
.km-lbt td:nth-child(5) { color: var(--muted); font-family: var(--mono); font-variant-numeric: tabular-nums; }
|
| 349 |
+
.km-rank { color: var(--faint); font-family: var(--mono); }
|
| 350 |
+
|
| 351 |
+
/* ---------- docs ---------- */
|
| 352 |
+
.km-docs { max-width: 760px; }
|
| 353 |
+
.km-docs h2 { font-size: 22px; margin: 34px 0 10px; letter-spacing: -0.03em; }
|
| 354 |
+
.km-docs h2:first-child { margin-top: 0; }
|
| 355 |
+
.km-docs p { color: var(--muted); font-size: 15px; line-height: 1.65; margin: 0 0 12px; max-width: 68ch; }
|
| 356 |
+
.km-docs b { color: var(--text); font-weight: 600; }
|
| 357 |
+
.km-docs ol, .km-docs ul { color: var(--muted); font-size: 15px; line-height: 1.65; padding-left: 20px; margin: 0 0 14px; }
|
| 358 |
+
.km-docs li { margin-bottom: 7px; }
|
| 359 |
+
.km-codeblock { background: #08090b; border: 1px solid var(--line); border-radius: var(--r-sm);
|
| 360 |
+
padding: 15px 16px; font: 12.5px/1.7 var(--mono); color: #b9e6d3; overflow: auto; margin: 0 0 16px;
|
| 361 |
+
white-space: pre; position: relative; }
|
| 362 |
+
.km-copy { position: absolute; top: 9px; right: 9px; appearance: none; border: 1px solid var(--line-2);
|
| 363 |
+
background: var(--surface-3); color: var(--muted); font: 500 11px var(--sans); cursor: pointer;
|
| 364 |
+
padding: 5px 9px; border-radius: 7px; transition: all 0.16s var(--ease); }
|
| 365 |
+
.km-copy:hover { color: var(--accent); border-color: var(--accent-line); }
|
| 366 |
+
.km-gloss { display: grid; grid-template-columns: 130px 1fr; gap: 10px; padding: 11px 0; border-top: 1px solid var(--line); }
|
| 367 |
+
.km-gloss b { color: var(--text); font-size: 13.5px; font-weight: 600; }
|
| 368 |
+
.km-gloss span { color: var(--muted); font-size: 13.5px; line-height: 1.55; }
|
| 369 |
+
.km-callout { border: 1px solid var(--accent-line); background: var(--accent-soft); border-radius: var(--r-sm);
|
| 370 |
+
padding: 14px 16px; font-size: 13.5px; color: var(--text); margin: 0 0 16px; }
|
| 371 |
+
|
| 372 |
+
/* ---------- misc ---------- */
|
| 373 |
+
.km-mini { appearance: none; border: 1px solid var(--line); background: var(--surface-2); color: var(--muted);
|
| 374 |
+
font: 500 12.5px var(--sans); cursor: pointer; padding: 8px 13px; border-radius: var(--r-sm); margin-top: 14px;
|
| 375 |
+
transition: all 0.18s var(--ease); }
|
| 376 |
+
.km-mini:hover { color: var(--text); border-color: var(--line-2); }
|
| 377 |
+
|
| 378 |
+
@media (prefers-reduced-motion: reduce) {
|
| 379 |
+
#km *, #km *::before, #km *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
|
| 380 |
}
|