On this page

0098: Fuel and deadlines are platform policy; native fuel

Status: Accepted (default; pending owner confirmation)

Amends ADR-0017 and ADR-0079.

Context

ADR-0017 defines deterministic fuel charges in the interpreter and ADR-0079 adds bounded heap and output for pure generator execution. M10 needs policies that can also bound native execution while keeping the ordinary cli platform unchanged.

Decision

Platform [policy] declares fuel, heap, output and deadline_ms. The cli platform leaves all limits off, so existing native programs gain no fuel checks. Generators use an embedded internal generator policy with the existing ADR-0079 fuel, heap and output values; manifests cannot override it, and its deadline remains off. The agent platform may consume these policies when introduced.

When fuel is enabled, native code charges at function entries and loop heads, using exactly ADR-0017's charge points so fuel exhaustion locations match the interpreter. A configured deadline is a separate deadline exceeded trap, checked every 4,096 fuel charges. Deadline behavior is wall-clock dependent and is not required to match between backends; fuel semantics remain deterministic.

Alternatives considered

Consequences

Platform policy unifies resource limits across backends while preserving the existing cli output and generator bounds. Any native fuel implementation must preserve ADR-0017's exact charge points; deadline tests assert bounded termination, not backend parity.