Skip to content

v0.0.6

Latest

Choose a tag to compare

@0xGeorgii 0xGeorgii released this 27 Sep 01:59

v0.0.6 New targets: SpaceWasm and Stellar

SpaceWasm target

Inference can now build for NASA JPL's SpaceWasm flight interpreter, a no_std WebAssembly 1.0 decoder meant to run inside a spacecraft's flight software. Ask for it with infc --target spacewasm or [build] target = "spacewasm" in Inference.toml. Emission is unchanged β€” a spacewasm build is byte-for-byte the same module a wasm32 build of the same source produces β€” so what the target buys is a conformance check and a set of refusals, not a rewrite.

  • Every build is checked against the flight decoder's own limits before any artifact is written: parameter, local and frame word counts, index ranges, host-import name lengths and arity, custom-section names and memory size. A refusal names the offending function and both numbers. The build also reports each function's control-frame and operand-stack depth against the reference embedder's bounds.
  • New analysis rule A055 catches the parameter-word limit at the declaration itself, in infc builds and live in the editor, instead of only at the finished module.
  • proof mode, post-MVP WebAssembly features, and any non-deterministic construct in a shipping function are all refused at this target (#325).

infs run executes SpaceWasm builds

infs run now executes a spacewasm build in process, under the same flight interpreter, with no wasmtime involved. It loads the module with the FΒ΄ (F Prime) reference host functions β€” panic, rsleep, command, message, telemetry, and clock_ms β€” checks every import before running anything, and reports a trap, an unknown import, or an over-budget module in plain language naming what failed.

  • infs run --fuel N caps a run to N interpreter instructions and reports the budget running out cleanly, so a non-terminating program fails a run instead of hanging it; options like --fuel must precede the invoked function's own arguments.
  • Running a wasm32 build that imports host functions is still refused, but when those imports are exactly the FΒ΄ reference set, the refusal now suggests switching target = "spacewasm" to run it (#485).

Host imports

A program can now declare functions its embedder supplies at run time, instead of only functions linked in from a .wasm library:

use { clock_ms } from host::env;
  • Inference.toml's new [host-imports] table is a per-project allowlist: omit it to admit every host import the program declares, list module = ["field", ...] entries to admit only those, or declare the table with no keys to admit none at all.
  • infc --host-imports=module.field,... is the equivalent flag, and both mechanisms print what applied β€” host imports: env.clock_ms versus host imports (no allowlist): env.clock_ms β€” so a build log shows whether a reviewed policy actually ran.
  • A proof (-v) build that binds a host import is refused outright: the function's body lives outside the artifact a proof is written about (#464).

Stellar

--target stellar (or [build] target = "stellar") turns a linked Inference module into a deployable Soroban smart contract. After linking, the module is rewritten into the Stellar value ABI: one wrapper per exported method taking and returning the host's tagged word, and Soroban's environment-metadata section appended.

  • Contracts now also carry contractspecv0 and contractmetav0, ahead of the environment-metadata section, so stellar contract invoke, stellar contract info interface, and bindings generators can type each method's arguments by name instead of requiring hand-encoded calls.
  • The rewriter refuses a parameter Stellar's own tooling can't address reliably: one written _, one named in more than 30 bytes, or one whose name collides with another parameter's stellar CLI flag alias (#324, #466).

Verification and Rocq

Proof obligations now sit on a real IR: a new core/hassert crate holds the HAssert/HTerm representation, Rocq output targets the wasm-verifier contract, built on WasmCert-Coq v2.2.0 (ValidModule plus a new ValidSpec), and a specification that can't be translated now aborts code generation (P001-P009) instead of silently shipping an unverifiable module. Several soundness gaps close on top of that foundation: exists- and unique-quantified specification functions now compile end to end and produce real obligations instead of being rejected outright; a specification whose translated obligation is vacuously true is refused (P010) rather than shipped as a green, contentless proof; every universally-quantified narrow-typed variable now states the value range its declaration actually admits; and a term-position &&/|| is now encoded as a witnessed existential β€” the latter two close cases where the previous encoding was provable of the wrong values, or unsound outright. A specification may now call a linked external fn, and the linker now accepts several integer conversion operators it used to reject (#299, #354, #356, #357, #383, #353, #363).

Toolchain

  • infs self update now preserves infs's third-party license notices (SpaceWasm's Apache-2.0 notice and libm's MIT license) across an update, and release archives ship a licenses/ directory alongside the binaries (#485).
  • infs is about 23% smaller (9,298,832 β†’ 7,208,096 bytes, measured on macOS arm64), and its release archives are about 10-12% smaller on all three platforms, measured by the release dry run; infc is unchanged (#325).
  • Release binaries are now exactly what cargo build --release produces β€” earlier releases accidentally shipped binaries rebuilt with test-only features (extra instrumentation, larger dependency feature sets) baked in.
  • infs/infc --version now reports the real release version instead of always printing 0.0.1 (#408).
  • A new SpaceWasm benchmark tracks what compiled programs cost the flight interpreter β€” instructions executed and IR size β€” against a committed history, and warns in CI when either grows by more than 5% (#325).

Breaking changes

Every ### Breaking entry in this release whose change landed since v0.0.5, condensed to one line:

  • AnalysisOptions gains a public target field β€” a literal naming only stack_budget_bytes stops compiling; spread ..AnalysisOptions::default() to keep building against wasm32 (#325).
  • ExportSignature::params is now Vec<AbiParam> (a name plus a type) instead of Vec<AbiType> (#466).
  • StellarAbiError gains UnnamedParameter, ParameterNameTooLong, ParameterNamesCollide, and AlreadyAContract now carries the section name it found β€” an exhaustive match needs new arms (#466).
  • --target stellar now refuses an exported parameter written _, named over 30 bytes, or colliding with another parameter's CLI flag alias (#466).
  • unit is now a reserved word; the unit type is spelled () only β€” anything named or typed unit no longer compiles.
  • Inference.toml gains a [host-imports] table; an infs older than this release loads past it silently and applies no allowlist at all (#464).
  • The compiler ABI minor is now 8 β€” a tool holding a host-import policy must gate --host-imports on it and refuse rather than silently drop it against an older infc (#464).
  • A --wasm-dep/[wasm-dependencies] key whose first segment is host is now a hard error (#464).
  • host is reserved as the first segment of a use … from clause; a linked module logically named host::... must be renamed before upgrading (#464).
  • codegen()'s target-naming refusals now render the target the way --target spells it (stellar), not its Rust Debug form β€” tests asserting the old text must update (#325).
  • check_wasm1 moves out of core/stellar-abi into new core/target-conformance; the inference_stellar_abi re-export is gone (#325).
  • Target::Soroban is renamed to Target::Stellar, moving matching refusal text and a cov_mark name with it (#324).
  • [build] target is now validated on load; an unsupported value now fails the build instead of silently building wasm32 (#324).
  • checked and wrapping are now reserved words β€” any identifier spelled either way is a parse error (#316).
  • +, -, *, and unary - now trap on overflow by default; wrap that arithmetic explicitly in wrapping(...) to keep the old two's-complement behavior (#316).
  • type aliases are removed from the language entirely (#182).
  • The WASM name section now uses two disjoint namespaces (file-qualified compiled names vs. ::-joined external names); a downstream Rocq proof naming a non-entry-file function must re-pin to its new identifier (#362).
  • The static-merge linker now refuses to emit a module whose proof obligations don't resolve to exactly one function (#362).
  • mut on an external fn parameter is now linker-checked; an immutable compound parameter or self can no longer be forwarded to a mut external position (#333).
  • An external fn's identity is now its declaration, resolved per file, rather than its bare name looked up program-wide (#423).
  • A specification may now call a bound external fn; a mismatched application arity against the resolved function is now a hard error (#363).
  • exists/unique-quantified spec functions now compile instead of being rejected; the inference.hspecs wire format bumps to v2 (recompile rather than migrate) (#354).
  • New fatal P010 refuses a spec function whose obligation collapses to a vacuous truth instead of shipping it (#356).
  • Term-position &&/|| in obligations now encodes as a witnessed existential instead of an eager term; downstream proofs over the old shape must be restated (#383).
  • Call-site argument labels are now checked; mixed, unknown, or out-of-order labels are now errors instead of being silently bound positionally (#378).
  • A struct method's self/mut self declared anywhere but the first parameter is now a type error (#377).
  • A parameter name declared twice in one signature is now a DuplicateParameterName error, including on external fn (#377).
  • Proof-mode obligations now guard every universal slot with an explicit type antecedent, and != no longer conjoins an extra definedness clause β€” old emitted obligations no longer discharge against the hardened contract (#353).
  • A narrow-typed quantified scalar's obligation now states its declared value domain β€” previously emitted obligations were unsound and must be restated (#357).
  • The linker now admits eight integer width/sign-extension operators it previously rejected; an exhaustive match over the Rocq stub's instruction enum needs new arms (#363).
  • codegen() takes one CodegenOptions struct in place of its separate arguments, including the new features: EmitFeatures (#315).
  • Inference.toml is now strictly verified; unknown keys in a struct table are rejected, and manifest_version/edition are removed (#315).
  • New rule A046 rejects a unary minus written apart from its literal (- 128), which previously compiled as a different value than the glued form (#376).
  • New rule A045 rejects values of a field-less struct (#332).
  • inference_parser::Input::new now also takes the source text: Input::new(src, &tokens) (#219).
  • wasm_to_v/translate_bytes gains a fourth parameter, hspecs_by_spec: &HSpecMap, sourcing obligations from the new core/hassert IR (#299).
  • Rocq output now targets wasm-verifier on WasmCert-Coq v2.2.0: ValidModule is 1-ary and a new ValidSpec carries each spec's obligation. Downstream Rocq libraries must update (#299).
  • New leaf crate core/hassert holds the obligation IR and the inference.hspecs section codec (#299).
  • New fatal proof-mode diagnostics P001-P009 refuse an untranslatable spec instead of silently emitting an unverifiable module (#299).
  • wasm-to-v now rejects any non-deterministic instruction surviving in an executable function body (#299).

Upgrading

Run infs self update. Every binary before v0.0.6 reported 0.0.1 from --version, so infs self update on an older toolchain always believed a newer release existed and updated regardless of what was actually installed; from v0.0.6 on, the reported version is real and update comparisons work correctly. The update also now preserves infs's third-party license notices across the swap.

The language server ships with the managed toolchain, so its new diagnostics, A055 among them for a spacewasm project, arrive with the update. Syntax highlighting for the new reserved words (unit, checked, wrapping) comes from the VS Code extension's own grammar and ships with the extension.

See CHANGELOG.md for the complete list of changes in this release.