Deterministic Fuel Metering
When an LLM writes recursive functions or infinite loops (while (true) {}), traditional container runtimes rely on imprecise operating system wall-clock timeouts or CPU cgroup throttling.
Why Wall-Clock Timeouts Fail
Section titled “Why Wall-Clock Timeouts Fail”- Flaky & Variable: On an overloaded server, a legitimate function might take 500ms to complete and get prematurely killed. On an idle server, the same function completes in 50ms.
- Non-Deterministic: Two identical executions can yield different outcomes simply because of background host CPU contention.
- Billing Inaccuracy: Measuring CPU milliseconds makes fair serverless metering difficult.
The WebAssembly Fuel Model
Section titled “The WebAssembly Fuel Model”RunVero implements instruction-level fuel metering directly via Wasmtime:
- Opcode Counting: Every WebAssembly bytecode instruction consumes discrete units of fuel.
- Deterministic Termination: If an execution exhausts its allocated fuel budget (e.g. 10,000,000 units), the Wasmtime engine traps with an
OutOfFuelerror at the instruction boundary. - Reproducible Compute (Within Fixed Inputs): For pure computation on the same compiled component, Wasmtime configuration, and input, fuel consumption is repeatable regardless of background host CPU contention. Tools that read external HTTP responses, clocks, or random bytes can execute different code paths when those external observations change, and an independent wall-clock epoch timeout (
timeout_ms) still bounds host I/O waits.
Host Store ──> [ Fuel Budget: 10,000,000 ] │ ▼ (each opcode decr. fuel) [ Guest Execution ] │ ▼ (Fuel reaches 0) Deterministic Trap: OutOfFuel