Skip to content

feat(wasm-abi): define and generate the versioned core-Wasm ABI contract #36

Closed

Description

@zackees

Parent: #16. Implements the #13 decision for one owned private core-Wasm ABI generator over the existing Wasmtime 45/Cranelift core-module host.

Cross-repo implementation tracker: zackees/fp-bindgen#1.

Scope

Depend on an immutable revision/version of the owned zackees/fp-bindgen fork. The fork owns the Rust declaration frontend/IR and the explicit Wasmtime core-Wasm generator tracked by zackees/fp-bindgen#1. The legacy upstream Wasmer generator/runtime is not reused or linked; generated Wasmtime host glue is consumed privately by kernal-api.

From one checked-in, versioned kernal-api core-ABI source of truth, deterministically generate: (1) a Rust guest crate, (2) a private Wasmtime host dispatcher, and (3) a checked-in ABI manifest. Preserve the familiar fp_import!/fp_export!-style Rust UX while making generated guest signatures target the accepted wasm32-wasip1-threads core-Wasm profile. The source defines ABI version/compatibility direction; exact kernal-api:v1 import names, signatures, result/status encoding, required metadata; request identity/completion wire representations; and reserved semantic operation/resource/error identifiers. It reserves that arbitrary serialized values, paths, platform objects, and whole bulk payloads are not ABI values.

Generation is checked in and reproducible from the checked-in ABI source. It runs as an explicit verification/regeneration command, never implicitly during ordinary Cargo builds.

Extend final-module admission so the exact generated v1 import/signature/metadata set is negotiated before root entry or any host effect. Reject absent, future, duplicate, malformed, incompatible, or capability-inappropriate ABI declarations before instantiation.

Import-policy invariant

This issue must not broaden #15's allowlist. The new kernal-api:v1 imports are admitted only when they exactly match the generated v1 contract. Existing closed P1/thread compatibility imports remain separately explicit and authority-free. No generic kernal-api:*, ambient WASI, filesystem, process, network, clock, random, environment, or stdio authority is accepted.

Invariants

  • One owned ABI source of truth and one pinned fork generator; no upstream fp-bindgen runtime reuse, WIT, MessagePack transport, ad-hoc RPC, or parallel hand-written guest API.
  • default = [] and full do not resolve the generator, guest support, Wasmtime, or wasmparser.
  • No public API exposes raw ABI packets, numeric capability bits, generated support types, Wasmtime, Tokio, Store, Linker, or backend types.

Non-goals

No host operation execution, futures, polling, cancellation, resources, quotas, streams/blobs, blocking adapters, Tauri, or guest thread bootstrap.

RED → GREEN

  • RED: checked-in characterization proves the handwritten kernel-yield import has no generated version-negotiated ABI source of truth.
  • RED: reproduce and characterize fp-bindgen's historical 16,777,215-byte FatPtr boundary; it is not an acceptable bulk-transfer path and no whole-value workaround is permitted.
  • RED: fixtures show metadata/import drift cannot presently be distinguished from a compatible module.
  • GREEN: the pinned fork frontend/IR deterministically produces the checked-in Rust guest crate, private Wasmtime dispatcher, and ABI manifest from one v1 contract; regeneration is byte-for-byte stable and a drift check fails when output is stale.
  • GREEN: exact import namespace/name/signature/version tests accept only the generated v1 contract and reject every mutation before Module::new/instantiation.
  • GREEN: duplicate/version-skew/capability-mismatch metadata produces bounded facade-owned diagnostics without host effects.
  • GREEN: generated code never appears in the default/full dependency graph; soldr cargo test --locked --no-default-features remains free of Wasmtime/parser/generator/guest-support resolution.

Platform and deliverables

Compile on Linux/macOS/Windows x86-64/ARM64. Deliver the pinned fork dependency/vendor record, ABI source, deterministic generator/check command, checked-in guest crate/private Wasmtime glue/manifest, admission fixtures, compatibility note, and Soldr-only focused commands.

Dependencies and closure

Activity

  1. added
    enhancement
    on Aug 27, 2026
  2. zackees commented on Aug 27, 2026

    @zackees
    CollaboratorAuthor

    Decision update: the owned fp-bindgen fork now carries the Wasmtime/core-Wasm backend rather than being consumed as frontend/IR only. Implementation is tracked in zackees/fp-bindgen#1; kernal-api will pin the landed revision and privately consume the generated host glue.

  3. zackees commented on Aug 28, 2026

    @zackees
    CollaboratorAuthor

    fp-bindgen Wasmtime Core Wasm generator merged upstream: zackees/fp-bindgen#2 at 4e44d9e5408653e3c428ee3f855cc194d53f60b0. Post-merge Rust 1.95.0 exact generated-host golden is green. Kernal integration remains pending the Soldr/zccache released-artifact path.

  4. zackees commented on Sep 12, 2026

    @zackees
    CollaboratorAuthor

    Closed as completed. The pinned generated v1 Core-Wasm contract is on main: deterministic guest/linker/manifest generation, exact precompile metadata admission, drift verification, historical FatPtr characterization, and feature isolation are in place. Its stated closure condition is now exercised by the generated async lifecycle through the same ABI.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions