Independent scholarship · Open accessThe monthly digest

Editorially reviewed

Fine-Grained Durable WebAssembly on Cloudflare: Architecture, Recovery Semantics, and Economic Limits

Trace Mesh migrates fuel-bounded WebAssembly continuations across executors using versioned leases and durable checkpoints. QEMU failure-recovery tests and local benchmarks support a cost model for Cloudflare. At ten commits per second, R2 checkpoint writes alone cost USD 112.50 per 30 days, placing the evaluated full-snapshot design outside a USD 50 monthly control-plane budget.

Anonymous← All research

Contribution

Trace Mesh is a prototype for running and migrating fuel-bounded Core WebAssembly jobs across Cloudflare accounts. It separates the lifetime of an executor from the lifetime of a job. The manuscript analyzes the lease protocol used to coordinate executors, verifies failure recovery under QEMU, and derives the operating regimes in which the cost and latency of durable coordination exceed a stated budget or deadline.

Architecture and recovery

A coordinator Worker receives a module, export name, and integer arguments. A SQLite-backed Durable Object stores the authoritative job version, executor lease, and checkpoint reference. Cloudflare Containers run the interpreter and a Node/V8 tracing tier. R2 stores modules, explicit guest state, and portable guarded trace artifacts. The executor submits a checkpoint under its lease and version. The coordinator writes the immutable objects and then checks the lease again inside the transaction that advances the version. An attempt interrupted before publication can be replayed, and a stale executor cannot advance the same version twice. Independent jobs can run in parallel. Each sequential job follows its ordered checkpoint chain.

The prototype supports an import-free, single-threaded integer Core Wasm profile. Its tracing tier compiles eligible i32 paths. Wider i64 state is checkpointed exactly and remains available to the interpreter, including across calls to traced i32 helpers.

Main results and limits

Let $N$ denote guest instructions, $q$ the instruction quantum, and $k=\lceil N/q\rceil$ the number of committed slices. For one executor with one eligible slice per fixed tick interval $\Delta$, the failure-free latency from the first launch satisfies $T\ge (k-1)\Delta$. With $q=2048$ and $\Delta=60$ seconds, a million guest instructions require about eight hours. For one billion guest instructions and a constant 1 MiB allocation, retaining the full hex-encoded memories alone adds approximately 1.024 TB of snapshots.

Under a separate event-driven workload of ten successful checkpoint commits per second for 30 days, the published R2 Standard rate and billing units imply USD 112.50 in checkpoint write charges alone. A USD 50 monthly control-plane budget cannot sustain that rate for the evaluated protocol even with prompt deletion of old checkpoints. The estimates are conditional on the stated protocol, account allowances, prices and workload. Coarser checkpoints, incremental state, and retention bounds change the operating region.

The QEMU migration experiment restores a mixed-width continuation on a second executor after a failure, reuses the first executor's trace for 2,810 instructions, and matches the complete interpreter-only final state. Local microbenchmarks use eleven repetitions per test cell. For a 1 MiB memory snapshot, the encode and decode medians sum to 10.634 ms, versus 0.429 ms for a warm 2,048-instruction local trace. These measurements exclude Cloudflare service latency. The pricing analysis uses published rates. Live cross-account performance and billing classification of the checkpoint transfer remain unmeasured.

Artifacts and disclosure

The attached seven-page PDF is the complete manuscript. The accompanying ZIP includes its LaTeX source, the exact runtime release and QEMU logs, local benchmark code and raw timing data, a pricing calculator, and integrity checksums.

The manuscript and artifact preparation used OpenAI Codex assistance for drafting, software implementation, experimentation, and analysis. The submitting author is listed as Anonymous.

Associated artifacts

Discussion

Open a careful, constructive conversation about this note.

Comments appear after editorial approval.