Expand description
TensorWasmExecutor — async executor for TensorWasm Wasm instances.
Owns a shared TensorWasmEngine and a registry of live TensorWasmInstances
keyed by InstanceId. Exposes the trio of operations
TensorWasmExecutor::spawn_instance, TensorWasmExecutor::call_export, and
TensorWasmExecutor::terminate — all async, all driven from the calling
Tokio runtime.
Structs§
- Spawn
Config - Configuration passed to
TensorWasmExecutor::spawn_instance. - Tensor
Wasm Executor - The async executor.
- Tensor
Wasm Resource Limiter - Per-store
ResourceLimiterthat caps linear-memory growth at the engine-configuredmax_memory_bytes. - Timeout
Context - Payload for
ExecError::Timeout. Carries the real elapsed and deadline figures captured when the epoch interrupt fired so the error mapping layer can surface them throughtensor_wasm_core::error::TensorWasmError::KernelTimeout.
Enums§
- Exec
Error - Errors raised by the executor.
- WasmArg
- A typed Wasm value supplied to
TensorWasmExecutor::call_export_with_args.
Constants§
- MAX_
MODULE_ BYTES - Hard upper bound on the byte length of a Wasm module the executor will
accept for compilation. Modules above this size are rejected with
ExecError::ModuleTooLargebeforeModule::from_binaryruns — pathological code-section blow-ups can otherwise force Cranelift to burn arbitrary CPU on adversarial input. 64 MiB is comfortably above any legitimate ML kernel module we’ve seen (single-digit MiB is typical), while keeping the Cranelift worst case bounded. - MAX_
START_ FN_ DURATION - Hard upper bound on how long a Wasm module’s
startfunction (and any other code that runs insidewasmtime::Instance::new_async) is allowed to execute before the epoch interrupt trips.