From 10b0b1ce8efcfec540fc95ca90a28c8f83e0207a Mon Sep 17 00:00:00 2001 From: wlkns-dev Date: Sat, 7 Nov 2026 17:54:17 +0100 Subject: [PATCH] =?UTF-8?q?GUI:=20Aufgabenkarten=20mit=20Beschreibung,=20P?= =?UTF-8?q?lan-und-Stand-Matrix,=20feste=20Startleiste=20mit=20Zeitsch?= =?UTF-8?q?=C3=A4tzung,=20Hinweis=20bei=20wenigen=20Durchl=C3=A4ufen,=20kl?= =?UTF-8?q?ickbare=20Ergebnis-Zellen?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 5.5 --- src-tauri/src/runner.rs | 1 + src-tauri/src/tasks.rs | 3 + src/app.css | 1 + src/lib/BenchPanel.svelte | 507 +++++++++++++++++++++++++++++------- src/lib/ResultsPanel.svelte | 43 ++- src/lib/api.ts | 13 +- 6 files changed, 469 insertions(+), 99 deletions(-) diff --git a/src-tauri/src/runner.rs b/src-tauri/src/runner.rs index 2f847e4..317dd47 100644 --- a/src-tauri/src/runner.rs +++ b/src-tauri/src/runner.rs @@ -422,6 +422,7 @@ mod tests { check_timeout_s: 30, }, dir: PathBuf::from("/x"), + prompt: String::new(), } } diff --git a/src-tauri/src/tasks.rs b/src-tauri/src/tasks.rs index 35e812d..b64cd3b 100644 --- a/src-tauri/src/tasks.rs +++ b/src-tauri/src/tasks.rs @@ -45,6 +45,8 @@ pub struct Task { #[serde(flatten)] pub meta: TaskToml, pub dir: PathBuf, + /// Inhalt von `prompt.md`, damit die Oberfläche zeigen kann, was die Aufgabe verlangt. + pub prompt: String, } /// Ein Fehler bei einer Aufgabe, mit Ordner und Grund. @@ -164,6 +166,7 @@ pub fn load_one(dir: &Path) -> Result> { (Some(meta), true) => Ok(Task { meta, dir: dir.to_path_buf(), + prompt: fs::read_to_string(dir.join(PROMPT_FILE)).unwrap_or_default(), }), _ => Err(errs), } diff --git a/src/app.css b/src/app.css index 69baedd..c6b17b8 100644 --- a/src/app.css +++ b/src/app.css @@ -157,3 +157,4 @@ th { td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; } input[type="checkbox"], input[type="radio"] { accent-color: var(--accent); } +.small { font-size: 0.8rem; } diff --git a/src/lib/BenchPanel.svelte b/src/lib/BenchPanel.svelte index 957a773..8dd1e02 100644 --- a/src/lib/BenchPanel.svelte +++ b/src/lib/BenchPanel.svelte @@ -1,7 +1,19 @@ {#if models.length === 0} -
+

Noch kein Modell angebunden

Bevor ein Benchmark laufen kann, braucht coding-bench mindestens ein Modell.

+
    +
  1. Modell mit Adapter und Server-URL anlegen
  2. +
  3. Container-Image bauen (einmalig)
  4. +
  5. Hier Modelle und Aufgaben wählen und starten
  6. +
{:else}
-

1. Modelle

-
+
+

1. Modelle

+ + +
+
{#each models as m (m.name)} -
-
-

3. Starten

-
- -

- {#if totalRuns > 0}{totalRuns} Läufe: {chosenModels.length} Modell(e) × {chosenTasks.length} Aufgabe(n) × {repeats}.{:else}Wähle Modelle und Aufgaben.{/if} - Mehr Durchläufe machen die Prozentwerte verlässlicher. + {#if chosenModels.length > 0 && chosenTasks.length > 0} +

+

Plan und Stand

+

+ Jede Zelle ist ein Modell bei einer Aufgabe. Vor dem Start steht dort, was zuletzt gemessen wurde. Beim Lauf füllt sie + sich live.

-
- - +
+ + + + + {#each chosenTaskInfos() as t (t.id)}{/each} + + + + {#each chosenModels as m (m)} + + + {#each chosenTaskInfos() as t (t.id)} + {@const c = cellOf(m, t.id)} + {@const lc = lastCell(m, t.id)} + + {/each} + + {/each} + +
Modell{t.id}
{m} + {#if c?.state === "done"} + {@const p = (100 * c.sum) / c.n} + {fmtPct(p)} + {:else if c?.state === "running"} + läuft … + {:else if c?.state === "infra"} + nicht gewertet + {:else if c?.state === "skipped"} + schon vorhanden + {:else if c?.state === "planned"} + geplant{c.n > 0 ? ` ${c.n}/${repeats}` : ""} + {:else if lc !== null} + zuletzt {fmtPct(lc)} + {:else} + neu + {/if} +
-
+
+ {/if} + {#if log.length > 0 || error || finishedBatch !== null} +
+

Verlauf

+ {#if error}

{error}

{/if} + {#if finishedBatch !== null} +

+ {cancelled ? "Abgebrochen." : "Fertig."} + +

+ {/if} + {#if log.length > 0} +
    + {#each log as l, i (i)} +
  • {l.text}
  • + {/each} +
+ {/if} +
+ {/if} + +
+
+ {#if totalRuns > 0} + {totalRuns} Läufe + {chosenModels.length} Modell(e) × {chosenTasks.length} Aufgabe(n) × {repeats} + {#if estimate} + + ≈ {estimate.minutes} min + + {:else} + Dauer unbekannt, noch keine Messung + {/if} + {:else} + Wähle Modelle und Aufgaben. + {/if} + {#if repeats < 3 && totalRuns > 0} + Bei weniger als 3 Durchläufen können Unterschiede zwischen Modellen Zufall sein. + {/if} +
+ + + {#if progress} -
-
+
+
+
+
+ {progress.done} von {progress.total}{current ? ` · läuft: ${current}` : ""}
-

{progress.done} von {progress.total} Läufen fertig

{/if} - {#if current}

Läuft: {current}

{/if} - {#if error}

{error}

{/if} - {#if finishedBatch !== null} -

- {cancelled ? "Abgebrochen." : "Fertig."} - -

- {/if} - {#if log.length > 0} -
    - {#each log as l, i (i)} -
  • {l.text}
  • - {/each} -
- {/if} -
+ {/if} diff --git a/src/lib/ResultsPanel.svelte b/src/lib/ResultsPanel.svelte index 5638982..3ec6606 100644 --- a/src/lib/ResultsPanel.svelte +++ b/src/lib/ResultsPanel.svelte @@ -66,6 +66,20 @@ detail = { run, steps: await api.steps(selected, run) }; } + // Kleinste Zahl gewerteter Durchläufe in einer Zelle der Matrix. + let minRepeats = $derived(ranking && ranking.cells.length > 0 ? Math.min(...ranking.cells.map((c) => c.runs)) : 0); + + async function openCell(model: string, task: string) { + const r = rows.find((x) => x.model === model && x.task_id === task); + if (!r) return; + try { + await showSteps(r); + setTimeout(() => document.getElementById("run-detail")?.scrollIntoView({ behavior: "smooth", block: "start" }), 50); + } catch (e) { + error = String(e); + } + } + function cell(model: string, task: string) { return ranking?.cells.find((c) => c.model === model && c.task_id === task); } @@ -145,6 +159,13 @@ {/each} + {#if minRepeats < 3} +

+ Pro Aufgabe {minRepeats === 1 ? "gab es nur 1 Durchlauf" : `gab es nur ${minRepeats} Durchläufe`}. Dann können Unterschiede + zwischen Modellen Zufall sein, und die Rangfolge ist nur ein Hinweis. Für belastbare Werte mindestens 3 Durchläufe wählen. +

+ {/if} + {#if ranking.excluded_runs > 0}

{ranking.excluded_runs} Lauf/Läufe sind nicht gewertet, weil der Modell-Server oder die Umgebung ausfiel. Sie @@ -172,7 +193,7 @@ -

Aufgaben im Detail

+

Aufgaben im Detail Zelle anklicken öffnet den Lauf

@@ -190,7 +211,8 @@ {#each ranking.tasks as t (t.id)} {@const c = cell(m.model, t.id)}
openCell(m.model, t.id)} style:background={c ? `color-mix(in srgb, ${pctColor(c.mean_score * 100)} 28%, transparent)` : ""} title={c ? `${Math.round(c.mean_score * 100)} %, ${c.successes} von ${c.runs} bestanden` : "keine Läufe"} > @@ -244,7 +266,7 @@ {/if} {#if detail} -
+

Schritte: {detail.run.model} · {detail.run.task_id} · Durchlauf {detail.run.repeat_idx} @@ -378,6 +400,21 @@ .n.few { color: var(--danger); } + .notice { + border: 1px solid color-mix(in srgb, var(--accent) 50%, var(--border)); + background: var(--accent-soft); + border-radius: 10px; + padding: 0.6rem 0.9rem; + margin: 0 0 1rem; + font-size: 0.9rem; + } + td.clickable { + cursor: pointer; + } + td.clickable:hover { + outline: 2px solid var(--accent); + outline-offset: -2px; + } .how { margin: 0.5rem 0 1.2rem; color: var(--muted); diff --git a/src/lib/api.ts b/src/lib/api.ts index 26e99c9..be4346e 100644 --- a/src/lib/api.ts +++ b/src/lib/api.ts @@ -2,7 +2,18 @@ import { invoke } from "@tauri-apps/api/core"; export type Paths = { config_file: string; data_dir: string; tasks_dir: string }; -export type TaskInfo = { id: string; title: string; group: string; dir: string; weight: number }; +export type TaskInfo = { + id: string; + title: string; + group: string; + dir: string; + weight: number; + image: string; + max_steps: number; + timeout_s: number; + check_timeout_s: number; + prompt: string; +}; export type TaskError = { dir: string; message: string }; export type LoadReport = { tasks: TaskInfo[]; errors: TaskError[] };