You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/FUTURE.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -86,7 +86,7 @@ let b = memory.load_i32(dynamic_offset as usize)?;
86
86
87
87
## 3. Temporal Isolation (Fuel-Based Execution)
88
88
89
-
Spatial isolation (implemented) prevents memory corruption. **Temporal isolation** prevents CPU time starvation — equally critical for safety standards (ISO 26262 requires both).
89
+
Spatial isolation (implemented) prevents memory corruption. **Temporal isolation** prevents CPU time starvation — equally important for systems that need both memory and timing guarantees.
Copy file name to clipboardExpand all lines: docs/REQUIREMENTS.md
+49-52Lines changed: 49 additions & 52 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,11 +15,11 @@ herkos is a compilation pipeline that transforms WebAssembly modules into memory
15
15
16
16
## 2. Problem Statement
17
17
18
-
Industry standards for functional safety (e.g., ISO 26262) and security require **freedom from interference**between software modules of different criticality levels. In practice this means:
18
+
Systems that mix components of different trust or criticality levels require **freedom from interference**— the guarantee that one module cannot corrupt the state of another. In practice this means:
19
19
20
-
-An ASIL-B rated component shall not be able to corrupt the memory of an ASIL-D component
20
+
-A higher-criticality component shall not be corruptible by a lower-criticality one
21
21
- An untrusted third-party library shall be contained so it cannot reach outside its sandbox
22
-
- Modules at different security or safety levels shall have provable isolation boundaries
22
+
- Modules at different trust levels shall have provable isolation boundaries
23
23
24
24
This isolation is typically achieved through hardware mechanisms (MMU, MPU) or hypervisors. While effective, these approaches are:
25
25
@@ -65,10 +65,10 @@ memory.grow instruction adds pages at runtime up to the declared maximum.
65
65
```{req} Compile-Time Memory Sizing
66
66
:id: REQ_MEM_COMPILE_TIME_SIZE
67
67
:status: open
68
-
:tags: memory, no_std, const-generic
69
-
The maximum memory size shall be fixed at compile time via a const generic parameter
70
-
(MAX_PAGES). No heap allocation is permitted for memory backing storage. The entire
71
-
backing array shall be statically sized.
68
+
:tags: memory, no_std, static-sizing
69
+
The maximum memory size for each module shall be fixed at compile time. No heap
70
+
allocation is permitted for memory backing storage. All memory shall be statically
71
+
sized.
72
72
```
73
73
74
74
```{req} Bounds-Checked Memory Access
@@ -84,9 +84,8 @@ an error (WasmTrap::OutOfBounds), never panic or invoke undefined behavior.
84
84
:id: REQ_MEM_GROW_NO_ALLOC
85
85
:status: open
86
86
:tags: memory, memory.grow, no_std
87
-
memory.grow shall not perform heap allocation. Growth is a counter increment plus
88
-
zero-fill of new pages within the pre-allocated backing array. Returns previous
89
-
page count on success, -1 on failure.
87
+
memory.grow shall not perform heap allocation. New pages shall be zero-initialized
88
+
within pre-allocated storage. Returns previous page count on success, -1 on failure.
90
89
```
91
90
92
91
### 4.2 Module Representation
@@ -104,9 +103,9 @@ This distinction is the primary mechanism for spatial isolation.
104
103
:id: REQ_MOD_GLOBALS
105
104
:status: open
106
105
:tags: modules, globals
107
-
Mutable Wasm globals shall be represented as typed struct fields in a generated
108
-
Globals struct. Immutable globals shall be Rust const items. No dynamic lookup
109
-
or enum indirection.
106
+
Mutable Wasm globals shall have statically typed, per-instance storage. Immutable
107
+
globals shall be compile-time constants. Global access shall be resolved statically,
108
+
with no dynamic lookup.
110
109
```
111
110
112
111
```{req} Indirect Call Table
@@ -124,35 +123,35 @@ validate the type signature before dispatch.
124
123
:id: REQ_CAP_IMPORTS
125
124
:status: open
126
125
:tags: imports, traits, capabilities
127
-
Wasm module imports shall become Rust trait bounds on a generic host parameter.
128
-
Each group of related imports maps to one trait. If a module does not import a
129
-
capability, the trait bound shall not exist — no code path to call it.
126
+
Wasm module imports shall be statically checked capabilities. Related imports
127
+
shall be grouped into discrete capability sets. If a module does not import a
128
+
capability, no code path to invoke it shall exist.
130
129
```
131
130
132
131
```{req} Exports as Trait Implementations
133
132
:id: REQ_CAP_EXPORTS
134
133
:status: open
135
134
:tags: exports, traits
136
-
Wasm module exports shall become trait implementations on the transpiled module
137
-
struct. This enables inter-module linking via trait composition.
135
+
Wasm module exports shall be exposed as statically typed interfaces on the
136
+
transpiled module. This shall enable inter-module linking via interface composition.
138
137
```
139
138
140
139
```{req} Zero-Cost Dispatch
141
140
:id: REQ_CAP_ZERO_COST
142
141
:status: open
143
142
:tags: traits, dispatch, performance
144
-
All capability dispatch shall use monomorphization (no vtables, no trait objects
145
-
in the hot path). If a module does not import a capability, zero code for that
146
-
capability is generated.
143
+
Capability dispatch shall incur zero runtime overhead compared to direct function
144
+
calls. If a module does not import a capability, no code for that capability shall
145
+
be generated.
147
146
```
148
147
149
148
```{req} WASI Support via Standard Traits
150
149
:id: REQ_CAP_WASI
151
150
:status: open
152
151
:tags: wasi, imports, traits
153
-
WASI (WebAssembly System Interface) support shall be implemented as a standard
154
-
set of traits (WasiFd, WasiPath, WasiClock, WasiRandom, etc.) shipped by
155
-
herkos-runtime. The host implements whichever subset it supports.
152
+
WASI (WebAssembly System Interface) support shall be provided as a standard set
153
+
of capability interfaces shipped with the runtime. The host provides whichever
154
+
subset it supports.
156
155
```
157
156
158
157
### 4.4 Transpilation
@@ -161,26 +160,25 @@ herkos-runtime. The host implements whichever subset it supports.
161
160
:id: REQ_TRANS_FUNCTIONS
162
161
:status: open
163
162
:tags: transpilation, functions
164
-
Each Wasm function shall be transpiled to a Rust function. Module state (memory,
165
-
globals, table) is threaded through as parameters. Capabilities become trait bounds
166
-
on a generic host parameter.
163
+
Each Wasm function shall be transpiled to a Rust function with explicit access to
164
+
module state (memory, globals, table) and granted capabilities.
167
165
```
168
166
169
167
```{req} Control Flow Mapping
170
168
:id: REQ_TRANS_CONTROL_FLOW
171
169
:status: open
172
170
:tags: transpilation, control-flow
173
-
Wasm control flow (block, loop, if, br, br_if, br_table) shall map to Rust control
174
-
flow structures using labeled blocks and breaks. No goto or unsafe control flow.
171
+
Wasm control flow (block, loop, if, br, br_if, br_table) shall map to safe Rust
172
+
control flow structures. No goto or unsafe control flow.
175
173
```
176
174
177
175
```{req} Safe Indirect Call Dispatch
178
176
:id: REQ_TRANS_INDIRECT_CALLS
179
177
:status: open
180
178
:tags: transpilation, indirect-calls, safety
181
-
Indirect calls (call_indirect) shall use static match dispatch over function indices,
182
-
not function pointers, vtables, or dynamic dispatch. The match enumerates all
183
-
functions matching the expected type signature. 100% safe Rust.
179
+
Indirect calls (call_indirect) shall be dispatched using only safe Rust — no
180
+
function pointers, no unsafe dispatch. The dispatch mechanism shall validate type
181
+
signatures and enumerate only functions matching the expected type.
184
182
```
185
183
186
184
```{req} Structural Type Equivalence
@@ -189,7 +187,7 @@ functions matching the expected type signature. 100% safe Rust.
189
187
:tags: transpilation, types
190
188
Type checks in call_indirect shall use structural equivalence: two type indices
191
189
match if they have identical parameter and result types, regardless of index.
192
-
The transpiler shall build a canonical type index mapping at transpile time.
190
+
Type equivalence shall be resolved at transpile time.
193
191
```
194
192
195
193
```{req} Self-Contained Output
@@ -206,8 +204,7 @@ only Result<T, WasmTrap> for error handling.
206
204
:status: open
207
205
:tags: transpilation, determinism
208
206
Generated output shall be identical regardless of CPU, thread count, execution order,
209
-
or random seed. No non-deterministic collection types (e.g., HashMap iteration order).
210
-
Enables reproducible builds and auditable output.
207
+
or random seed. Enables reproducible builds and auditable output.
211
208
```
212
209
213
210
### 4.5 Error Handling
@@ -216,9 +213,10 @@ Enables reproducible builds and auditable output.
216
213
:id: REQ_ERR_TRAPS
217
214
:status: open
218
215
:tags: error-handling, traps
219
-
Wasm traps shall map to a WasmTrap enum returned as Result::Err. Trap types:
0 commit comments