Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .claude/skills/tetrak-ocr-design/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -181,10 +181,10 @@ reason it still looks like the same site:
- No cards, no boxed callouts, no second accent. Scale comes from the corpus
imagery, from display-size Playfair numerals, and from air.
- The only marks are `--rule` hairlines and 2px `--clay` rules above a block.
- The average bars are drawn in CSS from the CSV, coloured with the `--engine-*`
tokens — the same tokens the matplotlib chart below them uses. Word recall is
the accent at 42% opacity rather than a second hue, because a second colour
there reads as a second engine.
- The per-document score rows and the matplotlib chart colour engines with
the `--engine-*` tokens and nothing else. There used to be a set of
CSS-drawn average bars above the results table as well; they showed what the
chart below the table already shows, and were removed in October 2026.

If a section here seems to want a border to hold it together, it wants more
space instead.
Expand Down
7 changes: 4 additions & 3 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -265,9 +265,10 @@ Two more steps once it reaches the benchmark, neither obvious from the code:

- Add an `[[engine]]` entry to [`site/data/walkthrough.toml`](site/data/walkthrough.toml)
with `key` matching the CSV column stem, an `accent` token, and its prose.
The walkthrough draws its bars from `benchmark.csv` but takes their names
and colours from there, so a column with no entry renders one bar short
and fails the browser suite rather than the build.
The walkthrough reads its figures from `benchmark.csv` but takes the
engines' names and colours from there, so a column with no entry leaves
every document plate one row short and fails the browser suite rather than
the build.
- Run `tetrak-ocr evaluate --backend <name> --save --merge` to put its column
into `benchmark.{csv,md}`. `--all` re-runs every engine, which costs hours
and paid API calls for figures that have not changed.
Expand Down
88 changes: 0 additions & 88 deletions site/assets/scss/_app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -623,94 +623,6 @@
}
}

// --- Average bars ------------------------------------------------------------
// Drawn in CSS from the CSV at build time rather than by a charting library.
// Build time over runtime, and the bars take their colour from the same engine
// tokens the matplotlib chart below them uses.
.wt-bars {
margin: 3rem 0 0;
max-width: 900px;
}

.wt-bar {
display: grid;
grid-template-columns: 150px minmax(0, 1fr) 108px;
align-items: center;
gap: 20px;
padding: 9px 0;

&__name {
margin: 0;
font-family: var(--font-mono);
font-size: 0.8rem;

code {
font-size: 1em;
}
}

&__track {
display: flex;
flex-direction: column;
gap: 4px;
}

&__fill {
height: 9px;
min-width: 2px;

&--chr {
background: var(--accent);
}

// Word recall is the same engine measured a second way, so it is the same
// colour set back rather than a second hue. A second colour here would
// read as a second engine.
&--wrd {
background: var(--accent);
opacity: 0.42;
}
}

&__figs {
margin: 0;
font-family: var(--font-mono);
font-size: 0.8rem;
font-variant-numeric: tabular-nums;
text-align: right;
color: var(--ink-soft);

span {
color: var(--rule);
}
}

&s__key {
margin: 1.4rem 0 0;
font-size: 0.85rem;
line-height: 1.6;
color: var(--ink-soft);
}

&s__swatch {
display: inline-block;
width: 22px;
height: 8px;
margin-right: 5px;
margin-left: 10px;
vertical-align: baseline;
background: var(--ink-soft);

&:first-child {
margin-left: 0;
}

&--wrd {
opacity: 0.42;
}
}
}

// --- Findings ----------------------------------------------------------------
// The page's spot colour. Set at display size with a clay rule above, which is
// as close to a pull quote as the system goes.
Expand Down
33 changes: 6 additions & 27 deletions site/layouts/research/walkthrough.html
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@
{{- end }}
{{- $engines = $engines | append . }}
{{- end }}
{{- $locals := where $engines "ceiling" "!=" true }}
{{- $avg := index $rows "Average" }}

<article class="wt">

Expand Down Expand Up @@ -160,33 +158,14 @@ <h3 class="wt-plate__title">{{ $doc.title }}</h3>
<div class="kicker">Four · The results</div>
<h2 class="wt-section__head">Choosing per file beats choosing an engine</h2>
<p class="wt-section__lede">
Averaged over the whole corpus. Character similarity is order-sensitive
and word recall is not, so they are always reported as a pair — the gap
between them is where the interesting behaviour lives.
Every engine against every document, then averaged over the corpus.
Character similarity is order-sensitive and word recall is not, so they
are always reported as a pair — the gap between them is where the
interesting behaviour lives. <code>claude</code> is set apart throughout:
it generated the reference transcripts everything else is scored
against, so its figures measure self-consistency rather than accuracy.
</p>

<div class="wt-bars">
{{- range $locals }}
{{- $chr := index $avg (index $col (printf "%s_chr" .key)) }}
{{- $wrd := index $avg (index $col (printf "%s_wrd" .key)) }}
<div class="wt-bar" style="--accent: var(--{{ .accent }})">
<p class="wt-bar__name"><code>{{ .label }}</code></p>
<div class="wt-bar__track">
<div class="wt-bar__fill wt-bar__fill--chr" style="width: {{ mul (float $chr) 100 }}%"></div>
<div class="wt-bar__fill wt-bar__fill--wrd" style="width: {{ mul (float $wrd) 100 }}%"></div>
</div>
<p class="wt-bar__figs">{{ printf "%.2f" (float $chr) }} <span>/</span> {{ printf "%.2f" (float $wrd) }}</p>
</div>
{{- end }}
<p class="wt-bars__key">
<span class="wt-bars__swatch wt-bars__swatch--chr"></span> character similarity
<span class="wt-bars__swatch wt-bars__swatch--wrd"></span> word recall
— <code>claude</code> is omitted here: it generated the reference
transcripts everything else is scored against, so its bar would measure
self-consistency rather than accuracy.
</p>
</div>

<h3 class="wt-section__sub">Every engine against every document</h3>
{{ partial "benchmark.html" (dict "boldBest" true) }}

Expand Down
18 changes: 2 additions & 16 deletions site/tests/site.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -67,23 +67,9 @@ test("the walkthrough renders its figures from the CSV, not from prose", async (

const csv = readFileSync(join(__dirname, "..", "..", "evaluation", "ocr", "benchmark.csv"), "utf8");
const header = csv.split("\n")[0].split(",");
const average = csv.split("\n").find(line => line.startsWith("Average"))!.split(",");
const chrOf = (backend: string) =>
Number(average[header.indexOf(`${backend}_chr`)]).toFixed(2);

// Every local engine gets a bar, and the ceiling reference does not: its bar
// would measure self-consistency rather than accuracy. Derived from the CSV
// header (all engines minus the ceiling), like every other count here — a
// Five document plates, each with a full set of per-engine figures. The
// count is derived from the CSV header, like every other count here — a
// hardcoded 6 broke the day Vision became the eighth backend.
Comment on lines +70 to 72
const bars = page.locator(".wt-bar");
await expect(bars).toHaveCount(header.filter(c => c.endsWith("_chr")).length - 1);
await expect(page.locator(".wt-bars")).not.toContainText("claude*");

// The routing engine's average, straight off the CSV.
await expect(page.locator(".wt-bar", { hasText: "auto-local" }).locator(".wt-bar__figs"))
.toContainText(chrOf("auto-local"));

// Five document plates, each with a full set of per-engine figures.
await expect(page.locator(".wt-plate")).toHaveCount(5);
const firstScores = page.locator(".wt-scores").first();
await expect(firstScores.locator(".wt-scores__row")).toHaveCount(header.filter(c => c.endsWith("_chr")).length);
Expand Down
Loading