Skip to content

Commit 82e575a

Browse files
AlexMikhalevclaude
andcommitted
feat(ship-systems): render metrics from content/data/benchmarks.json
Ship Systems section previously held six headline benchmark numbers as literal strings in the Tera template. They were honest but static, with no timestamp and no traceability back to the source measurement. This change replaces them with a Zola load_data call over a new JSON file at content/data/benchmarks.json, and adds a visible "Last measured" date line citing the source. Schema: generated_at, source{repo,commit,workflow_run,notes}, metrics{ label,value,unit} per field. Six metrics today: inference_ns, search_latency_ms, index_throughput_mibps, graph_footprint_mb, index_build_100_terms_us, index_build_1000_terms_ms. Adding a metric is append-only. The JSON file is hand-authored from the 2025-11-11 test report and the rust-wasm capability page, with source.commit set to a sentinel "manual-snapshot-2025-11-11". Gitea issue #574 tracks the follow-up work in terraphim-ai to generate this file automatically from Criterion output via a new scripts/update-benchmark-snapshot.sh plus a cross-repo PR workflow. Steps 2 and 3 of the design plan are deferred. Research + design docs live at .docs/research-ship-systems-benchmarks.md and .docs/design-ship-systems-benchmarks.md (gitignored). Verified: build completes in ~200ms, dev-browser confirms all six values render from the data file and <time datetime= "2025-11-11T00:00:00Z"> is set. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
1 parent 3a57d0d commit 82e575a

2 files changed

Lines changed: 69 additions & 19 deletions

File tree

content/data/benchmarks.json

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"generated_at": "2025-11-11T00:00:00Z",
3+
"source": {
4+
"repo": "terraphim/terraphim-ai",
5+
"commit": "manual-snapshot-2025-11-11",
6+
"workflow_run": null,
7+
"notes": "Hand-authored from docs/archive/root/test_benchmark_report_20251111.md and content/capabilities/rust-wasm.md. Will be replaced by automated snapshot once terraphim-ai scripts/update-benchmark-snapshot.sh lands (see Gitea #574)."
8+
},
9+
"metrics": {
10+
"inference_ns": {
11+
"label": "Inference",
12+
"value": "5-10",
13+
"unit": "ns"
14+
},
15+
"search_latency_ms": {
16+
"label": "Search query",
17+
"value": "< 1",
18+
"unit": "ms"
19+
},
20+
"index_throughput_mibps": {
21+
"label": "Index throughput",
22+
"value": "~310",
23+
"unit": "MiB/s"
24+
},
25+
"graph_footprint_mb": {
26+
"label": "Graph footprint",
27+
"value": "15-20",
28+
"unit": "MB"
29+
},
30+
"index_build_100_terms_us": {
31+
"label": "Index build (100 terms)",
32+
"value": "~301",
33+
"unit": "\u00b5s"
34+
},
35+
"index_build_1000_terms_ms": {
36+
"label": "Index build (1,000 terms)",
37+
"value": "~3.66",
38+
"unit": "ms"
39+
}
40+
}
41+
}

themes/WarpDrive/templates/index.html

Lines changed: 28 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -354,6 +354,13 @@ <h2 class="section-title">What You Keep vs What They Take</h2>
354354
</section>
355355

356356
<!-- ---- SYSTEM READOUTS ---- -->
357+
{% set bench = load_data(path="content/data/benchmarks.json") %}
358+
{% set inference = bench.metrics.inference_ns %}
359+
{% set search_latency = bench.metrics.search_latency_ms %}
360+
{% set throughput = bench.metrics.index_throughput_mibps %}
361+
{% set graph_footprint = bench.metrics.graph_footprint_mb %}
362+
{% set build_100 = bench.metrics.index_build_100_terms_us %}
363+
{% set build_1000 = bench.metrics.index_build_1000_terms_ms %}
357364
<section class="section" id="systems" aria-label="System readouts">
358365
<div class="section-inner">
359366
<div class="section-overline">
@@ -373,16 +380,16 @@ <h3>Computation Core</h3>
373380
<div class="system-card-body">
374381
<p>Rust compiled to native or WebAssembly. Aho-Corasick automata match every pattern in a single pass -- O(n) in text length, independent of pattern count.</p>
375382
<div class="metric">
376-
<span class="metric-label">Inference</span>
377-
<span class="metric-value">5-10 ns</span>
383+
<span class="metric-label">{{ inference.label }}</span>
384+
<span class="metric-value">{{ inference.value }} {{ inference.unit }}</span>
378385
</div>
379386
<div class="metric">
380-
<span class="metric-label">Search query</span>
381-
<span class="metric-value">sub-millisecond</span>
387+
<span class="metric-label">{{ search_latency.label }}</span>
388+
<span class="metric-value">{{ search_latency.value }} {{ search_latency.unit }}</span>
382389
</div>
383390
<div class="metric">
384-
<span class="metric-label">Index throughput</span>
385-
<span class="metric-value">~310 MiB/s</span>
391+
<span class="metric-label">{{ throughput.label }}</span>
392+
<span class="metric-value">{{ throughput.value }} {{ throughput.unit }}</span>
386393
</div>
387394
</div>
388395
</div>
@@ -395,16 +402,16 @@ <h3>Memory Subsystem</h3>
395402
<div class="system-card-body">
396403
<p>No float vectors, no dense embeddings, no GPU allocation. Rust's zero-cost abstractions, deterministic allocation, graphs held in compressed representations.</p>
397404
<div class="metric">
398-
<span class="metric-label">Graph footprint</span>
399-
<span class="metric-value">15-20 MB</span>
405+
<span class="metric-label">{{ graph_footprint.label }}</span>
406+
<span class="metric-value">{{ graph_footprint.value }} {{ graph_footprint.unit }}</span>
400407
</div>
401408
<div class="metric">
402-
<span class="metric-label">Index build (100 terms)</span>
403-
<span class="metric-value">~301 &micro;s</span>
409+
<span class="metric-label">{{ build_100.label }}</span>
410+
<span class="metric-value">{{ build_100.value }} {{ build_100.unit }}</span>
404411
</div>
405412
<div class="metric">
406-
<span class="metric-label">Index build (1,000 terms)</span>
407-
<span class="metric-value">~3.66 ms</span>
413+
<span class="metric-label">{{ build_1000.label }}</span>
414+
<span class="metric-value">{{ build_1000.value }} {{ build_1000.unit }}</span>
408415
</div>
409416
</div>
410417
</div>
@@ -451,11 +458,11 @@ <h3>Privacy Shield</h3>
451458
<i class="fa-solid fa-chart-line" aria-hidden="true"></i>
452459
Measured performance
453460
</div>
454-
<div class="indicator-row"><div class="indicator-dot blue"></div><span class="indicator-name">Inference</span><span class="indicator-val">5-10 ns</span></div>
455-
<div class="indicator-row"><div class="indicator-dot blue"></div><span class="indicator-name">Search latency</span><span class="indicator-val">&lt; 1 ms</span></div>
456-
<div class="indicator-row"><div class="indicator-dot green"></div><span class="indicator-name">Index 100 terms</span><span class="indicator-val">~301 &micro;s</span></div>
457-
<div class="indicator-row"><div class="indicator-dot green"></div><span class="indicator-name">Index 1,000 terms</span><span class="indicator-val">~3.66 ms</span></div>
458-
<div class="indicator-row"><div class="indicator-dot green"></div><span class="indicator-name">Graph RAM</span><span class="indicator-val">15-20 MB</span></div>
461+
<div class="indicator-row"><div class="indicator-dot blue"></div><span class="indicator-name">{{ inference.label }}</span><span class="indicator-val">{{ inference.value }} {{ inference.unit }}</span></div>
462+
<div class="indicator-row"><div class="indicator-dot blue"></div><span class="indicator-name">Search latency</span><span class="indicator-val">{{ search_latency.value }} {{ search_latency.unit }}</span></div>
463+
<div class="indicator-row"><div class="indicator-dot green"></div><span class="indicator-name">Index 100 terms</span><span class="indicator-val">{{ build_100.value }} {{ build_100.unit }}</span></div>
464+
<div class="indicator-row"><div class="indicator-dot green"></div><span class="indicator-name">Index 1,000 terms</span><span class="indicator-val">{{ build_1000.value }} {{ build_1000.unit }}</span></div>
465+
<div class="indicator-row"><div class="indicator-dot green"></div><span class="indicator-name">Graph RAM</span><span class="indicator-val">{{ graph_footprint.value }} {{ graph_footprint.unit }}</span></div>
459466
</div>
460467

461468
<div class="indicator-panel">
@@ -472,8 +479,10 @@ <h3>Privacy Shield</h3>
472479
</div>
473480

474481
<p class="section-footnote">
475-
Numbers from Criterion benchmarks in <code class="inline-code">crates/terraphim_automata/benches</code> and
476-
<a class="inline-link" href="https://docs.terraphim.ai">docs.terraphim.ai</a>. Run them yourself: <code class="inline-code">cargo bench</code>.
482+
Last measured <time datetime="{{ bench.generated_at }}">{{ bench.generated_at | date(format="%Y-%m-%d") }}</time>
483+
from Criterion benchmarks in <code class="inline-code">crates/terraphim_automata/benches</code>.
484+
Run them yourself: <code class="inline-code">cargo bench</code>.
485+
{% if bench.source.workflow_run %}&middot; <a class="inline-link" href="{{ bench.source.workflow_run }}">View CI run</a>{% endif %}
477486
</p>
478487
</div>
479488
</section>

0 commit comments

Comments
 (0)