Computaco

APIs, SDKs & Operations

Performance#

Partly re-measured. The native world table below was re-run on the current tree on a quiet host and is current. Every other section is still stale: the raster, binding, browser and predecessor numbers were captured before the desktop shell and renderer overhaul, and before the reference world grew from 16.7 KB to 432 KB of definition. Treat those as historical until the benchmark suite is re-run on a quiet host. The methodology and the negative results are accurate throughout and are the reason to keep the document.

What the growth cost, measured rather than guessed: portable snapshot decode went from 0.142 ms to 4.90 ms and fork from 16.5 µs to 265 µs, both roughly tracking the 26x larger world definition. Everything that does not touch the whole world — a terminal step, a file write, an editor keystroke, a reset — is unchanged.

The two fork rows below are now stale in the other direction, and by more. Fork cost tracked the definition because it validated it — twice, once in Runtime::fork and once in the restore the fork performed on itself. It does not any more: a checkpoint whose definition is one the runtime already holds is not re-walked, and the environment's fork validates once. Measured on the current tree on the 3.7 MB company-2026 world (which is 8.7x the 432 KB world the table below was taken on), a fork of a freshly booted world is 15.9 µs, and of one driven through 4,000 actor steps 116.4 µs. What a populated step costs fell with it, for an unrelated reason in the same measurement pass: 176.2 ms → 219.2 µs at 16,013 accumulated events. Each figure is the median of three runs, and the same pass checked that no hash, event log, inspect() or exported snapshot byte moved. The two binding fork rows further down were measured on the old engine and the small world and have not been re-run at all.

Ending an episode (reset, fork, the first step of a fork, and drop, after 4,000 steps) has its own section below, Ending an episode, measured on 2026-11-23. Its fork rows are the same workloads as the two figures above, on a busier host.

Portable snapshots (re-measured 2026-11-23)#

The portable snapshot was JSON, and reading one back was the slowest row of the table below. Profiled first, with timers around each phase (benchmarks/runner/src/bin/snapshot.rs, release build, pinned to CPU 19, median of three runs): on the reference world (company-2026 joined to the internet, a 3.3 MB definition) reading a freshly booted world's 12.7 MB of JSON took 36.0 ms, of which parsing was 25.4 ms, restoring 7.9 ms (comparing the 3.3 MB definition with the world's own 1.9 ms, validating it 0.2 ms, the rest freeing the state it replaced) and the journal 0 ms. Half of the JSON was the definition, written twice (as the definition and as the baseline); a quarter was file contents written as arrays of numbers.

The format is now bytes (cw-snapshot, described in determinism.md). A definition is written as its own bytes and the baseline as a mark when it is the definition; a reader whose world already holds those bytes uses its own definition, so it neither decodes, validates nor compares one. A service's state that nothing has written to since boot is likewise the boot state's bytes, and is shared on reading. An array of bytes in JSON is one tag and the bytes.

World, snapshotBytes beforeafterEncode beforeafterDecode beforeafter
company-2026, booted12,669,1246,463,99712.456 ms0.232 ms36.001 ms0.450 ms
company-2026, 4,000 actor steps191,376,62161,875,077293.0 ms116.2 ms919.9 ms230.5 ms
agent-desktop, booted16,4864,8500.014 ms0.003 ms0.050 ms0.023 ms
agent-desktop, 4,000 actor steps122,490,87248,566,353195.7 ms83.2 ms517.1 ms153.0 ms

A snapshot carries its schema (the names and types of every struct's fields and every enum's variants, written once in front of the body), so that a build whose types changed since reads it by name. Measured the same way on a host whose load average was 25 to 31, before and after the schema:

company-2026, snapshotBytes beforeafterEncode beforeafterDecode beforeafterDecode, converted
booted6,509,4526,526,0500.282 ms0.250 ms0.593 ms0.669 ms3.826 ms
4,000 actor steps61,924,53361,941,131119.8 ms117.3 ms227.2 ms225.7 ms331.9 ms

The schema is 16,598 bytes. A reader whose schema is the snapshot's reads the body in place after comparing the two, so encode and decode are within the runs' spread (booted decode ranged 0.521 to 0.620 ms before and 0.548 to 0.733 ms after; its read phase's medians were 0.480 and 0.449 ms). The last column is what a build whose types differ pays: the body is rewritten field by field into its own positions, then read.

The steps are the fork benchmark's mixed cycle (a shell command, a new file, a keystroke, a virtual HTTP request and a browser navigation). Each figure is the median of three runs, each run's figure the median of five samples, on a host whose load average was 15 to 28 (CPU 19 itself was not otherwise pinned). State hashes and the determinism corpus are unchanged.

What the populated rows still spend, from timers inside the decoder on company-2026 after 4,000 steps: decoding the kernel's state (36.5 MB) took 95 ms and the sessions (21.9 MB) 50 ms, verifying the journal 2.9 ms, and restoring 88 ms, of which validation is 0.3 ms and the rest freeing the state the import replaces (freeing one decoded kernel state alone took 65.5 ms). Most of both is the event log: each http.completed event holds the response body as a JSON array of numbers, so 800 requests of the 16 KB intranet page are 13 million JSON values in memory. That is the event's shape, not the format's, and is the next lever.

The Wasm module shrank with it (the full build of core/scripts/build-wasm.sh, measured without its name section): 45,823,452 bytes and 17,286,878 gzipped (-9) before, 45,267,943 and 17,161,066 with the format, 44,935,234 and 17,095,428 once an application's state is read as its own variant instead of through the tagged enum. Attributed by function name with twiggy, the serde and serde_json code in the module went from 8.22 MB to 7.19 MB with the format (the readers and writers of every state type's JSON gone, cw-snapshot's 0.34 MB in their place) and to 6.86 MB after: the enum's buffered reading of every application's state was 0.77 MB, its direct reading 0.44 MB. What serde code is left reads world definitions, actions and the JSON-held state of services and applications, and writes observations.

Measured on September 17, 2026, Linux ARM64, Cortex-X925 CPU 19 (3.9 GHz maximum), Rust 1.97.1 release builds and Chrome 151. Native actor terminal steps cost 3.84 µs p50, dirty resets 1.52 µs, and warm 1280×720 frames 0.522 ms.

The renderer optimization improved native full-frame p50 3.11× and 100% patch rendering 7.21×. Against a Chromium DOM, the format-matched custom PNG capture pipeline achieved 2.74× p50 / 2.29× p95 improvement. The proposed 3× predecessor capture target was not met. The same Chromium screenshot API on both representations was slower for canvas in this run. We have not established a general renderer-only speedup over Chromium.

Raw samples, per-run summaries and machine and artifact hashes were recorded with every run in this report. Final refreshed bindings are measured, including the cached reset and exact integer conversion changes. The final device-lifecycle runtime is included; no viewer or page around the engine is a measured workload. These are results on one host, not universal hardware guarantees.

Method#

Persistent release runtimes, five runs, 100 warmups and 1,000 individual samples per short workload. Raster loops use 200 samples/run, portable snapshot encoding and decoding 200, and browser PNG captures 30 samples/run with three warmups. Tables use the median of the five per-run p50 and p95 values. Raw samples and per-run dispersion are kept with the results; throughput uses the arithmetic mean latency within a run. This does not treat batch averages as operation p95.

Native runs are pinned to CPU 19 on this ARM64 host. Machine/compiler/browser, world, lockfile and font/bundle hashes are recorded with the results. machine-baseline.json retains the earlier measurement metadata for the native renderer before/after runs; the final lifecycle-runtime runs refresh native world, capacity, Node, Python and browser results. native-dirty-reset.json is the initial standalone reset experiment; the report uses the newer native-world.json row. Initialization, boundary conversion, scene construction, rasterization and PNG capture are distinct workloads. The native world runner measures the full actor boundary including outcome construction, observation projection and journaling. Neither structured observations nor scene generation requests rasterization.

Native world results#

All values are microseconds, and are the median across five independent runs of each workload's own p50 and p95. Each short row has 5,000 measured operations; portable snapshot encode/decode have 1,000. These use the rich company world and full journaling. The initial snapshot is held during each workload. File, pipe and HTTP results are asserted to prevent no-op success from counting as work.

The first run of each workload is excluded, because it pays one-time cache population the steady state does not. That only matters in one row: virtual HTTP costs 148 µs on its first request against 83 µs afterwards, which is the DNS resolver cache filling. A consumer measuring a single cold request will see the larger figure, and that is the honest number for one-shot work.

Workloadp50p95
Terminal pwd, full actor step4.7765.128
Terminal parse + pipe5.2245.568
File write + read, two actor actions7.5367.904
Virtual HTTP, full actor step82.85687.441
Synthetic browser navigation through network159.672168.657
Editor type + backspace, two actions6.5367.056
Structured actor observation34.36835.112
Desktop scene, no raster93.19295.184
Already-clean same-seed reset0.5600.584
Dirty same-seed reset4.5444.728
Snapshot handle0.9761.040
Fork from initial snapshot (superseded, see the note at the top)264.921271.161
Fork + first file mutation (superseded)290.457296.185
Portable initial snapshot encode (re-measured 2026-11-23, the 3.3 MB world, see above)303.649347.377
Portable initial snapshot decode (re-measured 2026-11-23, the 3.3 MB world)424.258480.897

A dirty same-seed reset is 1.520 µs p50 / 1.568 µs p95. Every iteration mutates a file before the timer, then resets inside the timer and verifies the file disappeared after timing. The 0.144 µs clean-reset row intentionally measures an already-reset world; it should not be presented as the cost of discarding a populated episode. Snapshot encode/decode rows use the initialized snapshot; populated trajectory size naturally increases portable serialization cost. Fork + first write includes both operations rather than claiming an isolated mutation latency. The two fork rows predate the fix described at the top of this document and are kept only as the before column; the figures at the top of this document are the current measurement, and they are on a larger world than this table.

Ending an episode#

target/release/episode (benchmarks/runner/src/bin/episode.rs) measures what it costs to end or branch an episode that has done something. Each populated sample first drives a fresh world through 4,000 actor steps (shell, a new file, an editor keystroke, virtual HTTP, a browser navigation), outside the timer. Latency comes from a pass with allocation counting off; allocations and frees come from a second pass over the timed region only. Values are the median p50 of three interleaved invocations of the binary before and after the change, release, pinned to CPU 19, on 2026-11-23, with other work on the host (load 13 to 34). The company world:

WorkloadBefore p50After p50Before allocs / freesAfter allocs / frees
Terminal pwd, full actor step11.1 µs10.8 µs265 / 143267 / 143
File write step, after 4,000 steps177.8 µs181.5 µs8,578 / 8,0308,580 / 8,030
Reset after one write (editor open)11.4 µs11.7 µs60 / 77461 / 775
Reset after 4,000 steps102.29 ms100.16 ms60 / 1,639,00761 / 1,642,185
Same, checkpoint held50.42 ms47.4 µs1,184,901 / 1,184,876102 / 76
Drop of the world after 4,000 steps104.16 ms101.30 ms0 / 1,948,9660 / 1,952,144
Fork of a fresh world23.6 µs24.0 µs678 / 532679 / 533
Fork after 4,000 steps144.1 µs143.6 µs1,742 / 1,5961,743 / 1,597
Fork after 4,000 steps + its first step34.73 ms432.9 µs1,247,633 / 10,10313,699 / 10,104
Drop of that fork after 100 steps of its own22.65 ms2.71 ms0 / 1,304,6560 / 72,281

The populated-step row's two ranges (174.0 to 180.4 and 179.7 to 185.3 µs) overlap. On agent-desktop the same rows moved the same way: the first step of a fork 14.30 ms to 311.2 µs, a reset with the checkpoint held 16.04 ms to 132.6 µs, dropping a branch 8.16 ms to 1.76 ms, and a reset that frees the episode 61.15 to 61.62 ms. Peak RSS of the whole run fell from 2.62 to 2.52 GB.

In the Node build of the Wasm package (node benchmarks/wasm-episode.mjs: shell, file, HTTP and navigation steps, two runs each), the company world after 4,000 steps holds 1,057 MiB of linear memory before and after. The first step of a fork grew it to 1,141.7 MiB before and leaves it at 1,056.9 MiB now. A reset there takes about 150 ms either way.

What an episode holds after 4,000 steps on the company world, by deep copies of its parts: 1.13 GB in 1.64 million allocations. The tab's history is 74 MB in 1.18 million of them (800 pages, each kept whole for back and forward); the event log 995 MB in 241,620, most of it page bodies, which an http.completed event records as an array of JSON numbers at 32 bytes for every byte of the page; the action journal 5.3 MB in 47,210.

What changed is sharing, not freeing. Every part above was copy-on-write as a whole, so the first change to anything a checkpoint or fork still held copied all of it: a fork's first step copied the tab's 800 pages, the whole journal and the event log's open 256-record chunk. Each history entry is now shared on its own, and the journal and the event log are one chunked log (cw_trajectory::Chunks, 16 records a chunk) whose first shared append copies at most 15 records. An intermediate version that put every journal entry and every event record behind its own Arc was measured and replaced: it added an allocation per record, and a terminal step went from 11.1 to 11.6 µs and dropping the populated agent-desktop world from 54.5 to 64.2 ms.

An arena for the episode was measured and not built. The request was a bump arena (bumpalo) that a reset frees in one step. A measurement and the way the state is shared decide against it.

  • Dropping the populated company world with every free skipped, so only the destructors' walk over the episode is left, takes 55.3 ms of the 105.1 ms drop in the same invocation (37.4 of 59.6 ms on agent-desktop; BENCH_FREE_SKIPPED=1). An allocator that frees in one step, but under types that still run their destructors, can save at most the other half. Saving the walk too means that nothing in the episode runs a destructor: every String, Vec, BTreeMap and serde_json::Value in the state would become an arena type with a lifetime, across the engine and every application.
  • The state cannot be owned by one episode. A checkpoint and every fork of it share the same allocations through Arc, and they outlive the reset of the world they came from (a tree search keeps them for its whole run). Freeing an episode's arena at reset would free memory a live fork still reads. An arena per fork does not change that: the fork's state is mostly its parent's. A region allocator that frees a region only when its last object is freed is safe, but it is the free half above at best, and a region stays held while one object in it is shared.

What remains of a populated reset is the episode's size, in two places. Most of the event log's bytes are the page bodies' JSON number arrays; recording a body compactly would change the recorded event data, which the determinism corpus pins, so it is a format decision, not a performance one. Most of the history's allocations are 800 copies of the same intranet page; sharing identical pages between entries would cut them, and has not been tried.

Native renderer results#

A 100-text-node fixture, integer layout and the bundled DejaVuSansMono font. Full render includes returning/dropping an owned RGBA copy. Incremental render returns the retained framebuffer; each before/after pair uses the identical API. Values are microseconds, with 1,000 samples per warmed raster row.

WorkloadBefore p50After p50Before p95After p95Median improvement
Full 640×480772.59354.51781.36368.022.18×
Full 1280×7201623.70522.061715.22559.393.11×
Full 1920×10802586.03792.432781.28897.393.26×
Patch + raster 1%40.5918.1642.2618.912.24×
Patch + raster 10%310.7053.65319.4956.185.79×
Patch + raster 100%3075.46426.453124.79444.917.21×

Cold renderer construction plus a 1280×720 frame costs 10.389 ms p50 / 10.739 ms p95 (150 samples). This includes parsing the bundled font; reuse a persistent renderer for repeated frames. Scene construction is 10.560 µs, hit testing is 1.120 µs, and scene-only 1%/10%/100% patches are 8.320 / 10.624 / 20.096 µs p50. None of those structured workloads rasterizes.

Renderer profiling and optimization#

Linux perf is blocked by perf_event_paranoid=4; we did not change host policy. Temporary instrumentation on a disposable renderer copy measured sorting, clearing, text preparation and node raster stages. The source of that instrumentation and its results are included. Before optimization, node raster consumed about 95% of full-frame wall time. Identical old/new patch damage also painted the same area twice, making a 100% incremental update slower than full rendering.

The resulting optimization caches nonzero text spans, specializes identity text and opaque rectangle drawing, and coalesces redundant damage. Renderer semantic contracts and golden frames remain unchanged. Cache limits account for retained span storage. Authoritative before/after p50/p95 use uninstrumented binaries.

Chromium comparisons#

Three distinct measures avoid misleading ratios:

  • DOM mutation plus forced layout: no claim that this includes rasterization.
  • Wasm patch, software raster and RGBA copy: no ratio against DOM layout alone.
  • PNG delivered to the automation caller: both paths produce PNG, including encoding and transfer. We measure both the same Chrome screenshot API on DOM and canvas and the custom canvas export path (toDataURL) versus DOM screenshot. The latter is capture-pipeline savings, not isolated renderer speedup.

The primitive fixture uses identical content, dimensions and bundled font source; Chrome and fontdue differ in glyph antialiasing. The real predecessor mail fixture is synthux-mail-mock's inbox, normalized to that font. An additional migrated scene captures its per-character text geometry and background boxes. It omits CSS rounded corners, shadows and emoji fallback, so it is an approximate workload, not a pixel-identical HTML compatibility or matched-render speedup result. Review images are included beside the raw results.

Browser output and predecessor baseline#

The next table is milliseconds, with 150 captures per row. Inputs and outputs are the same 1280×720 primitive/text fixture; both final outputs are PNG returned to the Node caller. The custom incremental path combines update, raster, canvas upload, PNG encoding and transfer into one RPC. The DOM path needs the browser's screenshot API. These are end-to-end capture costs, including their required transport, not isolated compositor benchmarks.

Workloadp50p95
DOM update + Chrome PNG capture35.00452.579
Wasm full update + same Chrome PNG capture44.67153.737
Wasm full update + canvas PNG export, two RPCs15.19526.865
Wasm incremental update + PNG export, one RPC12.78622.980

DOM mutation plus forced layout costs 5 / 40 / 355 µs p50 for 1% / 10% / 100% changes. Wasm patch + raster + full RGBA boundary copy costs 1.675 / 1.800 / 2.560 ms. Those are different operations and are not divided into a speedup ratio. Browser timers are quantized; the smallest DOM result is near timer resolution. The RGBA-copy and canvas/export boundary is a remaining optimization target.

The real predecessor mail visual fixture captures in 46.434 / 63.092 ms p50/p95. Its migrated geometry reconstruction captures in 50.915 / 74.317 ms. The latter uses per-character nodes to preserve predecessor positions, omits decorations and emoji fallback, and is not a faithful same-pixel screen. It does not establish a renderer speedup. The reviewed DOM and reconstructed-scene images are retained. These are visual-state fixtures, not a service mutation end-to-end benchmark.

Persistent SCE runtime operational baselines (microseconds):

Workloadp50p95
Terminal pwd9.40811.216
Terminal pipe18.81623.008
Shell file write + read150.337212.337
Virtual HTTP45.28052.064

SCE's host-backed VFS, reference topology, shell projection and tracing differ from Computerworld. These are useful operational reference points, not isolated Rust versus JavaScript language comparisons. SCE initialization is recorded separately in its raw result. No per-step subprocess is used in either benchmark.

Bindings and memory#

Binding values are microseconds. Node executes the generated Wasm module; Python executes the installed PyO3 wheel. These terminal-only configurations have a smaller observation projection than the native desktop fixture, so cross-table ratios would not isolate binding overhead.

Workloadp50p95
Node Wasm terminal step13.40842.817
Node Wasm ten-action batch67.42577.184
Node Wasm observe1.4723.696
Node Wasm already-clean reset0.3520.384
Node Wasm snapshot handle0.9601.233
Node Wasm fork26.35228.752
Workloadp50p95
Python terminal step7.9368.480
Python ten-action batch42.84959.136
Python observe1.2801.360
Python already-clean reset0.2560.288
Python snapshot handle0.6720.720
Python fork16.89617.296

Actual Chrome Wasm terminal execution is 15 µs p50 / 35 µs p95 over 5,000 steps. One cold Node module load/instantiation took 16.600 ms; this is one observation, not a p50. Browser world construction warmed from 25.705 ms on the first run to 1.020–3.330 ms on later runs; five points do not establish a robust cold-start percentile.

Packaged artifactRaw bytesGzip bytes
Browser Wasm, standard services + renderer/fonts19,727,8508,378,969
Browser JS glue44,5607,051
Font pack, 20 files (fetched on demand)23,363,74012,961,365

Measured with gzip -9 on the web build of the current source. The fonts, wallpapers, icons and symbol masks are embedded in the Wasm, except the font pack (fonts/), whose files a page fetches only if it wants their glyphs: Han, kana and Hangul (and their bold and regional forms), emoji (monochrome and colour) and eight further scripts (see "Complex scripts" and "Italic, colour emoji, CJK forms and more scripts" below).

Complex scripts, before and after. Hebrew, Arabic, Thai, Devanagari, CJK and emoji support (fallback faces, bidi, rustybuzz shaping, CJK line breaking) grew the module by 9.2% gzipped. Both builds below are release web builds with the same toolchain (Rust 1.97.1, wasm-bindgen 0.2.128), the "before" from the release commit 6adc175:

ModuleRaw bytesGzip bytes
Before (6adc175)10,129,1304,949,209
After11,355,8915,403,366
Change+1,226,761 (+12.1%)+454,157 (+9.2%)

Where the growth went: 717,496 raw / about 259,000 gzip is font data — Noto Sans Hebrew, Arabic, Thai and Devanagari in two weights (512,860 raw; Devanagari alone is 328,276, its conjunct forms) and the outline-free stubs of the three pack faces (204,636 raw, 44,055 gzip) that let layout shape CJK and emoji without the pack. The rest, about 508,000 raw / 194,000 gzip, is code and Unicode tables: rustybuzz (179 KB of code), the extra ttf-parser tables it reads (68 KB), unicode-bidi (28 KB) and their property data. The pack itself — Noto Sans SC subset to 10,269 common Han (2,190,576 gzip), all 11,172 Hangul syllables in Noto Sans KR (855,949) and Noto Emoji (566,769) — would have taken the module to about 9 MB gzipped; kept separate, it costs nothing unless used. Native builds embed it.

Italic, colour emoji, CJK forms and more scripts, before and after. Italic and bold-italic faces, the COLRv1 colour emoji renderer, CJK bold and Traditional Chinese/Japanese/Korean glyph forms, terminal shaping and bidi, and Georgian, Armenian, Bengali (embedded) plus Tamil, Gurmukhi, Lao, Khmer, Gujarati, Ethiopic, Myanmar and Sinhala (pack) grew the module by 6.9% gzipped. Both builds are release web builds with the same toolchain (Rust 1.97.1, wasm-bindgen 0.2.128), the "before" from 7aeec57:

ModuleRaw bytesGzip bytes
Before (7aeec57)18,634,8057,835,005
After19,727,8508,378,969
Change+1,093,045 (+5.9%)+543,964 (+6.9%)

Where it went (standalone gzip -9 of each file): the eight platform italics (210,644 raw / 138,207 gzip) and DejaVu's two obliques (209,004 / 127,429); Noto Sans Georgian, Armenian and Bengali in two weights (297,068 / 159,808); and eleven new layout stubs (238,476 / 90,320) — for the locale Han faces, whose bold twins share them, and for the eight pack scripts. That is 955,192 raw of font data; the other ~138,000 raw is code and tables: the COLR painter, the terminal cell layout, the italic advance table, a 2.6 KB Traditional-only Han bitset and the East Asian Width ranges. Tamil, Gurmukhi, Lao and Khmer were first embedded too, which cost 128 KB gzip of module; they moved to the pack, where their stubs cost 17 KB.

The pack grew from 3 files (6,751,696 raw / 3,613,294 gzip) to 20 (23,363,740 / 12,961,365). The largest additions are Noto Color Emoji (4,991,984 / 2,825,172; its CBDT bitmap build would be 10.7 MB), Noto Sans SC bold (3,518,020 / 2,219,356) and KR bold (2,365,908 / 872,952). The locale faces hold only glyphs drawn differently from Noto Sans SC within each locale's common set: 2,573 for Traditional Chinese (624,023 gzip), 1,772 for Japanese (355,927) and 2,832 for Korean hanja (608,669), each again in bold. None of it is fetched unless a page draws those glyphs; the project site waits at boot only for regular SC and KR and the two emoji faces (6.4 MB gzip, of which the colour emoji are 2.8 MB) and fetches the rest behind them.

The web faces — Arimo, Tinos, Cousine, Gelasio, Carlito, Caladea, Lato, Source Sans 3, Source Serif 4, Poppins, Montserrat, Playfair Display and JetBrains Mono, four faces each, subset to DejaVu's coverage — are embedded in the module, since a page's body text cannot wait for a fetch the way a CJK glyph can. Release web builds before and after, same toolchain:

ModuleRaw bytesGzip bytes
Before (cea51ef)26,185,46310,397,794
After31,146,89013,282,437
Change+4,961,427 (+18.9%)+2,884,643 (+27.7%)

The fifty-two font files are 4,583,364 raw / 2,762,660 gzip of that; the rest is their advance table (6,700 lines of (codepoint, advance) pairs) and the alias resolver. A text-scripts-only subset would have saved under 8%, so the symbol blocks were kept. Moving the web faces to the on-demand pack (drawing in DejaVu at the face's own advances until each file arrives) is the lever if the module must shrink.

Runtime, measured in Node on this build with the pack installed: painting eight colour emoji in a fresh renderer (so every glyph is rasterized from its COLR paint graph) takes 2.7, 4.1 and 7.2 ms p50 at 16, 24 and 48 px, and the colour face costs nothing to load (it is parsed lazily, not prepared by fontdue). The first frame needing a bold CJK face pays the same fontdue preparation as the regular one (~350 ms for SC bold, first use only). Latin rows and all other pinned frames are unchanged.

A first build embedded each Noto face twice (1.23 MB of fonts for 0.72 MB of files): include_bytes! behind a const is re-materialized at every inlined use site. The faces are now in statics, which have one address; cw-render puts the native pack in statics for the same reason.

Loading a pack face is the one runtime cost: fontdue prepares every outline of a face when it is first used. Measured in Node on this build, the first frame that needs emoji, Hangul or Han takes about 34, 106 and 174 ms and grows memory by about 26, 46 and 60 MiB; the embedded scripts take 3–11 ms the first time, and every later frame is sub-millisecond. Latin text pays nothing: it takes the original table path, and no pinned frame hash moved.

Bundle size, before and after. The Wasm had grown to 22,136,038 raw / 13,813,875 gzip (the previous revision of this table recorded 22,104,977 / 13,804,622) once eleven font faces, symbol sheets and icon/wallpaper assets were embedded — 8.3x the 1,664,137 gzip it was before the shell work. It is now 2.8x smaller gzipped. Where the bytes went, as raw / standalone gzip -9:

ComponentBeforeAfterChange
Wallpapers (5)9,293,680 / 9,240,8191,765,706 / 1,751,728PNG → baseline JPEG q92 4:4:4, same dimensions
DejaVu faces (3)1,811,780 / 940,395717,820 / 404,395subset to the reachable coverage set
Platform UI fonts (8)203,612 / 127,998203,612 / 127,998unchanged; already subset
Icons570,094 / 567,725 (90)686,517 / 684,153 (105)+15 new music/maps/weather icons
Symbol masks (98)88,604 / 91,32488,604 / 91,324unchanged
Wasm code section7,979,322 / 2,472,8785,810,481 / 1,625,158opt-level="z" + fat LTO, raster path kept at 3
Wasm name section1,410,209 / 141,9030strip="symbols"
Whole module22,136,038 / 13,813,87510,083,313 / 4,932,659

Wallpapers were the headline, not fonts: they were photographic images stored as PNG, which is already DEFLATE, so gzip could not compress them at all. They made up two thirds of the download. JPEG keeps them at 35–54 dB PSNR. Font subsetting and the compiler flags each saved roughly 0.5–0.85 MB gzip.

What moved, and what did not:

  • Pixels. Every frame that shows a wallpaper changed, because the decoded wallpaper pixels changed. Native and Wasm still agree bit for bit: a check that renders all five OS themes in Wasm and then re-renders them natively from the Wasm checkpoint matches every hash. The decoder is jpeg-decoder with its platform_independent feature, which compiles out the SSSE3/NEON/simd128 kernels that are not bit-identical to the scalar ones, and the wallpapers are 4:4:4 so its floating-point chroma upsampler never runs. wallpapers_decode_to_pinned_pixels pins each decoded wallpaper's SHA-256. No text glyph moved: subsetting keeps outlines and advances, the renderer's pinned frame hashes and the Node smoke check's fixture hash are unchanged, and the font metric tables needed no regeneration.
  • Unsupported scripts. Text in a script outside the DejaVu coverage set (Hebrew, Arabic, Thai, CJK and others) rendered as the .notdef box after this change. The complex-script work above restored Hebrew, Arabic and Thai and added Devanagari, CJK and emoji through Noto faces; scripts no bundled face covers (Georgian, Armenian, Ethiopic, Bengali, …) still draw the box, and a test pins that.
  • Speed. Compiling for size costs Wasm speed. The raster path (cw-render and its PNG/JPEG/font decoders) is kept at opt-level 3, but scene construction, services and the kernel are now at z. A warm 960×640 desktop render() in Node, including scene construction, takes about 70 ms p50, against about 50 ms at opt-level 3 throughout and about 88 ms at z throughout. The browser timings earlier in this document were measured on the opt-level-3 bundle. Raster-only rows should still hold, but anything that includes world stepping or scene construction should be re-measured. The build records the options:
    Wasm buildGzip bytesDesktop render() p50
    opt-level 3 everywhere6,004,786~50 ms
    opt-level z everywhere4,906,012~88 ms
    z, raster path at 3 (shipped)4,931,475~70 ms
    z, raster and scene building at 35,369,981~50 ms
  • wasm-opt is not used. With binaryen 119, -Oz, -Os and -O2 all shrank the raw module by 0.7–1.0 MB but made the gzipped download 150–160 KB larger. The build does not need binaryen installed.

Levers left, with their cost: the Ubuntu icons are byte-for-byte 256×256 Yaru copies, 46% of icon bytes for a fifth of the icons (about 200 KB would come back at 128×128, at the cost of no longer being unmodified upstream artwork). A zopfli repack of the icon and symbol PNGs would save about 15% of their bytes with identical pixels, but committed PNGs would then no longer be the icon generator's output byte for byte. Wallpapers are stored at 1586×992 and 853×1844. That is about 1.2x the largest desktop viewport rendered in the engine's own tests (1280×800) and over 2x the phone viewports. Downscaling would save roughly 0.6 MB, but a large viewport would lose sharpness.

Browser linear memory grew from 19 MiB to 20.56 MiB across five create/1,100-step/free cycles; Wasm memory retains its high-water allocation after handles are freed. That is a bounded sample, not proof of zero growth over all workloads. Native 1 / 100 / 1,000 independent, unrendered company worlds occupied 3.42 / 27.34 / 244.68 MiB RSS and took 2.73 / 27.79 / 272.25 ms total to create in one serial trial each. RSS after dropping them retained allocator pages; no claim of OS page reclamation is made.

Structured observation versus a pixel pipeline#

The shape that matters for episode throughput: scene() is cheaper than render() by orders of magnitude, and both are cheaper than a screenshot pipeline by more still. On the 100-text-node fixture above, scene construction is 10.560 µs and a warm full 1280×720 raster is 522 µs — roughly 50×, on a fixture chosen to stress text, not a full desktop. Against a browser, the end-to-end capture rows show the larger gap: 12.8–15.2 ms for the Wasm paths versus 35.0 ms for DOM update plus a Chrome PNG capture.

An agent that acts on scene() and never rasterizes pays neither the raster nor the capture cost. EnvironmentConfig makes that a grant decision, not a convention: withhold pixels.v1, keep semantic.v1, and rasterization is unreachable. See action families.

Reported by a consumer porting an existing agent stack onto this library, on their own hardware and their own workload: per-episode wall time 7.07 s → 0.0158 s (60.2 episodes/s), env.scene(w, h) at 0.41 ms against 223 ms for the pixel pipeline they replaced, a 1280×800 desktop render at 4.1 ms, and two external processes per episode down to zero. These are not our measurements. They are a different host, a different world, and a full desktop scene rather than the text fixture above, so they are not comparable row-for-row with the tables here and are not reproduced by the benchmark suite. There is no episode-throughput benchmark in it; the closest supported statement this report can make is the per-operation actor-step cost in the native world table. The process count is structural rather than measured: no binding spawns a subprocess or requires a simulation server, which the engine's boundary check enforces.

A GPU view of many machines#

This section answers one question. Can a browser tab zoom over thousands of simulated computers without lag, and what limits it? The view is the WebGPU wall in benchmarks/gpu-wall/ (rendering describes its two paths). We ran node benchmarks/gpu-wall.mjs and wrote the results to benchmarks/results/gpu-wall.json.

Conditions. We measured on 2026-11-14 on gb10-direct: 20 Arm cores, 120 GB of unified memory, and an NVIDIA GB10 through Vulkan. Chromium reports the adapter as ANGLE (NVIDIA, Vulkan 1.4.312 (NVIDIA NVIDIA GB10 (0x00002E12)), NVIDIA-580.178.4.0), with WebGPU "Hardware accelerated" and vendor nvidia, not SwiftShader. The browser was Chromium 156.0.8078.47, headful in Xvfb at a 1920×1080 viewport, at device pixel ratio 1. The flags were --enable-unsafe-webgpu --enable-features=Vulkan --use-angle=vulkan --disable-gpu-vsync --disable-frame-rate-limit. Headless Chromium on that host gave no adapter, or SwiftShader, and the runner refuses a fallback adapter. The host was shared with other agents (load average 2 to 12). The wall shows 8 distinct real machines, repeated to reach N. They are six desktops on three operating systems (a terminal, Slack, Excel, GIMP, VS Code debugging, KiCad) and the two phones of the texting scene. Each machine is booted from the site's cast and opened by its scene, as the front page does it. Each wall machine has its own atlas cell and its own instance record. Only the rasters and the scenes are shared.

Frame time. A sweep is 600 frames. It zooms from the whole wall to one machine at native pixels, pans across, and zooms out again. "Hold" is 300 frames with the whole wall in view. The frame time is the interval between requestAnimationFrame callbacks, with vsync off. The GPU time is the time of the one render pass, from timestamp queries. All values are milliseconds, p50 / p95.

NPathSweep frameSweep GPU passHold frameHold GPU passInstances (hold)
100texture0.41 / 0.810.04 / 0.050.43 / 0.860.04 / 0.04108
100vector0.36 / 0.740.10 / 0.110.40 / 0.770.10 / 0.1026,187
100mixed0.40 / 0.770.05 / 0.110.36 / 0.770.10 / 0.1126,187
100canvas per machine1.11 / 2.10—1.12 / 1.66——
1,000texture0.30 / 0.670.07 / 0.120.41 / 0.830.11 / 0.121,008
1,000vector0.39 / 0.690.13 / 0.260.42 / 0.780.17 / 0.28212,688
1,000mixed0.43 / 0.850.12 / 0.300.41 / 0.730.17 / 0.38212,688
1,000canvas per machine18.67 / 35.59—17.01 / 18.54——
3,000canvas per machine151.29 / 158.84—140.81 / 147.63——
10,000texture0.37 / 0.700.10 / 0.120.39 / 0.660.11 / 0.1210,057
10,000vector0.45 / 0.800.37 / 0.610.54 / 0.920.59 / 0.62879,838
10,000mixed0.39 / 0.690.39 / 0.580.57 / 0.930.59 / 0.61879,838

"Canvas per machine" is the site's way: one <canvas> for each machine, filled once with putImageData, and the wall moved by a CSS transform on the canvases' container. Nothing was redrawn. We did not try it at 10,000, because that is about 34 GB of canvas backing stores (3.42 MB is the mean of the 8 machines).

Every WebGPU row is at Chromium's own frame loop floor of 0.3 to 0.6 ms, so the frame time does not separate the paths. The GPU pass time does: the vector path costs about five times the texture path at 10,000 machines, and its worst pass is still 0.64 ms. "Mixed" uses the texture path while a desktop is at least 192 px wide on screen, and the vector path below that. In the sweep it took the texture path in 275 to 481 of the 600 frames. The canvas per machine way is 2.7 times slower than the floor at 100 machines, 45 times at 1,000, and about 370 times at 3,000. Pan and zoom rasterize nothing on any path. The only per-frame write is the 48-byte camera, plus, on the vector path, the list of visible machines (at most 40 KB).

GPU memory.

StoreSizeFor N distinct machines
Full layer: 1280×896 RGBA with 10 mips6.12 MB per resident machine8 here = 48.9 MB. At 1,000 distinct machines it would be 6.1 GB, so it is not a per-machine budget (see open work)
Thumbnail atlas: 8192² with 3 mips, 80×56 cells356.5 MB for 14,892 cells23.9 KB a machine. 10,000 machines fit in one atlas
Vector instances: 5 LOD levels, room to double56.6 KB per distinct machine (mean)10,000 = 566 MB with that room, 283 MB without it

The budget we chose is a thumbnail for every machine and a full layer for each resident machine. The full layers are what grows. The texels that a frame can show are bounded by the screen (1920×1080×4 B ×4/3 per level of detail), not by N. So a residency cache that holds full layers only for the machines that are large on screen keeps the texture path near the size of the atlas. This spike does not build that cache.

What one machine change costs. A change is one pointer move to a random place. The values are p50 over 10 moves of each machine, in milliseconds. scene() is what the vector path reads. render is the renderInto that the texture path needs on top of it.

MachineNodesstepscene()Instance buildrender (CPU raster)Damage box (px)
Ubuntu terminal1211.362.640.244.4591,530
Windows Slack64920.0314.290.5675.4872,659
Windows Excel5373.959.730.504.3586,240
Ubuntu GIMP29443.2049.310.45175.38351,968
macOS VS Code debugging6563.3812.050.6322.21179,816
Ubuntu KiCad7365.7712.780.7839.13222,720
iPhone Messages671.031.430.110.680
Pixel Messages710.881.440.100.640

The texture path then uploads the layer. Across a batch of 80, one full layer (3.42 MB mean) with its mip chain cost 1.20 ms, and 1.15 ms of that was the CPU's writeTexture. The vector path uploads its instances (56.6 KB) in 0.026 ms. A single upload timed alone to onSubmittedWorkDone costs 1.5 to 5.0 ms for a full layer and 0.75 to 2.85 ms for an 80×56 thumbnail copy of 18 KB, so that time is mostly the round trip. Damage uploads are not worth it as built. The engine's environment does not expose the damage rectangles that ScenePatch computes. Finding the box by comparing two frames costs 0.27 to 0.89 ms. A pointer move's box spans the old and the new cursor, so it was 72,659 to 351,968 px. Uploading only that box saved 0.8 to 3.1 ms of round trip, not bandwidth. The phones drew no pointer, so their frames did not change.

How far the vector path is from the raster. We drew each machine at 1:1 and compared it with its CPU raster. The texture path matched on every pixel of all 8 machines. The vector path matched 45 to 89% of pixels exactly. Its mean absolute error was 7.0 to 33.1 per channel (Messages 7.0 to 7.4, Excel 7.0, Slack 7.8, terminal 8.4, VS Code 11.7, GIMP 13.8, KiCad 33.1: the board view is paths and images). Text is bars and icons are mean colours, so at 1:1 the vector path is a schematic of the screen. It is not the screen. At the zoom where mixed hands over to it (a desktop under 192 px wide, at most 0.15 of native size), a glyph is under 2 px high. gpu-wall-*-vector.png and gpu-wall-*-texture.png in benchmarks/results/ show a terminal and a phone both ways.

How many live machines a tab can simulate. A tick is one pointer move (step) and one scene() of the machine. One worker is one Wasm instance, and wasm32 stops it at 4 GiB.

  • A world for every scene (the site's model, with the scene opened in its app). Each world grew the instance by 44 MB. One worker held 96 worlds (109 machines) and then trapped (unreachable) at 4 GiB. Across 24 machines, a tick cost step 3.72 / 43.94 ms and scene() 12.25 / 50.08 ms, p50 / p95, with 537 nodes p50.
  • One world with many machines (copies of the five reference machines at their home screens, 62 to 92 nodes). 100 machines took 307 MiB and 1,000 took 2,426 MiB. 2,000 stopped at 4 GiB. A tick cost step 0.34 ms and scene() 1.03 ms. Creating the environments took about 55 ms a machine (5.5 s for 100).
  • Workers in one tab do not add up. Ticks a second over 100 home-screen machines a worker: 1 worker 693, 2 workers 1,141, 4 workers 937, 8 workers 717, 16 workers 646. The mean step stayed at 0.34 to 0.54 ms, but the mean scene() went from 1.09 to 3.83 ms (4 workers), 10.6 ms (8) and 23.9 ms (16). The same workload in separate tabs, on separate loopback hosts and so in separate renderer processes, adds up: 1 tab 712, 2 tabs 1,428, 4 tabs 2,766, 8 tabs 5,355, 16 tabs 8,488 ticks a second (scene() 1.07 to 1.40 ms). The contention is inside one renderer process and inside scene(), which builds a JavaScript object graph of the scene. We did not identify the cause. One hypothesis is V8 allocation shared by the isolates of one process, and a scene() that returns bytes would test it.

At 10 updates a second for each machine, one tab keeps about 114 home-screen machines live. Sixteen processes keep about 850. Machines opened in real applications cost 16 ms a tick, which is about 6 machines a worker. Drawing is not the limit. Simulation is. The GPU draws 10,000 machines in under 0.65 ms. The engine keeps a few hundred live in one tab at a useful rate. So the vector path's value is real but small: on a change it saves the raster (0.6 to 175 ms) and a 3.4 MB upload. It still pays scene(), which is 1.4 to 49 ms and the larger cost on most machines. For a wall that changes rarely, the texture path and its thumbnails are cheaper to draw and exact.

Open work. This list is where it is recorded.

  • Vector text: glyphs from the bundled fonts in an atlas (or as MSDF), placed by cw_scene::text::layout, instead of bars.
  • Damage uploads: expose ScenePatch's damaged rectangles from the environment, so that an upload is the changed rectangles and not a frame diff's bounding box.
  • Residency: a full-layer cache sized to what is on screen (above), so that the texture path's memory follows the screen and not N.
  • A Rust backend with wgpu, shared with native, that builds the instances from cw_scene::Scene in Rust. The same code would then draw natively, and the scene would not have to cross into JavaScript only to be flattened.
  • Wiring into the site: WebGPU on an OffscreenCanvas in the workers, in place of a canvas for each machine.
  • The worker contention of scene() above, and wasm32's 4 GiB for each instance (44 MB a scene world, 2.4 MB a machine in a shared world).
  • Limits of the vector path: transforms are reduced to their bounding boxes (rotations are not drawn rotated), shadows use a smoothstep and not three box blurs, and backdrops are not blurred.

Limits and next measurements#

This is a single ARM64 host and single pinned performance core. No release target or claim applies universally to x86, mobile or other browser engines. Quiet windows remove project builds/tests, not every unrelated host process. Per-run min/max p50 and all raw samples are in the summary; median tables do not hide run-zero warmup variability in the source data. No allocator event count, hardware counter profile, multithread throughput or full CSS/browser fidelity is claimed.

The next useful work is reducing full-frame Wasm boundary copies, sharing parsed immutable font data across renderers, measuring large populated snapshots and traces, and extending the fair migrated-screen corpus. The 3× predecessor capture goal remains open; it must not be substituted with the separate 3.11× native before/after improvement.

Conditions#

Performance captures were not run concurrently with builds, tests or other benchmark processes. All data is local; Chrome only serves static package assets, and the simulator uses its synthetic network. Python and Node bindings use the same Rust runtime, without a simulation subprocess per step.