Requirements#

This section contains the requirements for the WRT project.

Functional Requirements#

Requirement: Resumable Interpreter REQ_001
status: implemented

The interpreter shall be resumable, allowing operation with fuel or other implementations of bounded run-time that require the interpreter to be halted and later resumed as if it was not halted.

Requirement: Baremetal Support REQ_002
status: planned
links incoming: REQ_006

The interpreter shall be executable on bare-metal environments with no reliance on any specific functionality from the provided execution environment, as it shall be ready for embedding to any environment that Rust can compile for.

Requirement: Bounded Execution REQ_003
status: implemented

The interpreter shall yield back control flow eventually, allowing users to call the interpreter with a bound and expect a result in a finite amount of time or bytecode operations, even if the bytecode itself never finishes execution.

Requirement: State Migration REQ_004
status: planned
links incoming: REQ_008

The interpreter state shall be able to halt on one computer and continue execution on another, enabling various workflows in deployments of multiple computers for load-balancing or redundancy purposes.

Requirement: WebAssembly Component Model Support REQ_014
status: planned

The interpreter shall implement the WebAssembly Component Model Preview 2 specification, including: - Component model validation - Resource type handling - Interface types - Component instantiation and linking - Resource lifetime management - Custom section handling - Component model binary format parsing

Requirement: Component Model Binary Format REQ_021
status: partial
links outgoing: REQ_014

The interpreter shall strictly implement the WebAssembly Component Model binary format as specified in the official WebAssembly Component Model specification at WebAssembly/component-model, including:

  • Magic bytes (0x00, 0x61, 0x73, 0x6D) followed by version (0x0D, 0x00, 0x01, 0x00)

  • Component sections with proper section IDs

  • Type section encoding with canonical type representation

  • Import section handling with component, instance, and function imports

  • Core module sections including validation and embedding

  • Component instances section with proper instance creation

  • Export section with named exports and index references

  • Component custom sections for metadata and tooling

  • Canonical ABI encoding/decoding for interface values

  • LEB128 encoding for integers and field counts

Requirement: WASI Logging Support REQ_015
status: partial

The interpreter shall implement the WASI logging API as specified in the wasi-logging proposal, providing: - Support for all defined log levels (Error, Warn, Info, Debug, Trace) - Context-based logging - Stderr integration - Thread-safe logging operations

Requirement: Platform-Specific Logging REQ_016
status: planned
links outgoing: REQ_015
links incoming: SPEC_004

The WASI logging implementation shall provide platform-specific backends: - Linux: syslog integration with proper facility and priority mapping - macOS: Unified Logging System (os_log) integration - Generic fallback implementation for other platforms

Low-Level Functional Requirements#

Requirement: Stackless Implementation REQ_005
status: implemented
links outgoing: REQ_001
links incoming: SPEC_002, IMPL_004

The interpreter shall be stackless, storing the stack of the interpreted bytecode in a traditional data structure rather than using function calls in the host environment.

Requirement: No Standard Library REQ_006
status: implemented
links outgoing: REQ_002
links incoming: SPEC_002

The interpreter shall be implemented in no_std Rust, only relying on functionality provided by no_std to enable execution on bare environments where no operating system is available.

Requirement: Fuel Mechanism REQ_007
status: implemented
links outgoing: REQ_003
links incoming: SPEC_006, SPEC_002, IMPL_001

The interpreter shall support fuel bounded execution, where each bytecode instruction is associated with a specific amount of fuel consumed during execution.

Requirement: State Serialization REQ_008
status: planned
links outgoing: REQ_004

The interpreter state shall be de-/serializable to enable migration to other computers and support check-point/lock-step execution.

Requirement: WebAssembly Core Implementation REQ_018
status: partial
links outgoing: REQ_014
links incoming: SPEC_001, IMPL_002, IMPL_003

The interpreter shall implement the WebAssembly Core specification, including: - Value types and reference types - Instructions and control flow - Function calls and tables - Memory and data segments - Global variables - Exception handling - SIMD operations - Threading support

Requirement: Component Model Implementation REQ_019
status: partial
links outgoing: REQ_014
links incoming: SPEC_003, IMPL_005, IMPL_006

The interpreter shall implement the Component Model specification, including: - WIT format parsing and validation - Component model binary format parsing - Resource type implementation - Interface type handling - Component instantiation - Component linking - Resource lifetime management

Dependency Requirements#

Requirement: Logging Support REQ_009
status: implemented

The interpreter shall have an optional dependency on the log crate version 0.4.22 for observability and debugging purposes.

Requirement: Math Library REQ_010
status: planned

The interpreter may depend on the libm crate version 0.2.8 for floating-point operations required in no_std environments.

Requirement: Rust Version REQ_011
status: implemented

The interpreter shall compile on Rust 1.76.0 and later versions.

Requirement: Component Model Tools REQ_020
status: partial
links outgoing: REQ_014
links incoming: SPEC_003

The interpreter shall use the following tools for Component Model development: - wit-parser >= 0.12.0 for WIT file parsing and validation - wit-bindgen >= 0.12.0 for interface generation - wit-component >= 0.12.0 for component model binary format handling

Observability Requirements#

Requirement: Instrumentation Support REQ_012
status: partial
links incoming: REQ_013

The interpreter shall implement means for instrumentation to support certification evidence generation, debugging, and run-time monitoring.

Requirement: Coverage Measurement REQ_013
status: partial
links outgoing: REQ_012

The instrumentation shall enable the measurement of:

  • Statement coverage (DO-178C DAL-C)

  • Decision coverage (DO-178C DAL-B)

  • Modified condition/decision coverage (DO-178C DAL-A)

Implementation Status#

ID

Title

Status

REQ_001

Resumable Interpreter

implemented

REQ_002

Baremetal Support

planned

REQ_003

Bounded Execution

implemented

REQ_004

State Migration

planned

REQ_005

Stackless Implementation

implemented

REQ_006

No Standard Library

implemented

REQ_007

Fuel Mechanism

implemented

REQ_008

State Serialization

planned

REQ_009

Logging Support

implemented

REQ_010

Math Library

planned

REQ_011

Rust Version

implemented

REQ_012

Instrumentation Support

partial

REQ_013

Coverage Measurement

partial

REQ_014

WebAssembly Component Model Support

planned

REQ_015

WASI Logging Support

partial

REQ_016

Platform-Specific Logging

planned

REQ_018

WebAssembly Core Implementation

partial

REQ_019

Component Model Implementation

partial

REQ_020

Component Model Tools

partial

REQ_021

Component Model Binary Format

partial

Requirement Relationships#

@startuml

' Nodes definition 

node "<size:12>Requirement</size>\n**Resumable**\n**Interpreter**\n<size:10>REQ_001</size>" as REQ_001 [[../requirements.html#REQ_001]] #BFD8D2
node "<size:12>Requirement</size>\n**Baremetal**\n**Support**\n<size:10>REQ_002</size>" as REQ_002 [[../requirements.html#REQ_002]] #BFD8D2
node "<size:12>Requirement</size>\n**Bounded**\n**Execution**\n<size:10>REQ_003</size>" as REQ_003 [[../requirements.html#REQ_003]] #BFD8D2
node "<size:12>Requirement</size>\n**State Migration**\n<size:10>REQ_004</size>" as REQ_004 [[../requirements.html#REQ_004]] #BFD8D2
node "<size:12>Requirement</size>\n**Stackless**\n**Implementation**\n<size:10>REQ_005</size>" as REQ_005 [[../requirements.html#REQ_005]] #BFD8D2
node "<size:12>Requirement</size>\n**No Standard**\n**Library**\n<size:10>REQ_006</size>" as REQ_006 [[../requirements.html#REQ_006]] #BFD8D2
node "<size:12>Requirement</size>\n**Fuel Mechanism**\n<size:10>REQ_007</size>" as REQ_007 [[../requirements.html#REQ_007]] #BFD8D2
node "<size:12>Requirement</size>\n**State**\n**Serialization**\n<size:10>REQ_008</size>" as REQ_008 [[../requirements.html#REQ_008]] #BFD8D2
node "<size:12>Requirement</size>\n**Logging Support**\n<size:10>REQ_009</size>" as REQ_009 [[../requirements.html#REQ_009]] #BFD8D2
node "<size:12>Requirement</size>\n**Math Library**\n<size:10>REQ_010</size>" as REQ_010 [[../requirements.html#REQ_010]] #BFD8D2
node "<size:12>Requirement</size>\n**Rust Version**\n<size:10>REQ_011</size>" as REQ_011 [[../requirements.html#REQ_011]] #BFD8D2
node "<size:12>Requirement</size>\n**Instrumentation**\n**Support**\n<size:10>REQ_012</size>" as REQ_012 [[../requirements.html#REQ_012]] #BFD8D2
node "<size:12>Requirement</size>\n**Coverage**\n**Measurement**\n<size:10>REQ_013</size>" as REQ_013 [[../requirements.html#REQ_013]] #BFD8D2
node "<size:12>Requirement</size>\n**WebAssembly**\n**Component Model**\n**Support**\n<size:10>REQ_014</size>" as REQ_014 [[../requirements.html#REQ_014]] #BFD8D2
node "<size:12>Requirement</size>\n**WASI Logging**\n**Support**\n<size:10>REQ_015</size>" as REQ_015 [[../requirements.html#REQ_015]] #BFD8D2
node "<size:12>Requirement</size>\n**Platform-**\n**Specific**\n**Logging**\n<size:10>REQ_016</size>" as REQ_016 [[../requirements.html#REQ_016]] #BFD8D2
node "<size:12>Requirement</size>\n**WebAssembly**\n**Core**\n**Implementation**\n<size:10>REQ_018</size>" as REQ_018 [[../requirements.html#REQ_018]] #BFD8D2
node "<size:12>Requirement</size>\n**Component Model**\n**Implementation**\n<size:10>REQ_019</size>" as REQ_019 [[../requirements.html#REQ_019]] #BFD8D2
node "<size:12>Requirement</size>\n**Component Model**\n**Tools**\n<size:10>REQ_020</size>" as REQ_020 [[../requirements.html#REQ_020]] #BFD8D2

' Connection definition 

REQ_005 --> REQ_001
REQ_006 --> REQ_002
REQ_007 --> REQ_003
REQ_008 --> REQ_004
REQ_013 --> REQ_012
REQ_016 --> REQ_015
REQ_018 --> REQ_014
REQ_019 --> REQ_014
REQ_020 --> REQ_014

@enduml