CapsulithPORTABLE NATIVE OBJECTSARM64 → WASM

02 / KEEP THE STATE. CARRY THE CODE.

Native instructions.
Living objects.

Run selected compiled methods with an owned heap. Keep the bytes at stable guest addresses, save a checkpoint, and continue in a fresh worker.
The original binary is no longer needed after import.

Prepared ARM64 direct closures and declared memory imports. Method signatures are caller supplied. Trusted artifact rights and ABI, the native calling convention, remain your responsibility. No inferred layouts, OS loading, arbitrary components, or security isolation claim.
Import a module or open the original LZ4 example.
01

Module & contracts

Import an extracted capsulith.module.v1 module. Code identity and declared imports are validated by the runtime.

Extract from your ARM64 artifact

Choose an artifact you have rights to use. Declare each named root and its ABI explicitly. Extraction reads compiled bytes and supported direct dependencies; it does not run the artifact on the host or infer the object layout.

No artifact selected.

Use original symbol names. Types: reference, i32, u32, i64, u64. Declare allocator and native free lifecycle roots where the component requires them.

Module source JSON
No module loaded.
Named roots, code chunks and modeled dependencies will appear here.

Instance lifecycle

No instance

Closing ends this worker. A saved matching checkpoint can reopen owned state with a fresh instance identity.

Checkpoint & portable source

No recovery checkpoint saved.

Checkpoints preserve owned region bytes, initialization and counters at method boundaries. The digest detects alteration, not authenticity. CPU and stack frames are not captured.

02

Owned memory & methods

Allocate caller memory

0 supplied bytes

Read-only access ends at supplied bytes. Other caller buffers zero-fill remaining capacity. Retained native pointers require the same region to stay live until the component's declared lifecycle releases them.

Call a named method

Choose a caller-declared contract.

Inputs freeze for each call. Editing while a call is running discards its worker and results. A fault or cancellation requires a prior checkpoint or a new instance.

Live owned regions

0 bytes

No live state. Heap fields remain opaque.

initializedunknowncaller buffer
Allocate a buffer or call a factory to observe owned memory.
03

Observed execution

· · · ↗ · · ·
Call evidence appears here.

Return value, actual memory access, counters and bounded events come from the running instructions.

Recovery is explicit

Save a checkpoint before a call you may need to undo. Failed or cancelled workers cannot produce a successful checkpoint or state bundle. Restoring validates the matching module and preserves guest addresses, while all references bind to a fresh instance.