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
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,4 @@ src/pages/api-docs.astro
# hand-wrapped prose (Astro whitespace trap) — see CLAUDE.md
src/pages/playground.astro
src/pages/docs/isc-language.astro
src/pages/benchmarks.astro
133 changes: 133 additions & 0 deletions src/pages/benchmarks.astro
Original file line number Diff line number Diff line change
Expand Up @@ -92,6 +92,56 @@ const baseline = [
perMap: 377,
},
]

// The first runtime baselines are frozen by design: quoted verbatim from
// interscript-rs docs/benchmarks/BASELINES-2026-11.md (2026-11-21 run) —
// one-shot serial numbers, not medians; the protocol lives in the rs repo.
const firstBaselines = [
{
runtime: "Rust (interscript-rs)",
coldLoad: "9.55",
loaded: "456/457",
rssLoad: "342.7",
docsPerSec: "145.1",
charsPerSec: "3,975",
rssThroughput: "406.2",
peakDoc: "318",
rssPeak: "16.2",
},
{
runtime: "TypeScript (interscript-ts)",
coldLoad: "0.28",
loaded: "457/457",
rssLoad: "202.7",
docsPerSec: "1,475.3",
charsPerSec: "40,408",
rssThroughput: "613.2",
peakDoc: "22",
rssPeak: "49.6",
},
{
runtime: "Ruby (interscript-ruby)",
coldLoad: "137.59",
loaded: "457/457",
rssLoad: "974.2",
docsPerSec: "1,976.3",
charsPerSec: "54,130",
rssThroughput: "594.3",
peakDoc: "863",
rssPeak: "33.4",
},
{
runtime: "Python (interscript-py)",
coldLoad: "3.59",
loaded: "435/457",
rssLoad: "273.0",
docsPerSec: "52.1",
charsPerSec: "1,426",
rssThroughput: "241.3",
peakDoc: "42",
rssPeak: "19.4",
},
]
---

<Base
Expand Down Expand Up @@ -358,6 +408,86 @@ const baseline = [
</div>
</section>

<section class="detail-card">
<header>
<p class="eyebrow">First baselines (frozen)</p>
<h2>Registry cold load, RSS, and end-to-end throughput — 2026-11-21</h2>
</header>
<div class="prose">
<p>
Quoted verbatim from{" "}
<a href="https://github.com/interscript/interscript-rs/blob/main/docs/benchmarks/BASELINES-2026-11.md">
interscript-rs <code>docs/benchmarks/BASELINES-2026-11.md</code>
</a>{" "}
(2026-11-21 run): the first measured baselines of the full registry path. One-shot serial
run on an otherwise idle machine (Apple M1 Max, 10 cores, 64&nbsp;GB, macOS 14.1.1) —
numbers are single-run baselines, not medians. All four runtimes loaded the same maps
corpus pin (<code>9cfbf4cf</code>, 457 maps) and transliterated the same deterministic
200-doc sample. Measure definitions and the runner interface: the{" "}
<a href="https://github.com/interscript/interscript-rs/blob/main/docs/benchmarks/PROTOCOL.md">
full protocol</a
>.
</p>
<div class="table-scroll">
<table>
<thead>
<tr>
<th>Runtime</th>
<th>Cold load (s)</th>
<th>Loaded</th>
<th>RSS @ load (MB)</th>
<th>Docs/sec</th>
<th>Chars/sec</th>
<th>RSS @ throughput (MB)</th>
<th>Peak doc (ms)</th>
<th>RSS @ peak (MB)</th>
</tr>
</thead>
<tbody>
{firstBaselines.map((row) => (
<tr>
<td>{row.runtime}</td>
<td class="tnum">{row.coldLoad}</td>
<td class="tnum">{row.loaded}</td>
<td class="tnum">{row.rssLoad}</td>
<td class="tnum">{row.docsPerSec}</td>
<td class="tnum">{row.charsPerSec}</td>
<td class="tnum">{row.rssThroughput}</td>
<td class="tnum">{row.peakDoc}</td>
<td class="tnum">{row.rssPeak}</td>
</tr>
))}
</tbody>
</table>
</div>
<p class="fine-print">
Definitions (from the protocol): <strong>cold load</strong> = a fresh process loading all
457 maps through the runtime's standard registry path; <strong>docs/sec</strong> = warm
throughput over the 200-doc set × 5 loops; <strong>peak doc</strong> = fresh-process load
plus a single transliteration of the largest input doc; <strong>RSS</strong> = process
resident set of the whole runner, so cross-runtime deltas include each interpreter's own
baseline — per-runtime trends over time are the primary signal.
</p>
<p class="fine-print">
Reading the spread: TypeScript's 0.28&nbsp;s cold load reads the pre-compiled JSON-IR
artifact (deserialise + link, not ISC parsing); Ruby's 137.6&nbsp;s / 974&nbsp;MB is
per-map parsanol compilation, after which it is the fastest runtime warm (1,976
docs/sec); Rust parses <code>.isc</code> at load and cannot load one map whose{" "}
<code>rababa</code> funcall needs external ML engines (unsupported in that slice, by
design); the Python row is the pre-<code>#49</code> engine — 22 parser-gap maps did not
load.
</p>
<p class="fine-print">
Same-day refresh: after py caching (<code>#48</code>) and full parser coverage
(<code>#49</code>), py loads 457/457, cold load 7.27&nbsp;s, and reaches 91.1 docs/sec
(2,496 chars/sec) with zero errors — +75% warm throughput while decoding strictly more
work (all 200 docs vs the baseline's 193); peak doc unchanged at 42&nbsp;ms. Per the
baselines doc, that refresh number is not directly comparable to the baseline row — the
honest statement is more work, fewer errors, on the same machine and corpus pin.
</p>
</div>
</section>

<section class="detail-card">
<header>
<p class="eyebrow">Reproduce</p>
Expand Down Expand Up @@ -417,6 +547,9 @@ node scripts/benchmarks/generate.mjs
font-size: 0.85rem;
color: var(--color-stone);
}
.table-scroll {
overflow-x: auto;
}
td.fine-print {
max-width: 22rem;
}
Expand Down
87 changes: 65 additions & 22 deletions src/pages/ml.astro
Original file line number Diff line number Diff line change
Expand Up @@ -414,41 +414,84 @@ const modelCount = all.length
<p class="eyebrow">The crystals</p>
<h2>Three runtimes, same bytes out.</h2>
<p class="section-deck">
The neural layer is served by <em>secryst</em> — the same cross-runtime contract as the map
layer. Ruby, Python, and TypeScript resolve a model id against the index, fetch (or reuse the
cache), verify every checksum, and decode with the KV-cache graph. Golden sets pin the three
implementations to each other.
The neural layer is served by the runtimes themselves — the same cross-runtime contract
as the map layer. Ruby, Python, and TypeScript resolve a model id against the index, fetch
(or reuse the cache), verify every checksum, and decode locally — KV-cache streaming for
the seq2seq family, mask-predict passes for the plane family. Golden sets pin the three
implementations to each other; install lines and the three-line recipe are in{" "}
<a href="/ml#getting-started">Use the models</a> below.
</p>
</header>
<div class="crystal-code">
<pre><code># Ruby
gem install secryst

# Python
pip install secryst

# TypeScript / JavaScript
npm install secryst</code></pre>
<pre><code>require "secryst"
model = Secryst::Model.load("tha-g2p-small-1.0")
model.translate("สวัสดี")
# =&gt; "sa˨˩.wat̚˨˩.diː˧"</code></pre>
</div>
<p class="env-note">
Point deployments at a mirror with <code>SECRYST_INDEX</code>; pin the cache with <code
>SECRYST_CACHE</code
>. Both are read at call time in all three runtimes.
Point deployments at a mirror with <code>INTERSCRIPT_ML_INDEX</code>; pin the cache with{" "}
<code>INTERSCRIPT_ML_CACHE</code> (the old <code>SECRYST_*</code> names still work as
aliases). Both are read at call time in all three runtimes.
</p>
<p class="env-note">
Without installing anything: the same models answer the REST
endpoint <code>POST https://api.interscript.org/v1/infer</code> (open CORS, no key), and run in the
browser at <a href="/neural">the demo page</a>. In a script with no build step, the map
layer loads from <a href="https://esm.sh/interscript@5.3.1">esm.sh</a> — full recipe in the
layer loads from <a href="https://esm.sh/interscript@6.0.0">esm.sh</a> — full recipe in the
package's <code>docs/CDN.md</code>.
</p>
</div>
</section>

<section class="section surface-deep" id="getting-started">
<div class="container">
<header class="section-head">
<p class="eyebrow">Getting started</p>
<h2>Use the models.</h2>
<p class="section-deck">
A model id resolves against the models.yaml index, downloads once, and is sha256-verified
on every load — then it runs locally, no server involved. Three lines per runtime. The
example restores the nikud a scribe left out; the input and output are a frozen
conformance vector, and all three runtimes are gated to produce it byte-exactly.
</p>
</header>
<div class="crystal-code">
<pre><code>{`# install — the neural layer ships inside the same package
npm install interscript # TypeScript / JavaScript
gem install interscript # Ruby (onnxruntime loads lazily)
pip install "interscript[ml]" # Python`}</code></pre>
<pre><code>{`// TypeScript
import { imf, PlaneModel } from "interscript/ml"

const model = await PlaneModel.fromZip((await imf.resolve("heb-vocalized-plane-3.0")).bytes)
await model.transform("ואם הזה, כשר")
// → "וְאִם הִזָּה, כָּשֵׁר"`}</code></pre>
<pre><code>{`# Ruby
require "interscript/ml"

model = Interscript::ML::PlaneModel.from_zip(
File.binread(Interscript::ML::IMF.resolve("heb-vocalized-plane-3.0")))
model.translate("ואם הזה, כשר")
# => "וְאִם הִזָּה, כָּשֵׁר"`}</code></pre>
<pre><code>{`# Python
import interscript

interscript.transliterate("heb-vocalized-plane-3.0", "ואם הזה, כשר")
# → "וְאִם הִזָּה, כָּשֵׁר"`}</code></pre>
</div>
<p class="env-note">
First use downloads the int8 artifact (about 416&nbsp;MB for this model) and caches it —
point the cache at <code>INTERSCRIPT_ML_CACHE</code> (default{" "}
<code>~/.cache/interscript-ml</code>); every later load re-verifies the sha256, the cache is
never trusted blindly. Other model kinds share the same three steps: seq2seq ids load
through{" "}
<code>Interscript::ML::Translator.new(model_file:)</code> in Ruby,{" "}
<code>Model.load(id)</code> in Python, <code>imf.IMFModel.load(id)</code> in TypeScript.
</p>
<p class="env-note">
Version note: Python 0.2.1 still pins the previous model index — until its next release
ships the index-v16 pin, set <code>INTERSCRIPT_ML_INDEX</code> to the index-v16{" "}
<code>models-index.yaml</code> URL (all three runtimes read the variable at call time). The
Rust runtime serves the map layer; neural inference ships in the TypeScript, Ruby, and
Python runtimes.
</p>
</div>
</section>

<!-- ════════════════════════════════════════════════════════════════
PROVENANCE
════════════════════════════════════════════════════════════════ -->
Expand Down