Unreleased.
Unreleased.
Released 2024-01-25
The major feature of this release is that the WASI support in Wasmtime is now
considered stable and flagged at an 0.2.0 version approved by the WASI subgroup.
The release was delayed a few days to hold off until the WASI subgroup voted to
approve the CLI and HTTP worlds and they're now on-by-default! Additionally the
component model is now enabled by default in Wasmtime, for example an opt-in
flag is no longer required on the CLI. Note that embeddings still must opt-in to
using the component model by using the wasmtime::component
module.
-
Cranelift optimizations have been added for "3-way comparisons", or
Ord::cmp
in Rust or<=>
in C++. #7636 #7702 -
Components now use Wasmtime's compilation cache used for core wasm modules by default. #7649
-
The
Resource<T>
andResourceAny
types can now be converted between each other. #7649 #7712
-
Minor changes have been made to a number of WITs as they progressed to their official 0.2.0 status. #7625 #7640 #7690 #7781 #7817
-
The component model is now enabled by default. #7821
-
The implementation of
memory.atomic.{wait,notify}
has been rewritten. #7629 -
The
wasmtime_wasi::preview2::Table
type has been moved towasmtime::component::ResourceTable
. #7655 -
Creating a UDP stream now validates the address being sent to. #7648
-
Defining resource types in
Linker<T>
now takes the type to define as a runtime parameter. #7680 -
Socket address checks can now be performed dynamically at runtime. #7662
-
Wasmtime and Cranelift's MSRV is now 1.73.0. #7739
-
Bindings for WIT APIs where interfaces have multiple versions are now fixed by putting the version in the generated binding names. #7656
-
The preview1
fd_{read,write}
APIs are now fixed when a shared memory is used. #7755 -
The preview1
fd_{read,write}
APIs no longer leak an intermediate stream created. #7819
Released 2023-12-20
-
Add yielding support in
wasmtime_store_epoch_deadline_callback
in the C API. #7476 -
Support for the
wasi_unstable
module ("wasi preview0" canonically) has been added to the-Spreview2
support in the CLI. #7548 -
The original module can now be obtained from an "instance pre" in the C API. #7572
-
Usage of Mach ports on macOS can now be disabled in the C API. #7595
-
The preview1-to-preview2 component adapters now import a smaller number of interfaces by default. #7543 #7544
-
Wasmtime and Cranelift now require Rust 1.72.0 to build. #7554
-
The default
world
supported bywasmtime serve
has been slimmed down to exactly whatwasi:http/proxy
specifies by default. Support for other WASI APIs can be included with the-S common
command-line flag. #7597 -
The
wasmtime --version
CLI output will now include date/commit information when Wasmtime is built from a git checkout. #7610 -
Debug intrinsic symbols required by LLDB and GDB have been moved behind a
debug-builtins
feature of thewasmtime
crate which is enabled by default. #7626
-
MPK support is now explicitly disabled on AMD-based CPUs since the implementation does not currently support it. #7513
-
Initialization of a WebAssembly data segment with a negative offset is fixed to zero-extend the offset instead of sign-extend. #7559
-
The reported offset of
O_APPEND
files in preview1 has been fixed. #7586 -
MPK support does a better job of compacting memories to minimize virtual memory used. #7622
-
Union node bitpacking has been fixed with egraph optimizations to ensure the minimal cost node is selected. #7465
-
Equivalent-cost expressions now have ties broken with expression depth in egraphs to prefer "shallow" expression trees. #7456
-
Long-and-narrow chains of expressions are now optimized into shallow-and-wide trees. #7466
Released 2023-12-01.
-
The
wasi:random/insecure{,_seed}
interfaces are now available through the CLI. #7614 -
A stray debugging
println!
was removed. #7618
Released 2023-11-20
-
Multiple versions of interfaces are now supported in
bindgen!
. #7172 -
Support for custom stack memory allocation has been added. #7209
-
The
memory_init_cow
setting can now be configured in the C API. #7227 -
The
splice
method of WASI streams has been implemented. #7234 -
Wasmtime binary releases now have a
wasmtime-min
executable in addition tolibwasmtime-min.*
libraries for the C API. These showcase a minimal build of Wasmtime for comparison. #7282 #7315 #7350
-
Many changes to
wasi:http
WITs have happened to keep up with the proposal as it prepares to reach a more stable status. #7161 #7406 #7383 #7417 #7451 -
Add an error resource to WASI streams. #7152
-
Syntax in
bindgen!
'strappable_error_type
configuration has changed. #7170 -
TCP errors in
wasi:sockets
have been simplified and clarified. #7120 -
Wasmtime/Cranelift now require Rust 1.71.0 to compile. #7206
-
Logging in Wasmtime is now configured with
WASMTIME_LOG
instead ofRUST_LOG
. #7239 -
Fuel-related APIs on
Store
have been refactored and reimplemented with two new methodsset_fuel
andreset_fuel
. Previous methods have been removed. #7240 #7298 -
The
forward
method of WASI streams has been removed. #7234 -
The WebAssembly
threads
,multi-memory
, andrelaxed-simd
proposals are now enabled by default. #7285 -
Logging is now implemented for
wasmtime serve
. #7366 -
Filesystem locking has been temporarily removed from WASI. #7355
-
Wasmtime's implementation of WASI preview1 built on top of preview2 (
-Spreview2
) has been enabled by default. #7365 -
The
wasi:clocks
interface now has twosubscribe
functions and aduration
type. #7358 -
The
wasi:io/poll
interface has seen some refactoring. #7427
-
Profiling the first function in a module now works. #7254
-
Consecutive writes to files in preview2 have been fixed. #7394
-
Copy-on-write initialization of linear memories has been fixed for components. #7459
-
Support for proof-carrying code has been added to Cranelift to assist with an extra layer of validation about properties such as WebAssembly memory accesses in the future. #7165 #7180 #7219 #7231 #7262 #7263 #7274 #7280 #7281 #7352 #7389 #7468
-
Rematerialization of values no longer accidentally overrides LICM. #7306
-
Inline stack probes no longer make Valgrind unhappy. #7470
Released 2023-11-01
-
Using the
--dir
argument combined with a::
-remapped path no longer prints a warning about compatibility with the old CLI and works with remapping. #7416 -
Consecutive file writes in preview2 have been fixed. #7394
Released 2023-10-29
-
The
wasmtime
executable will now attempt to more gracefully handle the transition from the 13.0.0 CLI arguments and parsing to the changes in 14.0.0. CLI commands should now warn if they no longer work with the new parser, but still execute as they previously did. This behavior can be controlled via a newWASMTIME_NEW_CLI
environment variable if necessary. #7385 -
The
serve
subcommand of thewasmtime
CLI is now enabled by default for thewasmtime
executable. #7392
Released 2023-10-26
-
Make the
wasmtime::unix
module accessible on macOS again. #7360 -
Inter-crate dependencies between
cranelift-*
crates now disable thedefault
feature meaning that it's possible for embedders to depend oncranelift-codegen
as well without thedefault
feature. #7369
Released 2023-10-23
- Cranelift: preserve uext and sext flags for parameters on x86_64 and apple
aarch64. Note that this does not affect Wasmtime and is only intended for
Cranelift embedders such as
rustc_codegen_cranelift
. #7333
Released 2023-10-20
One of the larger changes in this release is a redesign of Wasmtime's CLI
arguments and where arguments are passed. This means that previous invocations
of the wasmtime
CLI executable will need to be updated. No functionality was
removed but most of it is behind new flags. One major change is that Wasmtime
CLI flags are now grouped behind short options like -O
. For example
wasmtime run --opt-level 2 foo.wasm
is now:
wasmtime run -O opt-level=2 foo.wasm
Additionally options prefixed with --enable-*
or --disable-*
now
consistently are considered boolean setters. For example:
wasmtime run --disable-cache foo.wasm
is now:
wasmtime run -C cache=n foo.wasm
Options can be explored with wasmtime -C help
for example, and wasmtime -h
will show all option groups that can be expanded.
Another major change in the CLI is that any CLI argument which positionally comes after the wasm file specified will be passed as an argument to the guest module. For example this invocations
wasmtime run foo.wasm --epoch-interruption
was previously accepted as enabling epoch interruption for the foo.wasm
file.
This is now interpreted as if it were ./foo.wasm --epoch-interruption
,
however, passing the flag to the wasm file itself. Flags to Wasmtime must now
come after Wasmtime's subcommand (in this case run
) and before the wasm file
that's being run, for example:
wasmtime run -W epoch-interruption foo.wasm
More information about this change can be found on #6925 and #6946.
-
Added the
wasmtime::FrameInfo::module
method, which returns thewasmtime::Module
associated with the stack frame. -
The
wasmtime::component::Linker
type now implementsClone
. #7032 -
Wasmtime's
TypedFunc
API now supports thev128
WebAssembly type on x86_64 and aarch64. #7010 -
Support for resources exported from a WebAssembly guest has been added to the component
bindgen!
macro. #7050 -
The C API now supports learning about a module's
image_range
. #7064 -
Passing values between components is now possible with a more complete implementation of type-checking of values. #7065
-
Types representing resources can now be customized with
bindgen!
. #7069 -
Wasm-defined globals and memories are now included in core dumps, and the
wasmtime::WasmCoreDump
type is now serializable. #6935 #7078 -
Initial experimental support for Intel MPK has been added to support running more instances concurrently. #7072
-
The implementation of
wasi:http
now supports inbound requests in addition to outbound requests. A newwasmtime serve
command is an example way of handling http requests with wasm files. #7091 -
The C API now supports Wasmtime's "host memory creation" API to customize the allocation of linear memories. #7115
-
The C API now supports asynchronous invocation of WebAssembly programs. #7106
-
The C API now supports Wasmtime's
InstancePre<T>
type. #7140 -
The
wasi:sockets/ip-name-lookup
interface is now implemented by Wasmtime. #7109
-
Wasmtime's CLI has been significantly overhauled. See the note above. #6925 #6946
-
The
wasmtime::FrameInfo::module_name
has been removed, however you can now get identical results by chainingwasmtime::FrameInfo::module
andwasmtime::Module::name
:my_frame.module().name()
. -
WASI interfaces have seen significant work since the previous release. Streams for example have a new backpressure and flushing design. Additionally WIT
resource
s are now used ubiquitously throughout the specification and implementation. #6877 #7029 #7090 -
The implementation of
wasi:http
now uses{input,output}-stream
from thewasi:io/streams
interface. #7056 -
Lifting and lowering of the
list<u8>
component values has been significantly optimized. #6971 -
The
wasmtime-c-api
crate is now additionally built as an rlib as well as the previous cdylib/staticlib combo. #6765
-
Support referencing stack slots in the DWARF debug info. #6960
-
Printing unicode to stdio on Windows has been fixed. #6825
-
Building for x86_64-linux-android has been fixed. #7055
-
Fixed stdout/stderr becoming nonblocking by accident with WASI preview2 on macOS. #7058
-
Fixed some character boundary-related panics in the preview2 implementation of preview1. #7011
-
Fixed an issue of guests sleeping for an incorrect amount of time with preview2. #6993
-
Cranelift will now return an error when running out of temporaries in a very large function instead of panicking. #7114
Released 2023-10-26
- Make the
wasmtime::unix
module accessible on macOS again. #7360
Released 2023-09-20
-
Configuration of mach ports vs signals on macOS is now done through a
Config
instead of at compile time. #6807 -
Engine::detect_precompiled{,_file}
can be used to to determine whether some bytes or a file look like a precompiled module or a component. #6832 #6937 -
A new feature "wmemcheck" has been added to enable Valgrind-like detection of use-after-free within a WebAssembly guest module. #6820 #6856
-
The
wasmtime
CLI now supports executing components. #6836 -
Support for WASI preview2's TCP sockets interface has been added. #6837
-
Wasmtime's implementation of the wasi-nn proposal now supports named models. #6854
-
The C API now supports configuring
native_unwind_info
,dynamic_memory_reserved_for_growth
,target
, and Cranelift settings. #6896 #6934 -
The
wasmtime
crate now has initial support for component model bindings generation for the WITresource
type. #6886 -
Cranelift's RISC-V backend now has a complete implementation of the WebAssembly SIMD proposal. Many thanks to Afonso Bordado for all their contributions! #6920 #6924
-
The
bindgen!
macro in thewasmtime
crate now supports conditional configuration for which imports should beasync
and which should be synchronous. #6942
-
The pooling allocator was significantly refactored and the
PoolingAllocationConfig
has some minor breaking API changes that reflect those changes.Previously, the pooling allocator had
count
slots, and each slot hadN
memories andM
tables. Every allocated instance would reserve thoseN
memories andM
tables regardless whether it actually needed them all or not. This could lead to some waste and over-allocation when a module used less memories and tables than the pooling allocator's configured maximums.After the refactors in this release, the pooling allocator doesn't have one-size-fits-all slots anymore. Instead, memories and tables are in separate pools that can be allocated from independently, and we allocate exactly as many memories and tables as are necessary for the instance being allocated.
To preserve your old configuration with the new methods you can do the following:
let mut config = PoolingAllocationConfig::default(); // If you used to have this old, no-longer-compiling configuration: config.count(count); config.instance_memories(n); config.instance_tables(m); // You can use these equivalent settings for the new config methods: config.total_core_instances(count); config.total_stacks(count); // If using the `async` feature. config.total_memories(count * n); config.max_memories_per_module(n); config.total_tables(count * m); config.max_tables_per_module(m);
There are additionally a variety of methods to limit the maximum amount of resources a single core Wasm or component instance can take from the pool:
PoolingAllocationConfig::max_memories_per_module
PoolingAllocationConfig::max_tables_per_module
PoolingAllocationConfig::max_memories_per_component
PoolingAllocationConfig::max_tables_per_component
PoolingAllocationConfig::max_core_instances_per_component
These methods do not affect the size of the pre-allocated pool. #6835
-
Builder methods for WASI contexts now use
&mut self
instead ofself
. #6770 -
Native unwinding information is now properly disabled when it is configured to be turned off. #6547
-
Wasmtime's minimum supported Rust version (MSRV) is now 1.70.0. Wasmtime's MSRV policy of supporting the last three releases of Rust (N-2) is now additionally documented. More discussion can additionally be found on the PR itself. #6900
-
Wasmtime's support for DWARF debugging information has seen some fixes for previously reported crashes. #6931
-
Wasmtime's experimental implementation of wasi-crypto has been removed. More discussion of this change can be found on #6732 and #6816
-
Support for
union
types in the component model has been removed. #6913
Released 2023-09-14.
- CVE-2023-41880 - Miscompilation of wasm
i64x2.shr_s
instruction with constant input on x86_64
Released 2023-08-24
- Optimized the cranelift compilation on aarch64 for large wasm modules. #6804
Released 2023-08-21
-
Wasmtime now supports having multiple different versions of itself being linked into the same final executable by mangling some C symbols used by Wasmtime. #6673
-
The
perfmap
profiling option is now supported on any Unix platform instead of just Linux. #6701 -
The
wasmtime
CLI now supports--env FOO
to inherit the value of the environment variableFOO
which avoids needing to do--env FOO=$FOO
for example. #6746 -
Wasmtime now supports component model resources, although support has not yet been added to
bindgen!
. #6691 -
Wasmtime now supports configuration to enable the tail calls proposal. Platform support now also includes AArch64 and RISC-V in addition to the previous x86_64 support. #6723 #6749 #6774
-
Wasmtime's implementation of WASI Preview 2 now supports streams/pollables with host objects that are all backed by Rust
async
. #6556 -
Support for core dumps has now been added to the
wasmtime
crate. #6513 -
New
{Module,Component}::resources_required
APIs allow inspecting what will be required when instantiating the module or component. #6789
-
Functions on instances defined through
component::Linker::func_new
are now defined correctly. #6637 -
The
async_stack_size
configuration option is no longer inspected whenasync_support
is disabled at runtime. #6771 -
WASI Preview 1 APIs will now trap on misaligned or out-of-bounds pointers instead of returning an error. #6776
- Empty types are no longer allowed in the component model. #6777
Released 2023-09-14.
- CVE-2023-41880 - Miscompilation of wasm
i64x2.shr_s
instruction with constant input on x86_64
Released 2023-07-24.
- Update some minimum version requirements for Wasmtime's dependencies to fix building Wasmtime with historical versions of these dependencies. #6758
Released 2023-07-20
-
The WASI Preview 2
WasiCtxBuilder
type has been refactored, andWasiCtx
now has private fields. #6652 -
Component
bindgen!
now generates owned types by default instead of based on how they're used #6648 -
Wasmtime/Cranelift on x86-64 can now execute Wasm-SIMD on baseline SSE2, which all x86-64 processors support (as part of the base x86-64 spec). Previously, SSE4.2 extensions were required. This new work allows Wasm with SIMD extensions to execute on processors produced back to 2003. #6625
- Only export the top-level preview2 module from wasmtime-wasi when the
preview2
feature is enabled. #6615
-
Tail call implementation has begun in Cranelift #6641 #6666 #6650 #6635 #6608 #6586
-
Work continues on SIMD support for the riscv64 backend #6657 #6643 #6601 #6609 #6602 #6598 #6599 #6587 #6568 #6515
-
Fix
AuthenticatedRet
when stack bytes are popped in the aarch64 backend #6634 -
The
fcvt_low_from_sint
instruction has been removed, as it its current behavior can be recovered through a combination ofswiden_low
andfcvt_from_sint
#6565
Released 2023-09-14.
- CVE-2023-41880 - Miscompilation of wasm
i64x2.shr_s
instruction with constant input on x86_64
Released 2023-06-21
- Only export the top-level preview2 module from wasmtime-wasi when the
preview2
feature is enabled. #6615
Released 2023-06-20
-
Expose the
Config::static_memory_forced
option through the C api #6413 -
Basic guest-profiler documentation for the book #6394
-
Merge the initial wasi-preview2 implementation #6391
-
The wasi-preview2 component adapter has been pulled into the main wasmtime repository. It is available for the first time as part of this release, but should be treated as as a beta at this time. Patch releases will not be made for bug fixes. #6374
-
A callback invoked when an epoch deadline is reached can now be configured via the C API. #6359
-
PR auto-assignment policies have been documented, to clarify the expectations of reviewers. #6346
-
Support for the function references has been added #5288
-
An
epoch_deadline_callback
now returns anUpdateDeadline
enum to allow optionally yielding to the async executor after the callback runs. #6464 -
The
--profile-guest
flag has now been folded into--profile=guest
#6352 -
Initializers are no longer tracked in the type information for globals, and instead are provided when creating the global. #6349
-
The "raw" representation of
funcref
andexternref
in the embedding API has been updated from ausize
to a*mut u8
to be compatible with Rust's proposed strict provenance rules. This change is additionally reflected into the C API as well. #6338
-
Fixed a soundness issue with the component model and async #6509
-
Opening directories with WASI on Windows with
NONBLOCK
in flags has been fixed. #6348
-
Performance improvements in regalloc2 have landed, and compilation time has improved #6483 #6398
-
Renamed
abi::Caller
toabi::CallSite
#6414 -
Work has begun on SIMD support for the riscv64 backend #6324 #6366 #6367 #6392 #6397 #6403 #6408 #6419 #6430 #6507
Released 2023-05-31.
- Fix Wasi rights system to work with wasi-testsuite, which exposed a corner case that was missed by the fixes in the 9.0.2 release. #6479
Released 2023-05-26.
- Fix Wasi rights system to work with wasi-libc. This regression was introduced in the 9.0.0 release. #6462 #6471
Released 2023-05-22.
- A panic which happened when enabling support for native platform profilers was fixed. #6435
Released 2023-05-22.
-
Initial integration of the Winch baseline compiler into Wasmtime is implemented. Note that Winch still does not support much of WebAssembly, but intrepid explorers may have an easier time playing around with it now. #6119
-
The
wasmtime
CLI now has flags to limit memory, instances, and tables. For example--max-memory-size
or--max-tables
. Additionally it has a new--trap-on-grow-failure
option to force a trap whenever amemory.grow
would otherwise fail which can be useful for debugging modules which may be encountering OOM. #6149 -
An initial implementation of the wasi-http proposal was added to Wasmtime in the shape of a new
wasmtime-wasi-http
crate and a--wasi-modules=experimental-wasi-http
CLI flag. Note that this is not on-by-default and still in an experimental status at this time. #5929 -
Wasmtime's
bindgen!
macro for components now hasinterfaces
andwith
options to configure use of interfaces defined externally in separate crates. #6160 #6210 -
Wasmtime's
bindgen!
macro emits trace events for arguments and results when enabled. #6209 -
A new
Engine::precompile_compatibility_hash
method has been added to assist with hashing artifacts to be compatible with versions of Wasmtime. #5826 -
Wasmtime's C API now has functions for enabling the WebAssembly relaxed-simd proposal. #6292
-
A new
--emit-clif
flag has been added towasmtime compile
to see the CLIF corresponding to a WebAssembly module to be used for debugging. #6307 -
Support for an in-process sampling-based profiler has been added to Wasmtime. This is intended to be used in conjunction with epochs to enable relatively simple implementations of profiling a guest module. #6282
-
Overhauled the way that Wasmtime calls into Wasm and Wasm calls back out to the host. Instead of chaining together trampolines to convert between calling conventions, we now represent
funcref
s with multiple function pointers, one per calling convention. This paves the way for supporting Wasm tail calls and also results in ~10% speed ups to a variety of function call benchmarks, however there are some slight compiled Wasm module code size regressions (which can be alleviated by disabling optional.eh_frame
generation). Additionally, in the C API thewasmtime_func_call_unchecked
function gained one more parameter, which is the capacity of the args-and-results buffer. #6262 -
The
wasmtime compile
command will now default to producing executables for the native host and its CPU features instead of the baseline feature set of the host's architecture. #6152 -
The
ResourceLimiter
trait and itsasync
equivalent now support returning errors from growth to force a trap in the wasm module rather than reporting -1 to the wasm module. Note that this is primarily intended for debugging. #6149 -
The non-egraph-based optimization pipeline has been removed from Cranelift, and the corresponding
Config::use_egraphs
option is also removed. #6167 -
Generated types for WIT files now always generates owned types by default. #6189
-
Wasmtime's baseline x86_64 CPU features required for SIMD support has been lowered from SSE 4.2 to SSE 4.1. #6206
-
The
fd_allocate
implementation in Wasmtime will now always fail withENOTSUP
. #6217 -
The "rights" system in WASI has been removed and rights are no longer inspected in the implementation of any WASI functions. #6265
-
WASI can now open directories without
O_DIRECTORY
. #6163 -
The
poll_oneoff
function has been fixed when handling non-regular files. #6258 -
The behavior of
path_readlink
on too-small buffers has been fixed to truncate. #6225
Note: this section documents changes to Cranelift, a code generator backend that Wasmtime uses. These changes are not always applicable to Wasmtime as a WebAssembly runtime but may be interesting to other projects which embed or use Cranelift.
-
New
{u,s}{add,sub,mul}_overflow
instructions have been added. #5784 -
The
iadd_cout
andisub_bout
instructions have been removed. #6198 -
ISLE now supports binary and octal integer literals. #6234
-
An implementation of SIMD for RISC-V has started. #6240 #6266 #6268
Released 2023-04-27.
- Breaking: Files opened using Wasmtime's implementation of WASI on Windows now cannot be deleted until the file handle is closed. This was already true for open directories. The change was necessary for the bug fix in #6163.
-
Fixed wasi-common's implementation of the
O_DIRECTORY
flag to match POSIX. #6163 -
Undefined Behavior in Rust runtime functions GHSA-ch89-5g45-qwc7
Released 2023-04-20
-
Allow the MPL-2.0 and OpenSSL licenses in dependencies of wasmtime. #6136
-
Add a bounds-checking optimization for dynamic memories and guard pages. #6031
-
Add support for generating perf maps for simple perf profiling. Additionally, the
--jitdump
and--vtune
flags have been replaced with a single--profile
flags that acceptsperfmap
,jitdump
, andvtune
arguments. #6030 -
Validate faulting addresses are valid to fault on. As a mitigation to CVEs like
GHSA-ff4p-7xrq-q5r8
, check that the address involved in a fault is one that could be contained in aStore
, or print a scary message and abort immediately. #6028 -
Add the
--default-values-unknown-imports
option to define unknown function imports as functions that return the default value for their result type. #6010 -
Add
Clone
forcomponent::InstancePre
. #5996 -
Add
--dynamic-memory-reserved-for-growth
cli flag. #5980 -
Introduce the
wasmtime-explorer
crate for investigating the compilation of wasm modules. This functionality is also exposed via thewasmtime explore
command. #5975 -
Added support for the Relaxed SIMD proposal. #5892
-
Cranelift gained many new machine-independent optimizations. #5909 #6032 #6033 #6034 #6037 #6052 #6053 #6072 #6095 #6130
-
Derive
Copy
onwasmtime::ValType
. #6138 -
Make
StoreContextMut
accessible in the epoch deadline callback. #6075 -
Take SIGFPE signals for divide traps on
x86_64
. #6026 -
Use more specialized AVX instructions in the
x86_64
backend. #5924 #5930 #5931 #5982 #5986 #5999 #6023 #6025 #6060 #6086 #6092 -
Generate more cache-friendly code for traps. #6011
-
Fixed suboptimal code generation in the
aarch64
backend. #5976 #5977 #5987 #5997 #6078 -
Fixed suboptimal code generation in the
riscv64
backend. #5854 #5857 #5919 #5951 #5964 #6087
Released 2023-04-27.
- Undefined Behavior in Rust runtime functions GHSA-ch89-5g45-qwc7
Released 2023-03-20
-
An initial implementation of the wasi-threads proposal has been implemented and landed in the Wasmtime CLI. This is available behind a
--wasi-modules experimental-wasi-threads
flag. #5484 -
Support for WASI sockets has been added to the C API. #5624
-
Support for limiting
Store
-based resource usage, such as memory, tables, etc, has been added to the C API. #5761 -
A top level alias of
anyhow::Result
aswasmtime::Result
has been added to avoid the need to explicitly depend onanyhow
. #5853 -
Initial support for the WebAssembly core dump format has been added to the CLI with a
--coredump-on-trap
flag. #5868
-
The
S
type parameter on component-related methods has been removed. #5722 -
Selection of a
world
to bindgen has been updated to select anydefault world
in a WIT package if there is only one. #5779 -
WASI preopened file descriptors can now be closed. #5828
-
The host traits generated by the
bindgen!
macro are now always namedHost
, but are still scoped to each individual module. #5890
-
Components which have
type
imports are now supported better and error/panic in fewer cases. #5777 -
Types referred to by
wasmtime::component::Val
are now reexported underwasmtime::component
. #5790 -
A panic due to a race between
memory.atomic.{wait32,wait64,notify}
instructions has been fixed. #5871 -
Guest-controlled out-of-bounds read/write on x86_64 GHSA-ff4p-7xrq-q5r8
-
Miscompilation of
i8x16.select
with the same inputs on x86_64 GHSA-xm67-587q-r2vw
Released 2023-04-27.
- Undefined Behavior in Rust runtime functions GHSA-ch89-5g45-qwc7
Released 2023-03-08.
-
Guest-controlled out-of-bounds read/write on x86_64 GHSA-ff4p-7xrq-q5r8
-
Miscompilation of
i8x16.select
with the same inputs on x86_64 GHSA-xm67-587q-r2vw
Released 2023-02-20
-
Wasmtime's built-in cache can now be disabled after being enabled previously. #5542
-
Older x86_64 CPUs, without SSE4.1 for example, are now supported when the wasm SIMD proposal is disabled. #5567
-
The Wasmtime C API now has
WASMTIME_VERSION_*
macros defined in its header files. #5651 -
The
wasmtime
CLI executable as part of Wasmtime's precompiled release artifacts now has theall-arch
feature enabled. #5657
-
Equality of
wasmtime::component::Val::Float{32,64}
now considers NaNs as equal for assistance when fuzzing. #5535 -
WIT syntax supported by
wasmtime::component::bindgen!
has been updated in addition to the generated code being updated. #5565 #5692 #5694 -
Cranelift's egraph-based optimization framework is now enabled by default. #5587
-
The old
PoolingAllocationStrategy
type has been removed in favor of a more flexible configuration via a new optionPoolingAllocationConfig::max_unused_warm_slots
which is more flexible and subsumes the previous use cases for each strategy. #5661 -
Creation of
InstancePre
throughLinker::instantiate_pre
no longer requires aStore
to be provided. Instead aStore
-related argument is now required onLinker::define
-style APIs instead. #5683
- Compilation for FreeBSD on x86_64 and AArch64 has been fixed. #5606
Released 2023-03-08.
-
Guest-controlled out-of-bounds read/write on x86_64 GHSA-ff4p-7xrq-q5r8
-
Miscompilation of
i8x16.select
with the same inputs on x86_64 GHSA-xm67-587q-r2vw
Released 2023-01-20
-
A
wasmtime::component::bingen!
macro has been added for generating bindings from*.wit
files. Note that WIT is still heavily in development so this is more of a preview of what will be as opposed to a finished feature. #5317 #5397 -
The
wasmtime settings
CLI command now has a--json
option for machine-readable output. #5411 -
Wiggle-generated bindings can now generate the trait for either
&mut self
or&self
. #5428 -
The
wiggle
crate has more convenience APIs for working with guest data that resides in shared memory. #5471 #5475
-
Cranelift's egraph support has been rewritten and updated. This functionality is still gated behind a flag and may become the default in the next release. #5382
-
The implementation of codegen for WebAssembly linear memory has changed significantly internally in Cranelift, moving more responsibility to the Wasmtime embedding rather than Cranelift itself. This should have no user-visible change, however. #5386
-
The
Val::Float32
andVal::Float64
variants for components now storef32
andf64
instead of the bit representation. #5510
- Handling of DWARF debugging information in components with multiple modules has been fixed to ensure the right info is used for each module. #5358
Released 2023-03-08.
-
Guest-controlled out-of-bounds read/write on x86_64 GHSA-ff4p-7xrq-q5r8
-
Miscompilation of
i8x16.select
with the same inputs on x86_64 GHSA-xm67-587q-r2vw
Released 2022-12-20
-
Dynamic memories are now supported with the pooling instance allocator which can possibly reduce the number of page faults throughout execution at the cost of slower to run code. Page faults are primarily reduced by avoiding releasing memory back to the system, relying on bounds checks to keep the memory inaccessible. #5208
-
The
wiggle
generator now supports function-level control overtracing
calls. #5194 -
Support has been added to
wiggle
to be compatible with shared memories. #5225 #5229 #5264 #5268 #5054 -
The
wiggle
generator now supports a "trappable error" configuration to improve error conversions to guest errors and ensure that no host errors are forgotten or accidentally become traps. Thewasi-common
crate has been updated to use this. #5276 #5279 -
The
memory.atomic.{notify,wait32,wait64}
instructions are now all implemented in Wasmtime. #5255 #5311 -
A
wasm_config_parallel_compilation_set
configuration function has been added to the C API. #5298 -
The
wasmtime
CLI can have its input module piped into it from stdin now. #5342 -
WasmBacktrace::{capture,force_capture}
methods have been added to programmatically capture a backtrace outside of a trapping context. #5341
-
The
S
type parameter onFunc::typed
andInstance::get_typed_func
has been removed and no longer needs to be specified. #5275 -
The
SharedMemory::data
method now returns&[UnsafeCell<u8>]
instead of the prior raw slice return. #5240 -
Creation of a
WasiCtx
will no longer unconditionally acquire randomness from the OS, instead using therand::thread_rng()
function in Rust which is only periodically reseeded with randomness from the OS. #5244 -
Codegen of dynamically-bounds-checked wasm memory accesses has been improved. #5190
-
Wasmtime will now emit inline stack probes in generated functions for x86_64, aarch64, and riscv64 architectures. This guarantees a process abort if an engine was misconfigured to give wasm too much stack instead of optionally allowing wasm to skip the guard page. #5350 #5353
- Dropping a
Module
will now release kernel resources in-use by the pooling allocator when enabled instead of waiting for a new instance to be re-instantiated into prior slots. #5321
Released 2022-12-01.
-
The instruction cache is now flushed for AArch64 Android. #5331
-
Building for FreeBSD and Android has been fixed. #5323
Released 2022-11-21
-
New
WasiCtx::{push_file, push_dir}
methods exist for embedders to add their own objects. #5027 -
Wasmtime's
component-model
support now supportsasync
host functions and embedding in the same manner as core wasm. #5055 -
The
wasmtime
CLI executable now supports a--max-wasm-stack
flag. #5156 -
AOT compilation support has been implemented for components (aka the
component-model
feature of the Wasmtime crate). #5160 -
A new
wasi_config_set_stdin_bytes
function is available in the C API to set the stdin of a WASI-using module from an in-memory slice. #5179 -
When using the pooling allocator there are now options to reset memory with
memset
instead ofmadvisev
on Linux to keep pages resident in memory to reduce page faults when reusing linear memory slots. #5207
-
Consuming 0 fuel with 0 fuel left is now considered to succeed. Additionally a store may not consume its last unit of fuel. #5013
-
A number of variants in the
wasi_common::ErrorKind
enum have been removed. #5015 -
Methods on
WasiDir
now error-by-default instead of requiring a definition by default. #5019 -
Bindings generated by the
wiggle
crate now always depend on thewasmtime
crate meaning crates likewasi-common
no longer compile for platforms such aswasm32-unknown-emscripten
. #5137 -
Error handling in the
wasmtime
crate's API has been changed to primarily work withanyhow::Error
for custom errors. TheTrap
type has been replaced with a simpleenum Trap { ... }
and backtrace information is now stored as aWasmBacktrace
type inserted as context into ananyhow::Error
. Host-functions are expected to returnanyhow::Result<T>
instead of the priorTrap
error return from before. Additionally the oldTrap::i32_exit
constructor is now a concretewasi_commont::I32Exit
type which can be tested for with adowncast_ref
on the error returned from Wasmtime. #5149 -
Configuration of the pooling allocator is now done through a builder-style
PoolingAllocationConfig
API instead of the prior enum-variant API. #5205
-
The instruction cache is now properly flushed for AArch64 on Windows. #4997
-
Backtrace capturing with many sequences of wasm->host calls on the stack no longer exhibit quadratic capturing behavior. #5049
Released 2022-11-10.
-
CVE-2022-39392 - modules may perform out-of-bounds reads/writes when the pooling allocator was configured with
memory_pages: 0
. -
CVE-2022-39393 - data can be leaked between instances when using the pooling allocator.
-
CVE-2022-39394 - An incorrect Rust signature for the C API
wasmtime_trap_code
function could lead to an out-of-bounds write of three zero bytes.
Released 2022-10-27.
- A compilation error when building only the
wasmtime
crate on Windows with only the default features enabled has been fixed. #5134
- The
rayon
dependency added tocranelift-isle
in 2.0.0 has been removed to improve the compile time of thecranelift-codegen
crate. #5101
Released 2022-10-20
-
Cranelift has gained support for forward-edge CFI on the AArch64 backend. #3693
-
A
--disable-parallel-compilation
CLI flag is now implemented forwasmtime
. #4911 -
Tier 3 support has been added for for RISC-V 64 with a new backend in Cranelift for this architecture. #4271
-
Basic tier 3 support for Windows ARM64 has been added but features such as traps don't work at this time. #4990
-
The implementation of the
random_get
function inwasi-common
is now faster by using a userspace CSPRNG rather than the OS for randomness. #4917 -
The AArch64 backend has completed its transition to ISLE. #4851 #4866 #4898 #4884 #4820 #4913 #4942 #4943
-
The size of the
sigaltstack
allocated per-thread for signal handling has been increased from 16k to 64k. #4964
Released 2022-11-10.
-
CVE-2022-39392 - modules may perform out-of-bounds reads/writes when the pooling allocator was configured with
memory_pages: 0
. -
CVE-2022-39393 - data can be leaked between instances when using the pooling allocator.
-
CVE-2022-39394 - An incorrect Rust signature for the C API
wasmtime_trap_code
function could lead to an out-of-bounds write of three zero bytes.
Released 2022-09-26
This is a patch release that incorporates a fix for a miscompilation of an atomic-CAS operator on aarch64. The instruction is not usable from Wasmtime with default settings, but may be used if the Wasm atomics extension is enabled. The bug may also be reachable via other uses of Cranelift. Thanks to @bjorn3 for reporting and debugging this issue!
- Fixed a miscompilation of
atomic_cas
on aarch64. The output register was swapped with a temporary register in the register-allocator constraints. #4959 #4960
Released 2022-09-20
This release marks the official 1.0 release of Wasmtime and represents the culmination of the work amongst over 300 contributors. Wasmtime has been battle-tested in production through multiple embeddings for quite some time now and we're confident in releasing a 1.0 version to signify the stability and quality of the Wasmtime engine.
More information about Wasmtime's 1.0 release is on the Bytecode Alliance's blog with separate posts on Wasmtime's performance features, Wasmtime's security story, and the 1.0 release announcement.
As a reminder the 2.0 release of Wasmtime is scheduled for one month from now on October 20th. For more information see the RFC on Wasmtime's 1.0 release.
-
An incremental compilation cache for Cranelift has been added which can be enabled with
Config::enable_incremental_compilation
, and this option is disabled by default for now. The incremental compilation cache has been measured to improve compile times for cold uncached modules as well due to some wasm modules having similar-enough functions internally. #4551 -
Source tarballs are now available as part of Wasmtime's release artifacts. #4294
-
WASI APIs that specify the REALTIME clock are now supported. #4777
-
WASI's socket functions are now fully implemented. #4776
-
The native call stack for async-executed wasm functions are no longer automatically reset to zero after the stack is returned to the pool when using the pooling allocator. A
Config::async_stack_zeroing
option has been added to restore the old behavior of zero-on-return-to-pool. #4813 -
Inline stack probing has been implemented for the Cranelift x64 backend. #4747
-
Generating of native unwind information has moved from a
Config::wasm_backtrace
option to a newConfig::native_unwind_info
option and is enabled by default. #4643 -
The
memory-init-cow
feature is now enabled by default in the C API. #4690 -
Back-edge CFI is now enabled by default on AArch64 macOS. #4720
-
WASI calls will no longer return NOTCAPABLE in preparation for the removal of the rights system from WASI. #4666
This section of the release notes shouldn't affect external users since no public-facing APIs are affected, but serves as a place to document larger changes internally within Wasmtime.
-
Differential fuzzing has been refactored and improved into one fuzzing target which can execute against any of Wasmtime itself (configured differently), wasmi, V8, or the spec interpreter. Fuzzing now executes each exported function with fuzz-generated inputs and the contents of all of memory and each exported global is compared after each execution. Additionally more interesting shapes of modules are also possible to generate. #4515 #4735 #4737 #4739 #4774 #4773 #4845 #4672 #4674
-
The x64 backend for Cranelift has been fully migrated to ISLE. #4619 #4625 #4645 #4650 #4684 #4704 #4718 #4726 #4722 #4729 #4730 #4741 #4763 #4772 #4780 #4787 #4793 #4809
-
The AArch64 backend for Cranelift has seen significant progress in being ported to ISLE. #4608 #4639 #4634 #4748 #4750 #4751 #4753 #4788 #4796 #4785 #4819 #4821 #4832
-
The s390x backend has seen improvements and additions to fully support the Cranelift backend for rustc. #4682 #4702 #4616 #4680
-
Significant improvements have been made to Cranelift-based fuzzing with more supported features and more instructions being fuzzed. #4589 #4591 #4665 #4670 #4590 #4375 #4519 #4696 #4700 #4703 #4602 #4713 #4738 #4667 #4782 #4783 #4800
-
Optimization work on cranelift has continued across various dimensions for some modest compile-time improvements. #4621 #4701 #4697 #4711 #4710 #4829
Released 2022-08-20
This was a relatively quiet release in terms of user-facing features where most of the work was around the internals of Wasmtime and Cranelift. Improvements internally have been made along the lines of:
- Many more instructions are now implemented with ISLE instead of handwritten lowerings.
- Many improvements to the cranelift-based fuzzing.
- Many platform improvements for s390x including full SIMD support, running
rustc_codegen_cranelift
with features likei128
, supporting more ABIs, etc. - Much more of the component model has been implemented and is now fuzzed.
Finally this release is currently scheduled to be the last 0.*
release of
Wasmtime. The upcoming release of Wasmtime on September 20 is planned to be
Wasmtime's 1.0 release. More information about what 1.0 means for Wasmtime is
available in the 1.0 RFC
-
Stack walking has been reimplemented with frame pointers rather than with native unwind information. This means that backtraces are feasible to capture in performance-critical environments and in general stack walking is much faster than before. #4431
-
The WebAssembly
simd
proposal is now fully implemented for the s390x backend. #4427 -
Support for AArch64 has been added in the experimental native debuginfo support that Wasmtime has. #4468
-
Support building the C API of Wasmtime with CMake has been added. #4369
-
Clarification was added to Wasmtime's documentation about "tiers of support" for various features. #4479
-
Support for
filestat_get
has been improved for stdio streams in WASI. #4531 -
Enabling the
vtune
feature no longer breaks builds on AArch64. #4533
Released 2022-07-20.
- An s390x-specific codegen bug in addition to a mistake introduced in the fix of CVE-2022-31146 were fixed. #4490
Released 2022-07-20
-
Initial support for shared memories and the
threads
WebAssembly proposal has been added. Note that this feature is still experimental and not ready for production use yet. #4187 -
A new
Linker::define_unknown_imports_as_traps
method and--trap-unknown-imports
CLI flag have been added to conveniently support running modules with imports that aren't dynamically called at runtime. #4312 -
The VTune profiling strategy can now be selected through the C API. #4316
-
Some methods on the
Config
structure now return&mut Self
instead ofResult<&mut Self>
since the validation is deferred untilEngine::new
:profiler
,cranelift_flag_enable
,cranelift_flag_set
,max_wasm_stack
,async_stack_size
, andstrategy
. #4252 #4262 -
Parallel compilation of WebAssembly modules is now enabled in the C API by default. #4270
-
Implicit Cargo features of the
wasmtime
introduced throughoptional
dependencies may have been removed since namespaced features are now used. It's recommended to only used the set of named[features]
for Wasmtime. #4293 -
Register allocation has fixed a few issues related to excessive memory usage at compile time. #4324
-
A refactor of
Config
was made to fix an issue that the order of calls toConfig
matters now, which may lead to unexpected behavior. #4252 #4262 -
Wasmtime has been fixed to work on SSE2-only x86_64 platforms when the
simd
feature is disabled inConfig
. #4231 -
Generation of platform-specific unwinding information is disabled if
wasm_backtrace
andwasm_reference_types
are both disabled. #4351
Released 2022-07-20.
- An s390x-specific codegen bug in addition to a mistake introduced in the fix of CVE-2022-31146 were fixed. #4491
Released 2022-07-20.
-
A miscompilation when handling constant divisors on AArch64 has been fixed. CVE-2022-31169
-
A use-after-free possible with accidentally missing stack maps has been fixed. CVE-2022-31146
Released 2022-06-27.
-
A register allocator bug was fixed that could affect direct users of Cranelift who use struct-return (
sret
) arguments. The bug had to do with the handling of physical register constraints in the function prologue. No impact should be possible for users of Cranelift via the Wasm frontend, including Wasmtime. regalloc2#60 #4333 -
Lowering bugs for the
i8x16.swizzle
andselect
-with-v128
-inputs instructions were fixed for the x86_64 code generator. Note that aarch64 and s390x are unaffected. #4334 -
A bug in the 8-bit lowering of integer division on x86-64 was fixed in Cranelift that could cause a register allocator panic due to an undefined value in a register. (The divide instruction does not take a register
rdx
as a source when 8 bits but the metadata incorrectly claimed it did.) No impact on Wasm/Wasmtime users, and impact on direct Cranelift embedders limited to compilation panics. #4332
Released 2022-06-21
-
Enabling or disabling NaN canonicalization in generated code is now exposed through the C API. #4154
-
A user-defined callback can now be invoked when an epoch interruption happens via the
Store::epoch_deadline_callback
API. #4152 -
Basic alias analysis with redundant-load elimintation and store-to-load forwarding optimizations has been added to Cranelift. #4163
-
Traps originating from epoch-based interruption are now exposed as
TrapCode::Interrupt
. #4105 -
Binary builds for AArch64 now require glibc 2.17 and for s390x require glibc 2.16. Previously glibc 2.28 was required. #4171
-
The
wasmtime::ValRaw
now has all of its fields listed as private and instead constructors/accessors are provided for getting at the internal data. #4186 -
The
wasm-backtrace
Cargo feature has been removed in favor of aConfig::wasm_backtrace
runtime configuration option. Additionally backtraces are now only captured when an embedder-generated trap actually reaches a WebAssembly call stack. #4183 -
Usage of
*_unchecked
APIs forFunc
in thewasmtime
crate and C API now take ausize
parameter indicating the number ofValRaw
values behind the associated pointer. #4192
- An improvement was made to the spill-slot allocation in code generation to fix an issue where some stack slots accidentally weren't reused. This issue was introduced with the landing of regalloc2 in 0.37.0 and may have resulted in larger-than-intended increases in stack frame sizes. #4222
Released 2022-05-20
-
Updated Cranelift to use regalloc2, a new register allocator. This should result in ~20% faster compile times, and for programs that suffered from register-allocation pressure before, up to ~20% faster generated code. #3989
-
Pre-built binaries for macOS M1 machines are now available as release artifacts. #3983
-
Copy-on-write images of memory can now be manually initialized for a
Module
with an explicit method call, but it is still not required to call this method and will automatically otherwise happen on the first instantiation. #3964
- Using
InstancePre::instantiate
orLinker::instantiate
will now panic as intended when used with an async-configuredStore
. #3972
- The unsafe
ValRaw
type in thewasmtime
crate now always stores its values in little-endian format instead of the prior native-endian format. Users ofValRaw
are recommended to audit their existing code for usage to continue working on big-endian platforms. #4035
- Support for
Config::paged_memory_initialization
and theuffd
crate feature have been removed from thewasmtime
crate. Users should migrate to usingConfig::memory_init_cow
which is more portable and faster at this point. #4040
Released 2022-04-20
-
Support for epoch-based interruption has been added to the C API. #3925
-
Support for disabling libunwind-based backtraces of WebAssembly code at compile time has been added. #3932
-
Async support for call hooks has been added to optionally execute "blocking" work whenever a wasm module is entered or exited relative to the host. #3876
- Loading a
Module
will now check, at runtime, that the compilation settings enabled in aConfig
are compatible with the native host. For example this ensures that if avx2 is enabled that the host actually has avx2 support. #3899
-
Support for
Config::interruptable
andInterruptHandle
has been removed from thewasmtime
crate. Users should migrate to using epoch-based interruption instead. #3925 -
The module linking implementation of Wasmtime has been removed to make room for the upcoming support for the component model. #3958
Released 2022-04-11.
- Backported a bugfix for an instruction lowering issue that could cause a regalloc panic due to an undefined register in some cases. No miscompilation was ever possible, but panics would result in a compilation failure. #4012
Released 2022-03-31.
- CVE-2022-24791:
Fixed a use after free with
externref
s and epoch interruption.
Released 2022-03-09.
- Fixed a bug in the x86-64 lowering of the
uextend
opcode for narrow (i8
,i16
) integer sources when the value is produced by one of several arithmetic instructions. #3906
Released 2022-03-07.
- The
wasmtime_wasi::add_to_linker
function now allows providing a context object of a custom type instead ofwasmtime_wasi::WasiCtx
, as long as that type implements the required WASI snapshot traits. This allows, for example, wrappingWasiCtx
into a struct and providing custom implementations for those traits to override the default behaviour.
-
WebAssembly tables of
funcref
values are now lazily initialized which can, in some cases, greatly speed up instantiation of a module. #3733 -
The
memfd
feature in 0.34.0, now renamed tomemory-init-cow
, has been enabled by default. This means that, where applicable, WebAssembly linear memories are now initialized with copy-on-write mappings. Support from this has been expanded from Linux-only to include macOS and other Unix systems when modules are loaded from precompiled*.cwasm
files on disk. #3777 #3778 #3787 #3819 #3831 -
Clarify that SSE 4.2 (and prior) is required for running WebAssembly code with simd support enabled on x86_64. #3816 #3817 #3833 #3825
-
Support for profiling with VTune is now enabled at compile time by default, but it remains disabled at runtime by default. #3821
-
The
ModuleLimits
type has been removed from the configuration of the pooling allocator in favor of configuring the total size of an instance allocation rather than each individual field. #3837 -
The native stack size allowed for WebAssembly has been decreased from 1 MiB to 512 KiB on all platforms to better accomodate running wasm on the main thread on Windows. #3861
-
The
wasi-common
crate now supports doing polls for both read and write interest on a file descriptor at the same time. #3866
- The
Store::call_hook
callback is now invoked when entering host functions defined with*_unchecked
variants. #3881
- The incomplete and unmaintained ARM32 backend has been removed from Cranelift. #3799
Released 2022-03-31.
- CVE-2022-24791:
Fixed a use after free with
externref
s and epoch interruption.
Released 2022-02-16.
- CVE-2022-23636: Fixed an invalid drop of a partially-initialized instance in the pooling instance allocator.
Released 2022-02-16.
- CVE-2022-23636: Fixed an invalid drop of a partially-initialized instance in the pooling instance allocator.
Released 2022-02-07.
-
The
wasi-common
default implementation of some attributes of files has been updated to ensure thatwasi-libc
'sisatty
function works as intended. #3696 -
A benign debug assertion related to
externref
and garbage-collection has been fixed. #3734
-
Function names are now automatically demangled when informing profilers of regions of JIT code to apply Rust-specific demangling rules if applicable. #3683
-
Support for profiling JIT-generated trampolines with VTune has been added. #3687
-
Wasmtime now supports a new method of async preemption dubbed "epoch-based interruption" which is intended to be much more efficient than the current fuel-based method of preemption. #3699
-
On Linux Wasmtime will now by default use copy-on-write mappings to initialize memories of wasm modules where possible, accelerating instantiation by avoiding costly memory copies. When combined with the pooling allocator this can also be used to speed up instance-reuse cases due to fewer syscalls to change memory mappings being necessary. #3697 #3738 #3760
-
Wasmtime now supports the recently-added
sock_accept
WASI function. #3711 -
Cranelift now has support for specifying blocks as cold. #3698
-
Many more instructions for the x64 backend have been migrated to ISLE, additionally with refactorings to make incorrect lowerings harder to accidentally write. #3653 #3659 #3681 #3686 #3688 #3690 #3752
-
More instructions in the aarch64 backend are now lowered with ISLE. #3658 #3662
-
The s390x backend's lowering rules are now almost entirely defined with ISLE. #3702 #3703 #3706 #3717 #3723 #3724
-
Instantiation of modules in Wasmtime has been further optimized now that the copy-on-write memory initialization removed the previously most-expensive part of instantiating a module. #3727 #3739 #3741 #3742
Released 2022-01-05.
-
Compiled wasm modules may now optionally omit debugging information about mapping addresses to source locations, resulting in smaller binaries. #3598
-
The WebAssembly SIMD proposal is now enabled by default. #3601
Released 2022-01-04.
-
Cranelift: remove recently-added build dependency on
sha2
to allow usage in some dependency-sensitive environments, by computing ISLE manifest hashes with a different hash function. #3619 -
Cranelift: fixed 8- and 16-bit behavior of popcount (bit population count) instruction. Does not affect Wasm frontend. #3617
-
Cranelift: fixed miscompilation of 8- and 16-bit bit-rotate instructions. Does not affect Wasm frontend. #3610
Released 2021-12-13.
-
A new configuration option has been added to force using a "static" memory style to automatically limit growth of memories in some configurations. #3503
-
The
InstancePre<T>
type now implementsClone
. #3510 -
Cranelift's instruction selection process has begun to be migrated towards the ISLE compiler and definition language. #3506
-
A
pooling-allocator
feature has been added, which is on-by-default, to disable the pooling allocator at compile time. #3514
-
A possible panic when parsing a WebAssembly
name
section has been fixed. #3509 -
Generating native DWARF information for some C-produced modules has been fixed, notably those where there may be DWARF about dead code. #3498
-
A number of SIMD code generation bugs have been fixed in the x64 backend by migrating their lowerings to ISLE.
Released 2021-10-29.
-
New
Func::new_unchecked
andFunc::call_unchecked
APIs have been added with accompanying functions in the C API to improve the performance of calls into wasm and the host in the C API. #3350 -
Release binaries are now available for the s390x-unknown-linux-gnu architecture. #3372
-
A new
ResourceLimiterAsync
trait is added which allows asynchronous blocking of WebAssembly on instructions such asmemory.grow
. #3393
-
The
Func::call
method now takes a slice to write the results into rather than returning a boxed slice. #3319 -
Trampolines are now covered when jitdump profiling is enabled. #3344
-
Debugging with GDB has been fixed on Windows. #3373
-
Some quadradic behavior in Wasmtime's compilation of modules has been fixed. #3469 #3466
-
Bounds-checks for wasm memory accesses in certain non-default configurations have been fixed to correctly allow loads at the end of the address space. #3462
-
When type-checking memories and tables for satisfying instance imports the runtime size of the table/memory is now consulted instead of the object's original type. #3450
Released 2021-09-17.
-
CVE-2021-39216: Fixed a use after free passing
externref
s to Wasm in Wasmtime. -
CVE-2021-39218: Fixed an out-of-bounds read/write and invalid free with
externref
s and GC safepoints in Wasmtime. -
CVE-2021-39219: Fixed a bug where using two different
Engine
s with the sameLinker
-define functions caused unsafety withoutunsafe
blocks.
-
Added experimental support for the in-progress 64-bit memories Wasm proposal.
-
Added support to build Wasmtime without the compiler. This lets you run pre-compiled Wasm modules, without the ability (or potential attack surface) of compiling new Wasm modules. The compilation functionality is gated by the on-by-default
cranelift
cargo feature. -
Added support for NaN canonicalization with SIMD vectors.
-
Added support for differential fuzzing against V8's Wasm engine.
-
Added support for fuzzing against the Wasm spec interpreter.
-
Enabled SIMD fuzzing on oss-fuzz.
-
A variety of performance improvements to loading pre-compiled modules.
-
A variety of performance improvements to function calls, both through Rust and the C API.
-
Leaf functions that do not use the stack no longer bump the frame pointer on aarch64 and s390x.
-
Many updates and expanded instruction support to the in-progress CLIF interpreter.
-
Expanded fuzzing of reference types and GC.
-
A number of fixes to both aarch64 and x86_64 support for the Wasm SIMD proposal and the underlying CLIF vector instructions.
-
Fixed a potential infinite loop in the SSA computation for
cranelift-frontend
. This was not reachable fromcranelift-wasm
or Wasmtime, but might have affected general Cranelift users.
- The
wasmtime wasm2obj
subcommand has been removed. Generating raw object files for linking natively is no longer supported. Use thewasmtime compile
subcommand to pre-compile a Wasm module andwasmtime run
to run pre-compiled Wasm modules.
Released 2021-08-02.
-
Instance exports are now loaded lazily from instances instead of eagerly as they were before. This is an internal-only change and is not a breaking change. #2984
-
All linear memories created by Wasmtime will now, by default, have guard pages in front of them in addition to after them. This is intended to help mitigate future bugs in Cranelift, should they arise. #2977
-
Linear memories now correctly support a maximum size of 4GB. Previously, the limit field was 32 bits, which did not properly support a full 4GB memory. This update is also a necessary change in preparation for future memory64 support. #3013 #3134
-
Injection counts of fuel into a
wasmtime::Store
now uses a u64 instead of a u32. #3048
-
Support for
i128
has improved in the AArch64 backend. #2959 #2975 #2985 #2990 #3002 #3004 #3005 #3008 #3027 -
The
wasmtime::Linker
type now implementsClone
. #2993 -
Support for the SIMD proposal on both x86_64 and AArch64 has improved. On x86_64, all SIMD opcodes are now supported. #2997 #3035 #2982 #3084 #3082 #3107 #3105 #3114 #3070 #3126
-
A
Trap
can now display its reason without also displaying the backtrace. #3033 -
An initiall fuzzer for CLIF has been added. #3038
-
High-level architecture documentation has been added for Wasmtime. #3019
-
Support for multi-memory can now be configured in Wasmtime's C API. #3071
-
The
wasmtime
crate now supports aposix-signals-on-macos
feature to force the usage of signals instead of mach ports to handle traps on macOS. #3063 -
Wasmtime's C API now has a
wasmtime_trap_code
function to get the raw trap code, if present, for a trap. #3086 -
Wasmtime's C API now has a
wasmtime_linker_define_func
function to define a store-independent function within a linker. #3122 -
A
wasmtime::Linker::module_async
function was added as the asynchronous counterpart towasmtime::Linker::module
. #3121
-
Compiling the
wasmtime
crate into adylib
crate type has been fixed. #3010 -
The enter/exit hooks for WebAssembly are now executed for an instance's
start
function, if present. #3001 -
Some WASI functions in
wasi-common
have been fixed for big-endian platforms. #3016 -
Wasmtime no longer erroneously assumes that all custom sections may contain DWARF information, reducing instances of
Trap
'sDisplay
implementation providing misleading information to set an env var to get more information. #3083 -
Some issues with parsing DWARF debug information have been fixed. #3116
Released 2021-06-09.
- Breaking: Wasmtime's embedding API has been redesigned, as specified in RFC
11. Rust users can now enjoy easier times with
Send
andSync
, and all users can now more clearly manage memory, especially in the C API. Language embeddings have been updated to the new API as well. #2897
-
A new
InstancePre
type, created withLinker::instantiate_pre
, has been added to perform type-checking of an instance once and reduce the work done for each instantiation of a module: #2962 -
Deserialization of a module can now optionally skip checking the wasmtime version string: #2945
-
A method has been exposed to frontload per-thread initialization costs if the latency of every last wasm call is important: #2946
-
Hooks have been added for entry/exit into wasm code to allow embeddings to track time and other properties about execution in a wasm environment: #2952
- Multiple returns on macOS AArch64 have been fixed: #2956
Released 2021-05-21.
- Fixed a security issue in Cranelift's x64 backend that could result in a heap sandbox escape due to an incorrect sign-extension: #2913.
-
Support for IBM z/Archiecture (
s390x
) machines in Cranelift and Wasmtime: #2836, #2837, #2838, #2843, #2854, #2870, #2871, #2872, #2874. -
Improved async support in wasi-common runtime: #2832.
-
Added
Store::with_limits
,StoreLimits
, andResourceLimiter
to the Wasmtime API to help with enforcing resource limits at runtime. TheResourceLimiter
trait can be implemented by custom resource limiters to decide if linear memories or tables can be grown. -
Added
allow-unknown-exports
option for the run command: #2879. -
Added API to notify that a
Store
has moved to a new thread: #2822. -
Documented guidance around using Wasmtime in multithreaded contexts: #2812. In the future, the Wasmtime API will change to allow some of its core types to be Send/Sync; see the in-progress #2897 for details.
-
Support calls from native code to multiple-return-value functions: #2806.
- Breaking:
Memory::new
has been changed to returnResult
as creating a host memory object is now a fallible operation when the initial size of the memory exceeds the store limits.
-
Many instruction selection improvements on x64 and aarch64: #2819, #2828, #2823, #2862, #2886, #2889, #2905.
-
Improved performance of Wasmtime runtime substantially: #2811, #2818, #2821, #2847, #2900.
-
Fixed WASI issue with file metadata on Windows: #2884.
-
Fixed an issue with debug info and an underflowing (trapping) offset: #2866.
-
Fixed an issue with unwind information in the old x86 backend: #2845.
-
Fixed i32 spilling in x64 backend: #2840.
Released 2021-04-05.
-
Added the
wasmtime compile
command to support AOT compilation of Wasm modules. This adds theEngine::precompile_module
method. Also added theConfig::target
method to change the compilation target of the configuration. This can be used in conjunction withEngine::precompile_module
to target a different host triple than the current one. #2791 -
Support for macOS on aarch64 (Apple M1 Silicon), including Apple-specific calling convention details and unwinding/exception handling using Mach ports. #2742, #2723
-
A number of SIMD instruction implementations in the new x86-64 backend. #2771
-
Added the
Config::cranelift_flag_enable
method to enable setting Cranelift boolean flags or presets in a config. -
Added CLI option
--cranelift-enable
to enable boolean settings and ISA presets. -
Deduplicate function signatures in Wasm modules. #2772
-
Optimize overheads of calling into Wasm functions. #2757, #2759
-
Improvements related to Module Linking: compile fewer trampolines;
-
Re-export sibling crates from
wasmtime-wasi
to make embedding easier without needing to match crate versions. #2776
-
Switched the default compiler backend on x86-64 to Cranelift's new backend. This should not have any user-visible effects other than possibly runtime performance improvements. The old backend is still available with the
old-x86-backend
feature flag to thecranelift-codegen
orwasmtime
crates, or programmatically withBackendVariant::Legacy
. We plan to maintain the old backend for at least one more release and ensure it works on CI. #2718 -
Breaking:
Module::deserialize
has been removed in favor ofModule::new
. -
Breaking:
Config::cranelift_clear_cpu_flags
was removed. UseConfig::target
to clear the CPU flags for the host's target. -
Breaking:
Config::cranelift_other_flag
was renamed toConfig::cranelift_flag_set
. -
CLI changes:
- Wasmtime CLI options to enable WebAssembly features have been replaced with
a singular
--wasm-features
option. The previous options are still supported, but are not displayed in help text. - Breaking: the CLI option
--cranelift-flags
was changed to--cranelift-set
. - Breaking: the CLI option
--enable-reference-types=false
has been changed to--wasm-features=-reference-types
. - Breaking: the CLI option
--enable-multi-value=false
has been changed to--wasm-features=-multi-value
. - Breaking: the CLI option
--enable-bulk-memory=false
has been changed to--wasm-features=-bulk-memory
.
- Wasmtime CLI options to enable WebAssembly features have been replaced with
a singular
-
Improved error-reporting in wiggle. #2760
-
Make WASI sleeping fallible (some systems do not support sleep). #2756
-
WASI: Support
poll_oneoff
with a sleep. #2753 -
Allow a
StackMapSink
to be passed when defining functions withcranelift-module
. #2739 -
Some refactoring in new x86-64 backend to prepare for VEX/EVEX (e.g., AVX-512) instruction encodings to be supported. #2799
-
Fixed a corner case in
srem
(signed remainder) in the new x86-64 backend:INT_MIN % -1
should return0
, rather than trapping. This only occurred whenavoid_div_traps == false
was set by the embedding. #2763 -
Fixed a memory leak of the
Store
when an instance traps. #2803 -
Fixed memory-initialization bug in uffd allocator that could copy into the wrong destination under certain conditions. Does not affect the default wasmtime instance allocator. #2801
-
Fix printing of float values from the Wasmtime CLI. #2797
-
Remove the ability for the
Linker
to instantiate modules with duplicate import strings of different types. #2789
Released 2021-03-16.
-
An implementation of a pooling instance allocator, optionally backed by
userfaultfd
on Linux, was added to improve the performance of embeddings that instantiate a large number of instances continuously. #2518 -
Host functions can now be defined on
Config
to share the function across allStore
objects connected to anEngine
. This can improve the time it takes to instantiate instances in a short-livedStore
. #2625 -
The
Store
object now supports having typed values attached to it which can be retrieved from host functions. #2625 -
The
wiggle
code generator now supportsasync
host functions. #2701
-
The
Func::getN{,_async}
APIs have all been removed in favor of a newFunc::typed
API which should be more compact in terms of API surface area as well as more flexible in how it can be used. #2719 -
Engine::new
has been changed from returningEngine
to returninganyhow::Result<Engine>
. Callers ofEngine::new
will need to be updated to use the?
operator on the return value or otherwise unwrap the result to get theEngine
.
- Interpretation of timestamps in
poll_oneoff
for WASI have been fixed to correctly use nanoseconds instead of microseconds. #2717
Released 2021-03-04.
- Implement support for
async
functions in Wasmtime #2434
- Fix preservation of the sigaltstack on macOS #2676
- Fix incorrect semver dependencies involving fs-set-times. #2705
- Fix some
i128
shift-related bugs in x64 backend. #2682 - Fix incomplete trap metadata due to multiple traps at one address #2685
Released 2021-02-16.
- Support for limiting WebAssembly execution with fuel was added, including support in the C API. #2611 #2643
- Wasmtime now has more knobs for limiting memory and table allocations #2617
- Added a method to share
Config
across machines #2608 - Added a safe memory read/write API #2528
- Added support for the experimental wasi-crypto APIs #2597
- Added an instance limit to
Config
#2593 - Implemented module-linking's outer module aliases #2590
- Cranelift now supports 128-bit operations for the new x64 backend. #2539
- Cranelift now has detailed debug-info (DWARF) support in new backends (initially x64). #2565
- Cranelift now uses the
POPCNT
,TZCNT
, andLZCNT
, as well as SSE 4.1 rounding instructions on x64 when available. - Cranelift now uses the
CNT
, instruction on aarch64 when available.
-
A new WASI implementation built on the new
cap-std
crate was added, replacing the previous implementation. This brings improved robustness, portability, and performance. -
wasmtime_wasi::WasiCtxBuilder
moved towasi_cap_std_sync::WasiCtxBuilder
. -
The WebAssembly C API is updated, with a few minor API changes #2579
- Fixed a panic in WASI
fd_readdir
on large directories #2620 - Fixed a memory leak with command modules #2017
Released 2021-01-07.
-
Experimental support for the module-linking proposal was added. #2094
-
Added support for the reference types proposal on the aarch64 architecture. #2410
-
Fixed an issue where the
select
instruction didn't acceptv128
SIMD operands. #2391 -
Fixed an issue where Wasmtime could potentially use the wrong stack map during GCs, leading to a panic. #2396
-
Fixed an issue where if a host-defined function erroneously returned a value from a different store, that value would be leaked. #2424
-
Fixed a bug where in certain cases if a module's instantiation failed, it could leave trampolines in the store that referenced the no-longer-valid instance. These trampolines could be reused in future instantiations, leading to use after free bugs. #2408
-
Fixed a miscompilation on aarch64 where certain instructions would read
SP
instead of the zero register. This could only affect you if you explicitly enabled the Wasm SIMD proposal. #2548
Released 2020-11-05.
-
Experimental support for the multi-memory proposal was added. #2263
-
The
Trap::trap_code
API enables learning what kind of trap was raised. #2309
-
WebAssembly module validation is now parallelized. #2059
-
Documentation is now available at docs.wasmtime.dev. #2317
-
Windows now compiles like other platforms with a huge guard page instead of having its own custom limit which made modules compile and run more slowly. #2326
-
The size of the cache entry for serialized modules has been greatly reduced. #2321 #2322 #2324 #2325
-
The
FuncType
API constructor and accessors are now iterator-based. #2365
- A panic in compiling reference-types-using modules has been fixed. #2350
Released 2020-09-23.
-
Support for explicitly serializing and deserializing compiled wasm modules has been added. #2020
-
A
wasmtime_store_gc
C API was added to run GC forexternref
. #2052 -
Support for atomics in Cranelift has been added. Support is not fully implemented in Wasmtime at this time, however. #2077
-
The
Caller::get_export
function is now implemented forFunc
references as well. #2108
-
Leaks in the C API have been fixed. #2040
-
The
wasm_val_copy
C API has been fixed for reference types. #2041 -
Fix a panic with
Func::new
and reference types when the store doesn't have reference types enabled. #2039
Released 2020-07-14.
-
The WebAssembly reference-types proposal is now supported in Wasmtime and the C API. #1832, #1882, #1894, #1901, #1923, #1969, #1973, #1982, #1984, #1991, #1996
-
The [WebAssembly simd proposal's][simd] spec tests now pass in Wasmtime. #1765, #1876, #1941, #1957, #1990, #1994
-
Wasmtime can now be compiled without the usage of threads for parallel compilation, although this is still enabled by default. #1903
-
The C API is now documented. #1928, #1959, #1968
-
A
wasmtime_linker_get_one_by_name
function was added to the C API. #1897 -
A
wasmtime_trap_exit_status
function was added to the C API. #1912 -
Compilation for the
aarch64-linux-android
target should now work, although keep in mind this platform is not fully tested still. #2002
-
Runtime warnings when using Wasmtime on musl have been fixed. #1914
-
A bug affecting Windows unwind information with functions that have spilled floating point registers has been fixed. #1983
- Wasmtime's default branch and development now happens on the
main
branch instead ofmaster
. #1924
-
The "host info" support in the C API has been removed since it was never fully or correctly implemented. #1922
-
Support for the
*_same
functions in the C API has been removed in the same vein as the host info APIs. #1926
Release 2020-06-09.
The WasmTy
trait is now implemented for u32
and u64
.
Released 2020-06-01.
-
The Commands and Reactors ABI is now supported in the Rust API.
Linker::module
loads a module and automatically handles Commands and Reactors semantics.
The Table::grow
function now returns the previous table size, making it consistent
with the table.grow
instruction.
New Wasmtime-specific C APIs for working with tables were added which provide more
detailed error information and which make growing a table more consistent with the
table.grow
instruction as well.
The C API now includes support for enabling logging in Wasmtime.
The WASI proc_exit
function no longer exits the host process. It now unwinds the
callstack back to the wasm entrypoint, and the exit value is available from the
Trap::i32_exit_status
method.
The WebAssembly multi-value proposal is now enabled by default.
The Rust API does not require a store provided during Module::new
operation. The Module
can be send accross threads and instantiate for a specific store. The Instance::new
now requires the store.
Released 2020-04-29.
-
The
Instance
struct has new accessors,get_func
,get_table
,get_memory
, andget_global
for quickly looking up exported functions, tables, memories, and globals by name. #1524 -
The C API has a number of new
wasmtime_*
functions which return error objects to get detailed error information when an API fails. #1467 -
Users now have fine-grained control over creation of instances of
Memory
with a newMemoryCreator
trait. #1400 -
Go bindings for Wasmtime are now available. #1481
-
APIs for looking up values in a
Linker
have been added. #1480 -
Preliminary support for AArch64, also known as ARM64. #1581
-
Instance::exports
now returnsExport
objects which contain thename
s of the exports in addition to theirExtern
definitions, so it's no longer necessary to useModule::exports
to obtain the export names. #1524 -
The
Func::call
API has changed its error type fromTrap
toanyhow::Error
to distinguish between wasm traps and runtime violations (like the wrong number of parameters). #1467 -
A number of
wasmtime_linker_*
andwasmtime_config_*
C APIs have new type signatures which reflect returning errors. #1467 -
Bindings for .NET have moved to https://github.com/bytecodealliance/wasmtime-dotnet. #1477
-
Passing too many imports to
Instance::new
is now considered an error. #1478
- Spurious segfaults due to out-of-stack conditions when handling signals have been fixed. #1315
Released 2020-03-31.
Full release produced for all artifacts to account for hiccups in 0.13.0 and 0.14.0.
This version ended up not getting a full release
Fix build errors in wasi-common on Windows.
Released 2020-03-24.
-
Lots of documentation of
wasmtime
has been updated. Be sure to check out the book and API documentation! -
All wasmtime example programs are now in a top-level
examples
directory and are available in both C and Rust. #1286 -
A
wasmtime::Linker
type was added to conveniently link link wasm modules together and create instances that reference one another. #1384 -
Wasmtime now has "jitdump" support enabled by default which allows profiling wasm code on linux. #1310
-
The
wasmtime::Caller
type now exists as a first-class way to access the caller's exports, namely memory, when implementing host APIs. This can be the first argument of functions defined withFunc::new
orFunc::wrap
which allows easily implementing methods which take a pointer into wasm memory. Note that this only works for accessing the caller'sMemory
for now and it must be exported. This will eventually be replaced with a more general-purpose mechanism like interface types. #1290 -
The bulk memory proposal has been fully implemented. #1264 #976
-
Virtual file support has been added to
wasi-common
. #701 -
The C API has been enhanced with a Wasmtime-specific
wasmtime_wat2wasm
to parse*.wat
files via the C API. #1206
-
The
wast
andwasm2obj
standalone binaries have been removed. They're available via thewasmtime wast
andwasmtime wasm2obj
subcommands. #1372 -
The
wasi-common
crate now uses the newwiggle
crate to auto-generate a trait which is implemented for the current wasi snapshot. #1202 -
Wasmtime no longer has a dependency on a C++ compiler. #1365
-
The
Func::wrapN
APIs have been consolidated into oneFunc::wrap
API. #1363 -
The
Callable
trait has been removed and nowFunc::new
takes a closure directly. #1363 -
The Cranelift repository has been merged into the Wasmtime repository.
-
Support for interface types has been temporarily removed. #1292
-
The exit code of the
wasmtime
CLI has changed if the program traps. #1274 -
The
wasmtime
CLI now logs to stderr by default and the-d
flag has been renamed to--log-to-file
. #1266 -
Values cannot cross
Store
objects, meaning you can't instantiate a module with values from different stores nor pass values from different stores into methods. #1016
Released 2020-02-26.
-
Support for the WebAssembly text annotations proposal has been added. #998
-
An initial C API for instantiating WASI modules has been added. #977
-
A new suite of
Func::getN
functions have been added to thewasmtime
API to call statically-known function signatures in a highly optimized fashion. #955 -
Initial support for profiling JIT code through perf jitdump has been added. #360
-
More CLI flags corresponding to proposed WebAssembly features have been added. #917
-
The
wasmtime
CLI as well as embedding API will optimize WebAssembly code by default now. #973 #988 -
The
verifier
pass in Cranelift is now no longer run by default when using the embedding API. #882
-
Code caching now accurately accounts for optimization levels, ensuring that if you ask for optimized code you're not accidentally handed unoptimized code from the cache. #974
-
Automated releases for tags should be up and running again, along with automatic publication of the
wasmtime
Python package. #971