feat(falcon-rate): WASI-free component + through-wasm closed-loop proof#314
Merged
Conversation
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The
falcon-rateworked example for the jess consumption contract (jess#167). Verify-before-build paid off: the real typed seam already existed (falcon:cascaderate.tick(vehicle-state, rate-setpoint) -> torque-setpoint, wrappingRatePid) 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(viathread_local!) → 10 WASI imports, which don't lower to the M4/M7/F100 targets (synth → gale). Converted the component tono_stdon the cargo-component path — single-threaded statics instead ofthread_local!,lol_allocglobal allocator, panic handler — all gated tonot(feature = "bazel-bindings")so the Bazel/std path is untouched.Result — imports drop from 10 (incl. all WASI) to one:
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-proofis a minimal WASI-less wasmtime host that closes the control loop across the real WIT boundary: plant (ω̇ = τ/I) → gyro intovehicle-state→rate.tick→ torque → plant. Locally: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
cargo builddefault-feature error is pre-existing —falcon_rate_bindingsis Bazel-provided).wkg oci pull falcon-rate.Refs: jess#167 (consumption contract).
🤖 Generated with Claude Code