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/plans/2026-07-16-automatic-host-binding-selection.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
@@ -67,7 +67,7 @@ Run the narrow host/JIT tests. Expected: generated code still selects `bind_stat
67
67
Add `HostBindingKind::{StaticStack, StaticArgs, StaticNonYieldingArgs}` in `build.rs`. Classify in this order:
68
68
69
69
1. any `Vm` parameter → `StaticStack`;
70
-
2. normalized `CallOutcome`, including `VmResult<CallOutcome>`and `HostResult<CallOutcome>`→ `StaticArgs`;
70
+
2. normalized `CallOutcome`, including `VmResult<CallOutcome>` → `StaticArgs`;
71
71
3. all other valid args-only returns → `StaticNonYieldingArgs`.
72
72
73
73
Use that one classification in generated registry and direct VM binding code. The non-yielding branches must emit `register_static_non_yielding_args` and `bind_static_non_yielding_args_function`.
Copy file name to clipboardExpand all lines: docs/superpowers/specs/2026-07-16-automatic-host-binding-selection-design.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -13,10 +13,10 @@ This change covers `#[pd_host_function]` implementations discovered by the RustS
13
13
Introduce one shared build-time classification with these ordered rules:
14
14
15
15
1. A function with a `Vm` context parameter uses `StaticStack`.
16
-
2. An args-only function whose normalized return type is `CallOutcome`, including `VmResult<CallOutcome>` and `HostResult<CallOutcome>`, uses `StaticArgs`.
16
+
2. An args-only function whose normalized return type is `CallOutcome`, including `VmResult<CallOutcome>`, uses `StaticArgs`.
17
17
3. Every other valid args-only annotated function uses `StaticNonYieldingArgs`.
18
18
19
-
The third rule is safe because the generated wrapper converts all supported ordinary outputs through `IntoVmValue` into exactly one `Value`. This includes implicit `()`, explicit `()`, and `Option<T>`, which become `Value::Null` when appropriate. `VmResult<T>`and `HostResult<T>`may still return an error; successful calls return exactly one value synchronously.
19
+
The third rule is safe because the generated wrapper converts all supported ordinary outputs through `IntoVmValue` into exactly one `Value`. This includes implicit `()`, explicit `()`, and `Option<T>`, which become `Value::Null` when appropriate. `VmResult<T>` may still return an error; successful calls return exactly one value synchronously.
20
20
21
21
`CallOutcome` stays on the general static args ABI because it can represent no return value, halt, yield, or pending work. Any signature that cannot be classified safely falls back to the general compatible static binding.
0 commit comments