Repository: bytecodealliance/wasmtime
Pull request #7286 (2023-10-18 19:52:57)

Update wasm-tools deps and `wit-bindgen`
This'll have some knock-on effects when applied to #7272 but that's left for a future PR. This one's just about getting the deps in.

<!--
Please make sure you include the following information:

- If this work has been discussed elsewhere, please include a link to that
  conversation. If it was discussed in an issue, just mention "issue #...".

- Explain why this change is needed. If the details are in an issue already,
  this can be brief.

Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.html

Please ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->



Patch:
diff --git a/Cargo.lock b/Cargo.lock
index 7b45f8915..449a7638a 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -650,7 +650,7 @@ dependencies = [
  "target-lexicon",
  "thiserror",
  "toml",
- "wasmparser 0.115.0",
+ "wasmparser",
  "wat",
 ]
 
@@ -829,7 +829,7 @@ dependencies = [
  "serde_derive",
  "smallvec",
  "target-lexicon",
- "wasmparser 0.115.0",
+ "wasmparser",
  "wasmtime-types",
  "wat",
 ]
@@ -2070,17 +2070,6 @@ dependencies = [
  "cc",
 ]
 
-[[package]]
-name = "pulldown-cmark"
-version = "0.9.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "77a1a2f1f0a7ecff9c31abbe177637be0e97a0aef46cf8738ece09327985d998"
-dependencies = [
- "bitflags 1.3.2",
- "memchr",
- "unicase",
-]
-
 [[package]]
 name = "quick-error"
 version = "1.2.3"
@@ -2680,7 +2669,7 @@ version = "0.0.0"
 dependencies = [
  "cargo_metadata",
  "heck",
- "wit-component 0.15.0",
+ "wit-component",
 ]
 
 [[package]]
@@ -2874,15 +2863,6 @@ version = "1.15.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "dcf81ac59edc17cc8697ff311e8f5ef2d99fcbd9817b34cec66f90b6c3dfd987"
 
-[[package]]
-name = "unicase"
-version = "2.6.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "50f37be617794602aabbeee0be4f259dc1778fabe05e2d67ee8f79326d5cb4f6"
-dependencies = [
- "version_check",
-]
-
 [[package]]
 name = "unicode-bidi"
 version = "0.3.8"
@@ -2977,7 +2957,7 @@ name = "verify-component-adapter"
 version = "15.0.0"
 dependencies = [
  "anyhow",
- "wasmparser 0.115.0",
+ "wasmparser",
  "wat",
 ]
 
@@ -3075,7 +3055,7 @@ dependencies = [
  "byte-array-literals",
  "object",
  "wasi",
- "wasm-encoder 0.35.0",
+ "wasm-encoder",
  "wit-bindgen",
 ]
 
@@ -3150,15 +3130,6 @@ version = "0.2.87"
 source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1"
 
-[[package]]
-name = "wasm-encoder"
-version = "0.33.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "34180c89672b3e4825c3a8db4b61a674f1447afd5fe2445b2d22c3d8b6ea086c"
-dependencies = [
- "leb128",
-]
-
 [[package]]
 name = "wasm-encoder"
 version = "0.35.0"
@@ -3180,8 +3151,8 @@ dependencies = [
  "serde_derive",
  "serde_json",
  "spdx",
- "wasm-encoder 0.35.0",
- "wasmparser 0.115.0",
+ "wasm-encoder",
+ "wasmparser",
 ]
 
 [[package]]
@@ -3194,8 +3165,8 @@ dependencies = [
  "log",
  "rand",
  "thiserror",
- "wasm-encoder 0.35.0",
- "wasmparser 0.115.0",
+ "wasm-encoder",
+ "wasmparser",
 ]
 
 [[package]]
@@ -3208,8 +3179,8 @@ dependencies = [
  "flagset",
  "indexmap 2.0.0",
  "leb128",
- "wasm-encoder 0.35.0",
- "wasmparser 0.115.0",
+ "wasm-encoder",
+ "wasmparser",
 ]
 
 [[package]]
@@ -3250,16 +3221,6 @@ dependencies = [
  "num-traits",
 ]
 
-[[package]]
-name = "wasmparser"
-version = "0.113.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1fd0d44fab0bd78404e352f3399324eef76516a4580b52bc9031c60f064e98f3"
-dependencies = [
- "indexmap 2.0.0",
- "semver",
-]
-
 [[package]]
 name = "wasmparser"
 version = "0.115.0"
@@ -3286,7 +3247,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
 checksum = "e74458a9bc5cc9c7108abfa0fe4dc88d5abf1f3baf194df3264985f17d559b5e"
 dependencies = [
  "anyhow",
- "wasmparser 0.115.0",
+ "wasmparser",
 ]
 
 [[package]]
@@ -3314,8 +3275,8 @@ dependencies = [
  "target-lexicon",
  "tempfile",
  "wasi-cap-std-sync",
- "wasm-encoder 0.35.0",
- "wasmparser 0.115.0",
+ "wasm-encoder",
+ "wasmparser",
  "wasmtime-cache",
  "wasmtime-component-macro",
  "wasmtime-component-util",
@@ -3433,8 +3394,8 @@ dependencies = [
  "test-programs-artifacts",
  "tokio",
  "walkdir",
- "wasm-encoder 0.35.0",
- "wasmparser 0.115.0",
+ "wasm-encoder",
+ "wasmparser",
  "wasmtime",
  "wasmtime-cache",
  "wasmtime-cli-flags",
@@ -3479,7 +3440,7 @@ dependencies = [
  "wasmtime",
  "wasmtime-component-util",
  "wasmtime-wit-bindgen",
- "wit-parser 0.12.0",
+ "wit-parser",
 ]
 
 [[package]]
@@ -3503,7 +3464,7 @@ dependencies = [
  "object",
  "target-lexicon",
  "thiserror",
- "wasmparser 0.115.0",
+ "wasmparser",
  "wasmtime-cranelift-shared",
  "wasmtime-environ",
  "wasmtime-versioned-export-macros",
@@ -3539,8 +3500,8 @@ dependencies = [
  "serde_derive",
  "target-lexicon",
  "thiserror",
- "wasm-encoder 0.35.0",
- "wasmparser 0.115.0",
+ "wasm-encoder",
+ "wasmparser",
  "wasmprinter",
  "wasmtime-component-util",
  "wasmtime-types",
@@ -3555,7 +3516,7 @@ dependencies = [
  "component-fuzz-util",
  "env_logger 0.10.0",
  "libfuzzer-sys",
- "wasmparser 0.115.0",
+ "wasmparser",
  "wasmprinter",
  "wasmtime-environ",
  "wat",
@@ -3612,7 +3573,7 @@ dependencies = [
  "rand",
  "smallvec",
  "target-lexicon",
- "wasmparser 0.115.0",
+ "wasmparser",
  "wasmtime",
  "wasmtime-fuzzing",
 ]
@@ -3632,12 +3593,12 @@ dependencies = [
  "target-lexicon",
  "tempfile",
  "v8",
- "wasm-encoder 0.35.0",
+ "wasm-encoder",
  "wasm-mutate",
  "wasm-smith",
  "wasm-spec-interpreter",
  "wasmi",
- "wasmparser 0.115.0",
+ "wasmparser",
  "wasmprinter",
  "wasmtime",
  "wasmtime-wast",
@@ -3708,7 +3669,7 @@ dependencies = [
  "rand",
  "rustix 0.38.8",
  "sptr",
- "wasm-encoder 0.35.0",
+ "wasm-encoder",
  "wasmtime-asm-macros",
  "wasmtime-environ",
  "wasmtime-fiber",
@@ -3726,7 +3687,7 @@ dependencies = [
  "serde",
  "serde_derive",
  "thiserror",
- "wasmparser 0.115.0",
+ "wasmparser",
 ]
 
 [[package]]
@@ -3844,7 +3805,7 @@ dependencies = [
  "gimli",
  "object",
  "target-lexicon",
- "wasmparser 0.115.0",
+ "wasmparser",
  "wasmtime-cranelift-shared",
  "wasmtime-environ",
  "winch-codegen",
@@ -3857,7 +3818,7 @@ dependencies = [
  "anyhow",
  "heck",
  "indexmap 2.0.0",
- "wit-parser 0.12.0",
+ "wit-parser",
 ]
 
 [[package]]
@@ -3882,7 +3843,7 @@ dependencies = [
  "leb128",
  "memchr",
  "unicode-width",
- "wasm-encoder 0.35.0",
+ "wasm-encoder",
 ]
 
 [[package]]
@@ -4016,7 +3977,7 @@ dependencies = [
  "regalloc2",
  "smallvec",
  "target-lexicon",
- "wasmparser 0.115.0",
+ "wasmparser",
  "wasmtime-environ",
 ]
 
@@ -4061,7 +4022,7 @@ dependencies = [
  "similar",
  "target-lexicon",
  "toml",
- "wasmparser 0.115.0",
+ "wasmparser",
  "wasmtime-environ",
  "wat",
  "winch-codegen",
@@ -4147,9 +4108,9 @@ dependencies = [
 
 [[package]]
 name = "wit-bindgen"
-version = "0.12.0"
+version = "0.13.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b4f7c5d6f59ae013fc4c013c76eab667844a46e86b51987acb71b1e32953211a"
+checksum = "c7d92ce0ca6b6074059413a9581a637550c3a740581c854f9847ec293c8aed71"
 dependencies = [
  "bitflags 2.3.3",
  "wit-bindgen-rust-macro",
@@ -4157,77 +4118,48 @@ dependencies = [
 
 [[package]]
 name = "wit-bindgen-core"
-version = "0.12.0"
+version = "0.13.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7f0371c47784e7559efb422f74473e395b49f7101725584e2673657e0b4fc104"
+checksum = "565b945ae074886071eccf9cdaf8ccd7b959c2b0d624095bea5fe62003e8b3e0"
 dependencies = [
  "anyhow",
- "wit-component 0.14.4",
- "wit-parser 0.11.3",
+ "wit-component",
+ "wit-parser",
 ]
 
 [[package]]
 name = "wit-bindgen-rust"
-version = "0.12.0"
+version = "0.13.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "eeab5a09a85b1641690922ce05d79d868a2f2e78e9415a5302f58b9846fab8f1"
+checksum = "5695ff4e41873ed9ce56d2787e6b5772bdad9e70e2c1d2d160621d1762257f4f"
 dependencies = [
  "anyhow",
  "heck",
  "wasm-metadata",
  "wit-bindgen-core",
- "wit-bindgen-rust-lib",
- "wit-component 0.14.4",
-]
-
-[[package]]
-name = "wit-bindgen-rust-lib"
-version = "0.12.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a13c89c9c1a93e164318745841026f63f889376f38664f86a7f678930280e728"
-dependencies = [
- "heck",
- "wit-bindgen-core",
+ "wit-component",
 ]
 
 [[package]]
 name = "wit-bindgen-rust-macro"
-version = "0.12.0"
+version = "0.13.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a70c97e09751a9a95a592bd8ef84e953e5cdce6ebbfdb35ceefa5cc511da3b71"
+checksum = "a91835ea4231da1fe7971679d505ba14be7826e192b6357f08465866ef482e08"
 dependencies = [
  "anyhow",
  "proc-macro2",
+ "quote",
  "syn 2.0.29",
  "wit-bindgen-core",
  "wit-bindgen-rust",
- "wit-bindgen-rust-lib",
- "wit-component 0.14.4",
+ "wit-component",
 ]
 
 [[package]]
 name = "wit-component"
-version = "0.14.4"
+version = "0.16.0"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ee23614740bf871dac9856e3062c7a308506eb3f0a2759939ab8d0aa8436a1c0"
-dependencies = [
- "anyhow",
- "bitflags 2.3.3",
- "indexmap 2.0.0",
- "log",
- "serde",
- "serde_json",
- "wasm-encoder 0.33.2",
- "wasm-metadata",
- "wasmparser 0.113.2",
- "wit-parser 0.11.3",
-]
-
-[[package]]
-name = "wit-component"
-version = "0.15.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "c1bc644bb4205a2ee74035e5d35958777575fa4c6dd38ce7226c7680be2861c1"
+checksum = "e87488b57a08e2cbbd076b325acbe7f8666965af174d69d5929cd373bd54547f"
 dependencies = [
  "anyhow",
  "bitflags 2.3.3",
@@ -4236,35 +4168,17 @@ dependencies = [
  "serde",
  "serde_derive",
  "serde_json",
- "wasm-encoder 0.35.0",
+ "wasm-encoder",
  "wasm-metadata",
- "wasmparser 0.115.0",
- "wit-parser 0.12.0",
-]
-
-[[package]]
-name = "wit-parser"
-version = "0.11.3"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "a39edca9abb16309def3843af73b58d47d243fe33a9ceee572446bcc57556b9a"
-dependencies = [
- "anyhow",
- "id-arena",
- "indexmap 2.0.0",
- "log",
- "pulldown-cmark",
- "semver",
- "serde",
- "serde_json",
- "unicode-xid",
- "url",
+ "wasmparser",
+ "wit-parser",
 ]
 
 [[package]]
 name = "wit-parser"
-version = "0.12.0"
+version = "0.12.1"
 source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d08c9557c65c428ac18a3cce80bf2527dbec24ab06639642c7db73f2c7613f93"
+checksum = "f6ace9943d89bbf3dbbc71b966da0e7302057b311f36a4ac3d65ddfef17b52cf"
 dependencies = [
  "anyhow",
  "id-arena",
diff --git a/Cargo.toml b/Cargo.toml
index f759a4ed4..1fd35e8ed 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -207,7 +207,7 @@ io-extras = "0.18.0"
 rustix = "0.38.8"
 is-terminal = "0.4.0"
 # wit-bindgen:
-wit-bindgen = { version = "0.12.0", default-features = false }
+wit-bindgen = { version = "0.13.0", default-features = false }
 
 # wasm-tools family:
 wasmparser = "0.115.0"
@@ -217,8 +217,8 @@ wasmprinter = "0.2.70"
 wasm-encoder = "0.35.0"
 wasm-smith = "0.12.21"
 wasm-mutate = "0.2.38"
-wit-parser = "0.12.0"
-wit-component = "0.15.0"
+wit-parser = "0.12.1"
+wit-component = "0.16.0"
 
 # Non-Bytecode Alliance maintained dependencies:
 # --------------------------
diff --git a/crates/c-api/src/lib.rs b/crates/c-api/src/lib.rs
index ea4696e93..fb686427e 100644
--- a/crates/c-api/src/lib.rs
+++ b/crates/c-api/src/lib.rs
@@ -11,7 +11,7 @@
 
 #![allow(non_snake_case, non_camel_case_types, non_upper_case_globals)]
 
-pub use wasmtime::*;
+pub use wasmtime;
 
 mod config;
 mod engine;
diff --git a/crates/cranelift-shared/src/lib.rs b/crates/cranelift-shared/src/lib.rs
index b508e04a7..1b72ef884 100644
--- a/crates/cranelift-shared/src/lib.rs
+++ b/crates/cranelift-shared/src/lib.rs
@@ -3,7 +3,6 @@ use cranelift_codegen::{
     ir::{self, ExternalName, UserExternalNameRef},
     settings, FinalizedMachReloc, FinalizedRelocTarget, MachTrap,
 };
-use std::collections::BTreeMap;
 use wasmtime_environ::{FlagValue, FuncIndex, Trap, TrapInformation};
 
 pub mod isa_builder;
@@ -37,16 +36,16 @@ pub enum RelocationTarget {
 /// Converts cranelift_codegen settings to the wasmtime_environ equivalent.
 pub fn clif_flags_to_wasmtime(
     flags: impl IntoIterator<Item = settings::Value>,
-) -> BTreeMap<String, FlagValue> {
+) -> Vec<(&'static str, FlagValue<'static>)> {
     flags
         .into_iter()
-        .map(|val| (val.name.to_string(), to_flag_value(&val)))
+        .map(|val| (val.name, to_flag_value(&val)))
         .collect()
 }
 
-fn to_flag_value(v: &settings::Value) -> FlagValue {
+fn to_flag_value(v: &settings::Value) -> FlagValue<'static> {
     match v.kind() {
-        settings::SettingKind::Enum => FlagValue::Enum(v.as_enum().unwrap().into()),
+        settings::SettingKind::Enum => FlagValue::Enum(v.as_enum().unwrap()),
         settings::SettingKind::Num => FlagValue::Num(v.as_num().unwrap()),
         settings::SettingKind::Bool => FlagValue::Bool(v.as_bool().unwrap()),
         settings::SettingKind::Preset => unreachable!(),
diff --git a/crates/cranelift/src/compiler.rs b/crates/cranelift/src/compiler.rs
index b9457f8ad..7a0f038da 100644
--- a/crates/cranelift/src/compiler.rs
+++ b/crates/cranelift/src/compiler.rs
@@ -23,7 +23,6 @@ use object::write::{Object, StandardSegment, SymbolId};
 use object::{RelocationEncoding, RelocationKind, SectionKind};
 use std::any::Any;
 use std::cmp;
-use std::collections::BTreeMap;
 use std::collections::HashMap;
 use std::convert::TryFrom;
 use std::mem;
@@ -522,11 +521,11 @@ impl wasmtime_environ::Compiler for Compiler {
         self.isa.triple()
     }
 
-    fn flags(&self) -> BTreeMap<String, FlagValue> {
+    fn flags(&self) -> Vec<(&'static str, FlagValue<'static>)> {
         wasmtime_cranelift_shared::clif_flags_to_wasmtime(self.isa.flags().iter())
     }
 
-    fn isa_flags(&self) -> BTreeMap<String, FlagValue> {
+    fn isa_flags(&self) -> Vec<(&'static str, FlagValue<'static>)> {
         wasmtime_cranelift_shared::clif_flags_to_wasmtime(self.isa.isa_flags())
     }
 
diff --git a/crates/environ/src/compilation.rs b/crates/environ/src/compilation.rs
index eede6d3bf..3cee62b85 100644
--- a/crates/environ/src/compilation.rs
+++ b/crates/environ/src/compilation.rs
@@ -12,7 +12,6 @@ use object::{Architecture, BinaryFormat, FileFlags};
 use serde_derive::{Deserialize, Serialize};
 use std::any::Any;
 use std::borrow::Cow;
-use std::collections::BTreeMap;
 use std::fmt;
 use std::path;
 use std::sync::Arc;
@@ -348,10 +347,10 @@ pub trait Compiler: Send + Sync {
     }
 
     /// Returns a list of configured settings for this compiler.
-    fn flags(&self) -> BTreeMap<String, FlagValue>;
+    fn flags(&self) -> Vec<(&'static str, FlagValue<'static>)>;
 
     /// Same as [`Compiler::flags`], but ISA-specific (a cranelift-ism)
-    fn isa_flags(&self) -> BTreeMap<String, FlagValue>;
+    fn isa_flags(&self) -> Vec<(&'static str, FlagValue<'static>)>;
 
     /// Get a flag indicating whether branch protection is enabled.
     fn is_branch_protection_enabled(&self) -> bool;
@@ -383,16 +382,16 @@ pub trait Compiler: Send + Sync {
 
 /// Value of a configured setting for a [`Compiler`]
 #[derive(Serialize, Deserialize, Hash, Eq, PartialEq, Debug)]
-pub enum FlagValue {
+pub enum FlagValue<'a> {
     /// Name of the value that has been configured for this setting.
-    Enum(Cow<'static, str>),
+    Enum(&'a str),
     /// The numerical value of the configured settings.
     Num(u8),
     /// Whether the setting is on or off.
     Bool(bool),
 }
 
-impl fmt::Display for FlagValue {
+impl fmt::Display for FlagValue<'_> {
     fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
         match self {
             Self::Enum(v) => v.fmt(f),
diff --git a/crates/wasmtime/src/config.rs b/crates/wasmtime/src/config.rs
index b3797dd95..5b90c28a1 100644
--- a/crates/wasmtime/src/config.rs
+++ b/crates/wasmtime/src/config.rs
@@ -230,10 +230,6 @@ impl Config {
         ret.wasm_simd(true);
         ret.wasm_backtrace_details(WasmBacktraceDetails::Environment);
 
-        ret.wasm_relaxed_simd(false);
-        ret.wasm_threads(false);
-        ret.wasm_multi_memory(false);
-
         // This is on-by-default in `wasmparser` since it's a stage 4+ proposal
         // but it's not implemented in Wasmtime yet so disable it.
         ret.features.tail_call = false;
@@ -660,31 +656,23 @@ impl Config {
         self
     }
 
-    /// Configures whether the WebAssembly threads proposal will be enabled for
-    /// compilation.
-    ///
-    /// The [WebAssembly threads proposal][threads] is not currently fully
-    /// standardized and is undergoing development. Additionally the support in
-    /// wasmtime itself is still being worked on. Support for this feature can
-    /// be enabled through this method for appropriate wasm modules.
+    /// Configures whether the WebAssembly [threads] proposal will be enabled
+    /// for compilation.
     ///
     /// This feature gates items such as shared memories and atomic
-    /// instructions. Note that the threads feature depends on the
-    /// bulk memory feature, which is enabled by default.
+    /// instructions. Note that the threads feature depends on the bulk memory
+    /// feature, which is enabled by default. Additionally note that while the
+    /// wasm feature is called "threads" it does not actually include the
+    /// ability to spawn threads. Spawning threads is part of the [wasi-threads]
+    /// proposal which is a separately gated feature in Wasmtime.
     ///
-    /// This is `false` by default.
-    ///
-    /// > **Note**: Wasmtime does not implement everything for the wasm threads
-    /// > spec at this time, so bugs, panics, and possibly segfaults should be
-    /// > expected. This should not be enabled in a production setting right
-    /// > now.
-    ///
-    /// # Errors
+    /// Embeddings of Wasmtime are able to build their own custom threading
+    /// scheme on top of the core wasm threads proposal, however.
     ///
-    /// The validation of this feature are deferred until the engine is being built,
-    /// and thus may cause `Engine::new` fail if the `bulk_memory` feature is disabled.
+    /// This is `true` by default.
     ///
     /// [threads]: https://github.com/webassembly/threads
+    /// [wasi-threads]: https://github.com/webassembly/wasi-threads
     pub fn wasm_threads(&mut self, enable: bool) -> &mut Self {
         self.features.threads = enable;
         self
@@ -750,15 +738,13 @@ impl Config {
     /// Configures whether the WebAssembly Relaxed SIMD proposal will be
     /// enabled for compilation.
     ///
-    /// The [WebAssembly Relaxed SIMD proposal][proposal] is not, at the time of
-    /// this writing, at stage 4. The relaxed SIMD proposal adds new
-    /// instructions to WebAssembly which, for some specific inputs, are allowed
-    /// to produce different results on different hosts. More-or-less this
-    /// proposal enables exposing platform-specific semantics of SIMD
-    /// instructions in a controlled fashion to a WebAssembly program. From an
-    /// embedder's perspective this means that WebAssembly programs may execute
-    /// differently depending on whether the host is x86_64 or AArch64, for
-    /// example.
+    /// The relaxed SIMD proposal adds new instructions to WebAssembly which,
+    /// for some specific inputs, are allowed to produce different results on
+    /// different hosts. More-or-less this proposal enables exposing
+    /// platform-specific semantics of SIMD instructions in a controlled
+    /// fashion to a WebAssembly program. From an embedder's perspective this
+    /// means that WebAssembly programs may execute differently depending on
+    /// whether the host is x86_64 or AArch64, for example.
     ///
     /// By default Wasmtime lowers relaxed SIMD instructions to the fastest
     /// lowering for the platform it's running on. This means that, by default,
@@ -768,7 +754,7 @@ impl Config {
     /// deterministic behavior across all platforms, as classified by the
     /// specification, at the cost of performance.
     ///
-    /// This is `false` by default.
+    /// This is `true` by default.
     ///
     /// [proposal]: https://github.com/webassembly/relaxed-simd
     pub fn wasm_relaxed_simd(&mut self, enable: bool) -> &mut Self {
@@ -840,7 +826,7 @@ impl Config {
     /// This feature gates modules having more than one linear memory
     /// declaration or import.
     ///
-    /// This is `false` by default.
+    /// This is `true` by default.
     ///
     /// [proposal]: https://github.com/webassembly/multi-memory
     pub fn wasm_multi_memory(&mut self, enable: bool) -> &mut Self {
diff --git a/crates/wasmtime/src/engine/serialization.rs b/crates/wasmtime/src/engine/serialization.rs
index 86cc6cb8e..d6d0f4291 100644
--- a/crates/wasmtime/src/engine/serialization.rs
+++ b/crates/wasmtime/src/engine/serialization.rs
@@ -26,7 +26,6 @@ use anyhow::{anyhow, bail, Context, Result};
 use object::write::{Object, StandardSegment};
 use object::{File, FileFlags, Object as _, ObjectSection, SectionKind};
 use serde_derive::{Deserialize, Serialize};
-use std::collections::BTreeMap;
 use std::str::FromStr;
 use wasmtime_environ::obj;
 use wasmtime_environ::{FlagValue, ObjectKind, Tunables};
@@ -142,7 +141,7 @@ pub fn check_compatible(engine: &Engine, mmap: &MmapVec, expected: ObjectKind) -
         }
         ModuleVersionStrategy::None => { /* ignore the version info, accept all */ }
     }
-    bincode::deserialize::<Metadata>(data)?.check_compatible(engine)
+    bincode::deserialize::<Metadata<'_>>(data)?.check_compatible(engine)
 }
 
 fn detect_precompiled<'data, R: object::ReadRef<'data>>(
@@ -174,10 +173,12 @@ pub fn detect_precompiled_file(path: impl AsRef<std::path::Path>) -> Result<Opti
 }
 
 #[derive(Serialize, Deserialize)]
-struct Metadata {
+struct Metadata<'a> {
     target: String,
-    shared_flags: BTreeMap<String, FlagValue>,
-    isa_flags: BTreeMap<String, FlagValue>,
+    #[serde(borrow)]
+    shared_flags: Vec<(&'a str, FlagValue<'a>)>,
+    #[serde(borrow)]
+    isa_flags: Vec<(&'a str, FlagValue<'a>)>,
     tunables: Tunables,
     features: WasmFeatures,
 }
@@ -200,9 +201,9 @@ struct WasmFeatures {
     function_references: bool,
 }
 
-impl Metadata {
+impl Metadata<'_> {
     #[cfg(any(feature = "cranelift", feature = "winch"))]
-    fn new(engine: &Engine) -> Metadata {
+    fn new(engine: &Engine) -> Metadata<'static> {
         let wasmparser::WasmFeatures {
             reference_types,
             multi_value,
@@ -533,10 +534,9 @@ mod test {
         let engine = Engine::default();
         let mut metadata = Metadata::new(&engine);
 
-        metadata.shared_flags.insert(
-            "preserve_frame_pointers".to_string(),
-            FlagValue::Bool(false),
-        );
+        metadata
+            .shared_flags
+            .push(("preserve_frame_pointers", FlagValue::Bool(false)));
 
         match metadata.check_compatible(&engine) {
             Ok(_) => unreachable!(),
@@ -559,7 +559,7 @@ Caused by:
 
         metadata
             .isa_flags
-            .insert("not_a_flag".to_string(), FlagValue::Bool(true));
+            .push(("not_a_flag", FlagValue::Bool(true)));
 
         match metadata.check_compatible(&engine) {
             Ok(_) => unreachable!(),
@@ -629,27 +629,27 @@ Caused by:
     #[test]
     fn test_feature_mismatch() -> Result<()> {
         let mut config = Config::new();
-        config.wasm_simd(true);
+        config.wasm_threads(true);
 
         let engine = Engine::new(&config)?;
         let mut metadata = Metadata::new(&engine);
-        metadata.features.simd = false;
+        metadata.features.threads = false;
 
         match metadata.check_compatible(&engine) {
             Ok(_) => unreachable!(),
-            Err(e) => assert_eq!(e.to_string(), "Module was compiled without WebAssembly SIMD support but it is enabled for the host"),
+            Err(e) => assert_eq!(e.to_string(), "Module was compiled without WebAssembly threads support but it is enabled for the host"),
         }
 
         let mut config = Config::new();
-        config.wasm_simd(false);
+        config.wasm_threads(false);
 
         let engine = Engine::new(&config)?;
         let mut metadata = Metadata::new(&engine);
-        metadata.features.simd = true;
+        metadata.features.threads = true;
 
         match metadata.check_compatible(&engine) {
             Ok(_) => unreachable!(),
-            Err(e) => assert_eq!(e.to_string(), "Module was compiled with WebAssembly SIMD support but it is not enabled for the host"),
+            Err(e) => assert_eq!(e.to_string(), "Module was compiled with WebAssembly threads support but it is not enabled for the host"),
         }
 
         Ok(())
diff --git a/crates/winch/src/compiler.rs b/crates/winch/src/compiler.rs
index fe2c45236..89e4a775d 100644
--- a/crates/winch/src/compiler.rs
+++ b/crates/winch/src/compiler.rs
@@ -210,11 +210,11 @@ impl wasmtime_environ::Compiler for Compiler {
         self.isa.triple()
     }
 
-    fn flags(&self) -> std::collections::BTreeMap<String, wasmtime_environ::FlagValue> {
+    fn flags(&self) -> Vec<(&'static str, wasmtime_environ::FlagValue<'static>)> {
         wasmtime_cranelift_shared::clif_flags_to_wasmtime(self.isa.flags().iter())
     }
 
-    fn isa_flags(&self) -> std::collections::BTreeMap<String, wasmtime_environ::FlagValue> {
+    fn isa_flags(&self) -> Vec<(&'static str, wasmtime_environ::FlagValue<'static>)> {
         wasmtime_cranelift_shared::clif_flags_to_wasmtime(self.isa.isa_flags())
     }
 
diff --git a/src/commands/settings.rs b/src/commands/settings.rs
index b51475d90..058909f8d 100644
--- a/src/commands/settings.rs
+++ b/src/commands/settings.rs
@@ -45,7 +45,7 @@ struct Settings {
     bools: Vec<SettingData>,
     presets: Vec<SettingData>,
 
-    inferred: Option<Vec<String>>,
+    inferred: Option<Vec<&'static str>>,
 }
 
 impl Settings {
diff --git a/supply-chain/config.toml b/supply-chain/config.toml
index 8a9194695..61b22132c 100644
--- a/supply-chain/config.toml
+++ b/supply-chain/config.toml
@@ -169,6 +169,9 @@ audit-as-crates-io = true
 [policy.wasmtime-wit-bindgen]
 audit-as-crates-io = true
 
+[policy.wasmtime-wmemcheck]
+audit-as-crates-io = true
+
 [policy.wiggle]
 audit-as-crates-io = true
 
diff --git a/supply-chain/imports.lock b/supply-chain/imports.lock
index 727934b53..9a5b1830e 100644
--- a/supply-chain/imports.lock
+++ b/supply-chain/imports.lock
@@ -824,13 +824,6 @@ user-id = 1
 user-login = "alexcrichton"
 user-name = "Alex Crichton"
 
-[[publisher.wasm-encoder]]
-version = "0.33.2"
-when = "2023-09-26"
-user-id = 1
-user-login = "alexcrichton"
-user-name = "Alex Crichton"
-
 [[publisher.wasm-encoder]]
 version = "0.35.0"
 when = "2023-10-14"
@@ -838,13 +831,6 @@ user-id = 1
 user-login = "alexcrichton"
 user-name = "Alex Crichton"
 
-[[publisher.wasm-metadata]]
-version = "0.10.6"
-when = "2023-09-26"
-user-id = 1
-user-login = "alexcrichton"
-user-name = "Alex Crichton"
-
 [[publisher.wasm-metadata]]
 version = "0.10.9"
 when = "2023-10-14"
@@ -852,13 +838,6 @@ user-id = 1
 user-login = "alexcrichton"
 user-name = "Alex Crichton"
 
-[[publisher.wasm-mutate]]
-version = "0.2.35"
-when = "2023-09-26"
-user-id = 1
-user-login = "alexcrichton"
-user-name = "Alex Crichton"
-
 [[publisher.wasm-mutate]]
 version = "0.2.38"
 when = "2023-10-14"
@@ -866,13 +845,6 @@ user-id = 1
 user-login = "alexcrichton"
 user-name = "Alex Crichton"
 
-[[publisher.wasm-smith]]
-version = "0.12.18"
-when = "2023-09-26"
-user-id = 1
-user-login = "alexcrichton"
-user-name = "Alex Crichton"
-
 [[publisher.wasm-smith]]
 version = "0.12.21"
 when = "2023-10-14"
@@ -880,13 +852,6 @@ user-id = 1
 user-login = "alexcrichton"
 user-name = "Alex Crichton"
 
-[[publisher.wasmparser]]
-version = "0.113.2"
-when = "2023-09-26"
-user-id = 1
-user-login = "alexcrichton"
-user-name = "Alex Crichton"
-
 [[publisher.wasmparser]]
 version = "0.115.0"
 when = "2023-10-14"
@@ -894,13 +859,6 @@ user-id = 1
 user-login = "alexcrichton"
 user-name = "Alex Crichton"
 
-[[publisher.wasmprinter]]
-version = "0.2.67"
-when = "2023-09-26"
-user-id = 1
-user-login = "alexcrichton"
-user-name = "Alex Crichton"
-
 [[publisher.wasmprinter]]
 version = "0.2.70"
 when = "2023-10-14"
@@ -1052,12 +1010,11 @@ when = "2023-09-20"
 user-id = 73222
 user-login = "wasmtime-publish"
 
-[[publisher.wast]]
-version = "65.0.2"
-when = "2023-09-26"
-user-id = 1
-user-login = "alexcrichton"
-user-name = "Alex Crichton"
+[[publisher.wasmtime-wmemcheck]]
+version = "13.0.0"
+when = "2023-09-20"
+user-id = 73222
+user-login = "wasmtime-publish"
 
 [[publisher.wast]]
 version = "66.0.2"
@@ -1066,13 +1023,6 @@ user-id = 1
 user-login = "alexcrichton"
 user-name = "Alex Crichton"
 
-[[publisher.wat]]
-version = "1.0.74"
-when = "2023-09-26"
-user-id = 1
-user-login = "alexcrichton"
-user-name = "Alex Crichton"
-
 [[publisher.wat]]
 version = "1.0.77"
 when = "2023-10-14"
@@ -1189,68 +1139,47 @@ user-login = "sunfishcode"
 user-name = "Dan Gohman"
 
 [[publisher.wit-bindgen]]
-version = "0.12.0"
-when = "2023-09-18"
+version = "0.13.0"
+when = "2023-10-18"
 user-id = 1
 user-login = "alexcrichton"
 user-name = "Alex Crichton"
 
 [[publisher.wit-bindgen-core]]
-version = "0.12.0"
-when = "2023-09-18"
+version = "0.13.0"
+when = "2023-10-18"
 user-id = 1
 user-login = "alexcrichton"
 user-name = "Alex Crichton"
 
 [[publisher.wit-bindgen-rust]]
-version = "0.12.0"
-when = "2023-09-18"
-user-id = 1
-user-login = "alexcrichton"
-user-name = "Alex Crichton"
-
-[[publisher.wit-bindgen-rust-lib]]
-version = "0.12.0"
-when = "2023-09-18"
+version = "0.13.0"
+when = "2023-10-18"
 user-id = 1
 user-login = "alexcrichton"
 user-name = "Alex Crichton"
 
 [[publisher.wit-bindgen-rust-macro]]
-version = "0.12.0"
-when = "2023-09-18"
-user-id = 1
-user-login = "alexcrichton"
-user-name = "Alex Crichton"
-
-[[publisher.wit-component]]
-version = "0.14.4"
-when = "2023-09-27"
+version = "0.13.0"
+when = "2023-10-18"
 user-id = 1
 user-login = "alexcrichton"
 user-name = "Alex Crichton"
 
 [[publisher.wit-component]]
-version = "0.15.0"
-when = "2023-10-14"
+version = "0.16.0"
+when = "2023-10-18"
 user-id = 1
 user-login = "alexcrichton"
 user-name = "Alex Crichton"
 
 [[publisher.wit-parser]]
-version = "0.11.3"
-when = "2023-09-27"
+version = "0.12.1"
+when = "2023-10-18"
 user-id = 1
 user-login = "alexcrichton"
 user-name = "Alex Crichton"
 
-[[publisher.wit-parser]]
-version = "0.12.0"
-when = "2023-10-12"
-user-id = 696
-user-login = "fitzgen"
-user-name = "Nick Fitzgerald"
-
 [[audits.embark-studios.wildcard-audits.spdx]]
 who = "Jake Shadle <opensource@embark-studios.com>"
 criteria = "safe-to-deploy"


Test patch:
diff --git a/tests/all/module.rs b/tests/all/module.rs
index 9efedb94b..78baec39d 100644
--- a/tests/all/module.rs
+++ b/tests/all/module.rs
@@ -43,7 +43,7 @@ fn caches_across_engines() {
         // differ in wasm features enabled (which can affect
         // runtime/compilation settings)
         let res = Module::deserialize(
-            &Engine::new(Config::new().wasm_simd(false)).unwrap(),
+            &Engine::new(Config::new().wasm_threads(false)).unwrap(),
             &bytes,
         );
         assert!(res.is_err());
@@ -182,7 +182,7 @@ fn serialize_not_overly_massive() -> Result<()> {
 #[cfg_attr(any(not(target_arch = "x86_64"), miri), ignore)]
 fn missing_sse_and_floats_still_works() -> Result<()> {
     let mut config = Config::new();
-    config.wasm_simd(false);
+    config.wasm_simd(false).wasm_relaxed_simd(false);
     unsafe {
         config.cranelift_flag_set("has_sse41", "false");
     }