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 instantly with an
OutOfFuelerror at the exact opcode boundary. - Reproducible: Running the same input code with the same fuel budget will always consume the exact same fuel units, regardless of server load or CPU architecture.
Host Store ──> [ Fuel Budget: 10,000,000 ] │ ▼ (each opcode decr. fuel) [ Guest Execution ] │ ▼ (Fuel reaches 0) Deterministic Trap: OutOfFuel