Skip to content

feat(falcon-rate): WASI-free component + through-wasm closed-loop proof#314

Merged
avrabe merged 1 commit into
mainfrom
feat/falcon-rate-wasi-free-loop-proof
Jul 23, 2026
Merged

feat(falcon-rate): WASI-free component + through-wasm closed-loop proof#314
avrabe merged 1 commit into
mainfrom
feat/falcon-rate-wasi-free-loop-proof

Conversation

@avrabe

@avrabe avrabe commented Jul 23, 2026

Copy link
Copy Markdown
Contributor

The falcon-rate worked example for the jess consumption contract (jess#167). Verify-before-build paid off: the real typed seam already existed (falcon:cascade rate.tick(vehicle-state, rate-setpoint) -> torque-setpoint, wrapping RatePid) and a native closed-loop convergence test already existed (rate_p03). Two things were genuinely missing.

1. WASI-free build (so it lowers to bare metal)

The cargo-component build pulled std (via thread_local!) → 10 WASI imports, which don't lower to the M4/M7/F100 targets (synth → gale). Converted the component to no_std on the cargo-component path — single-threaded statics instead of thread_local!, lol_alloc global allocator, panic handler — all gated to not(feature = "bazel-bindings") so the Bazel/std path is untouched.

Result — imports drop from 10 (incl. all WASI) to one:

world root {
  import falcon:cascade/types@0.7.0;   // type-only
  export falcon:cascade/rate@0.7.0;
}

A pure transformer that lowers cleanly and a WASI-less host can drive directly. (Thanks to the "you can do this without WASI" steer.)

2. Loop-complete proof THROUGH the wasm seam

tests/rate-loop-proof is a minimal WASI-less wasmtime host that closes the control loop across the real WIT boundary: plant (ω̇ = τ/I) → gyro into vehicle-staterate.tick → torque → plant. Locally:

through-wasm closed loop: omega_x -> 1.0059 rad/s (target 1.0), |err| = 0.0059
PASS: converged at 0.193s, steady-state |err| 0.0059 < 0.01 — loop closes through the component

That's "always complete loop," proven through the component exactly as jess will run it — not an open-loop stub, not an internal sealed demo.

Scope / follow-ups

  • No change to the Bazel/std build path (gating verified; the standalone cargo build default-feature error is pre-existing — falcon_rate_bindings is Bazel-provided).
  • Follow-ups (separate): wire the proof as a CI gate; per-component OCI publish (jess#167 decision 5) — the thing that lets jess wkg oci pull falcon-rate.

Refs: jess#167 (consumption contract).

🤖 Generated with Claude Code

The falcon-rate worked example for the jess consumption contract (jess#167).
Verify-before-build: the real typed seam already existed
(`falcon:cascade` `rate.tick(vehicle-state, rate-setpoint) -> torque-setpoint`,
wrapping RatePid) and a native closed-loop convergence test already existed
(`rate_p03`). Two things were genuinely missing:

1. **WASI-free build.** The cargo-component build pulled `std` (via
   `thread_local!`) → 10 WASI imports, which don't lower to bare metal
   (synth → gale on M4/M7/F100). Convert the component to `no_std` on the
   cargo-component path (single-threaded statics replace `thread_local!`,
   `lol_alloc` global allocator, panic handler), all gated to
   `not(feature = "bazel-bindings")` so the Bazel path is untouched. Result:
   imports ONLY `falcon:cascade/types`, exports `rate` — a pure transformer
   that lowers cleanly and a WASI-less host can drive directly.

2. **Loop-complete proof THROUGH the wasm seam.** `tests/rate-loop-proof` is a
   minimal WASI-less wasmtime host that closes the control loop across the real
   WIT boundary: plant (ω̇ = τ/I) → gyro into vehicle-state → `rate.tick` →
   torque → plant. Locally: converges at 0.193 s, steady-state |err| 0.0059
   rad/s < 0.01 — the "always complete loop" principle, proven through the
   component exactly as jess will run it.

Follow-ups (not here): wire the proof as a CI gate; per-component OCI publish
(jess#167 decision 5). No change to the Bazel/std build path.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01HvusAXYbHLyv3uTzfBcMbG
@avrabe
avrabe merged commit 482bb2d into main Jul 23, 2026
13 checks passed
@avrabe
avrabe deleted the feat/falcon-rate-wasi-free-loop-proof branch July 23, 2026 21:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant