<?xml version="1.0"?>
<?xml-stylesheet type="text/xsl" href="/rss.xsl.xml"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/">
<channel>
    <title>Changes in threads.rs</title>
    <description></description>
    <language>en</language>
    <copyright>Copyright 2015</copyright>
    <generator>Java</generator><item>
        <title>0a55f804 - &quot;Downgrade&quot; threads support to tier 2, disable fuzzing (#12036)</title>
        <link>http://172.16.0.5:8080/history/wasmtime-44.0.1/tests/all/threads.rs#0a55f804</link>
        <description>&quot;Downgrade&quot; threads support to tier 2, disable fuzzing (#12036)* &quot;Downgrade&quot; threads support to tier 2, disable fuzzingThis commit is borne out of a fuzz bug that was opened recently. Thefuzz bug specifically has to do with fallout from #12022, specifically`SharedMemory` being used to allocated instead of `Memory`. In thissituation the resource limiter is no longer consulted meaning thatshared memories bypass this and aren&apos;t caught by OOM checks. This iscurrently by design because `SharedMemory` instances don&apos;t know whichresource limiter to hook into per-store.More generally though the implementation of wasm threads, while workablein Wasmtime, has a number of known relatively large deficiencies. Thesewere not resolved prior to ungating the wasm proposal (that&apos;s on me) butnevertheless the quality of implementation is not quite up to &quot;tier 1par&quot; with the rest of what Wasmtime offers. Given this the threadsproposal is now downgraded to tier 2. To help minimize the impact ofthis the wasm proposal is left enabled-by-default, but creation of a`SharedMemory` in the Rust API requires opting-in via a new`Config::shared_memory` method.This commit shuffles around some documentation of wasm proposals tosplit it into tier 1/2/3 instead of on/off-by-default and then adds acolumn for whether the proposal is on-by-default.* clangformat* Fix tests* Add tests for failed creationFix an issue where defined shared memories weren&apos;t gated* Sync disabled threads stub* Fix another testprtest:full* Fix fuzzing tests* Fix dwarf tests

            List of files:
            /wasmtime-44.0.1/tests/all/threads.rs</description>
        <pubDate>Mon, 24 Nov 2025 17:09:20 +0000</pubDate>
        <dc:creator>Alex Crichton &lt;alex@alexcrichton.com&gt;</dc:creator>
    </item>
<item>
        <title>1fcd0933 - Prevent using shared memories with `Memory` (#12022)</title>
        <link>http://172.16.0.5:8080/history/wasmtime-44.0.1/tests/all/threads.rs#1fcd0933</link>
        <description>Prevent using shared memories with `Memory` (#12022)* Prevent using shared memories with `Memory`This commit fixes a few issues where it was possible to represent a wasmshared linear memory with the `wasmtime::Memory` type. This is not soundbecause `wasmtime::Memory` provides safe Rust access to the bytes wherethat is not possible with wasm shared memories. Shared memories in Rustmust be represented by `SharedMemory`, not `wasmtime::Memory`.Specifically this commit prevents two vectors of this happening:1. `Memory::new` now requires that the memory type specified is   non-shared. Instead `SharedMemory::new` must be used instead.2. Core dumps now skip over shared memories when iterating over all   memories in the store. Supporting shared memories is left to a future   feature request for now.* CI fixes

            List of files:
            /wasmtime-44.0.1/tests/all/threads.rs</description>
        <pubDate>Tue, 11 Nov 2025 18:06:22 +0000</pubDate>
        <dc:creator>Alex Crichton &lt;alex@alexcrichton.com&gt;</dc:creator>
    </item>
<item>
        <title>909cb23c - Minor updates to testing in Miri (#10999)</title>
        <link>http://172.16.0.5:8080/history/wasmtime-44.0.1/tests/all/threads.rs#909cb23c</link>
        <description>Minor updates to testing in Miri (#10999)* Use Pulley by default when Miri is enabled.* Fail wasm module compilation with functions by default in Miri to  prevent accidentally having super slow test in CI.* Update some tests from fallout of the above two points, also ignore a  slow test in Pulley.prtest:miri

            List of files:
            /wasmtime-44.0.1/tests/all/threads.rs</description>
        <pubDate>Tue, 10 Jun 2025 16:48:53 +0000</pubDate>
        <dc:creator>Alex Crichton &lt;alex@alexcrichton.com&gt;</dc:creator>
    </item>
<item>
        <title>90ac295e - Update Wasmtime to the 2024 Rust Edition (#10806)</title>
        <link>http://172.16.0.5:8080/history/wasmtime-44.0.1/tests/all/threads.rs#90ac295e</link>
        <description>Update Wasmtime to the 2024 Rust Edition (#10806)* Update Wasmtime to the 2024 Rust EditionNow that our MSRV supports the 2024 edition it&apos;s possible to make thisswitch. This commit moves Wasmtime to the 2024 Edition to keepup-to-date with Rust idioms and access many of the edition featuresexclusive to the 2024 edition.prtest:full* Reformat with the 2024 edition

            List of files:
            /wasmtime-44.0.1/tests/all/threads.rs</description>
        <pubDate>Mon, 19 May 2025 16:40:55 +0000</pubDate>
        <dc:creator>Alex Crichton &lt;alex@alexcrichton.com&gt;</dc:creator>
    </item>
<item>
        <title>48f4621f - Run the full test suite on 32-bit platforms (#9837)</title>
        <link>http://172.16.0.5:8080/history/wasmtime-44.0.1/tests/all/threads.rs#48f4621f</link>
        <description>Run the full test suite on 32-bit platforms (#9837)* Run the full test suite on 32-bit platformsThis commit switches to running the full test suite in its entirety(`./ci/run-tests.sh`) on 32-bit platforms in CI in addition to 64-bitplatforms. This notably adds i686 and armv7 as architectures that aretested in CI.Lots of little fixes here and there were applied to a number of tests.Many tests just don&apos;t run on 32-bit platforms or a platform withoutCranelift support, and they&apos;ve been annotated as such where necessary.Other tests were adjusted to run on all platforms a few minor bug fixesare here as well.prtest:full* Fix clippy warning* Get wasm code working by default on 32-bitDon&apos;t require the `pulley` feature opt-in on 32-bit platforms to getwasm code running.* Fix dead code warning* Fix build on armv7* Fix test assertion on armv7* Review comments* Update how tests are skipped* Change how Pulley is defaultedDefault to pulley in `build.rs` rather than in `Cargo.toml` to make iteasier to write down the condition and comment what&apos;s happening. Thismeans that the `pulley-interpreter` crate and pulley support inCranelift is always compiled in now and cannot be removed. This shouldhopefully be ok though as the `pulley-interpreter` crate is stillconditionally used (meaning it can get GC&apos;d) and the code-size ofCranelift is not as important as the runtime itself.* pulley: Save/restore callee-save state on traps* Fewer clippy warnings about casts* Use wrapping_add in `g32_addr`, fixing arm test

            List of files:
            /wasmtime-44.0.1/tests/all/threads.rs</description>
        <pubDate>Wed, 15 Jan 2025 18:43:18 +0000</pubDate>
        <dc:creator>Alex Crichton &lt;alex@alexcrichton.com&gt;</dc:creator>
    </item>
<item>
        <title>46098121 - style: simplify string formatting (#9047)</title>
        <link>http://172.16.0.5:8080/history/wasmtime-44.0.1/tests/all/threads.rs#46098121</link>
        <description>style: simplify string formatting (#9047)* style: simplify string formatting* fix: formatting in `benches/call.rs`

            List of files:
            /wasmtime-44.0.1/tests/all/threads.rs</description>
        <pubDate>Wed, 31 Jul 2024 14:45:20 +0000</pubDate>
        <dc:creator>Hamir Mahal &lt;hamirmahal@gmail.com&gt;</dc:creator>
    </item>
<item>
        <title>9ce3ffe1 - Update some CI dependencies (#7983)</title>
        <link>http://172.16.0.5:8080/history/wasmtime-44.0.1/tests/all/threads.rs#9ce3ffe1</link>
        <description>Update some CI dependencies (#7983)* Update some CI dependencies* Update to the latest nightly toolchain* Update mdbook* Update QEMU for cross-compiled testing* Update `cargo nextest` for usage with MIRIprtest:full* Remove lots of unnecessary imports* Downgrade qemu as 8.2.1 seems to segfault* Remove more imports* Remove unused winch trait method* Fix warnings about unused trait methods* More unused imports* More unused imports

            List of files:
            /wasmtime-44.0.1/tests/all/threads.rs</description>
        <pubDate>Thu, 22 Feb 2024 23:54:03 +0000</pubDate>
        <dc:creator>Alex Crichton &lt;alex@alexcrichton.com&gt;</dc:creator>
    </item>
<item>
        <title>c0bb341d - Run some tests in MIRI on CI (#6332)</title>
        <link>http://172.16.0.5:8080/history/wasmtime-44.0.1/tests/all/threads.rs#c0bb341d</link>
        <description>Run some tests in MIRI on CI (#6332)* Run some tests in MIRI on CIThis commit is an implementation of getting at least chunks of Wasmtimeto run in MIRI on CI. The full test suite is not possible to run in MIRIbecause MIRI cannot run Cranelift-produced code at runtime (aka itdoesn&apos;t support JITs). Running MIRI, however, is still quite valuable ifwe can manage it because it would have trivially detectedGHSA-ch89-5g45-qwc7, our most recent security advisory. The goal of thisPR is to select a subset of the test suite to execute in CI under MIRIand boost our confidence in the copious amount of `unsafe` code inWasmtime&apos;s runtime.Under MIRI&apos;s default settings, which is to use the [StackedBorrows][stacked] model, much of the code in `Instance` and `VMContext`is considered invalid. Under the optional [Tree Borrows][tree] model,however, this same code is accepted. After some [extremely helpfuldiscussion][discuss] on the Rust Zulip my current conclusion is thatwhat we&apos;re doing is not fundamentally un-sound but we need to model itin a different way. This PR, however, uses the Tree Borrows model forMIRI to get something onto CI sooner rather than later, and I hope tofollow this up with something that passed Stacked Borrows. Additionallythat&apos;ll hopefully make this diff smaller and easier to digest.Given all that, the end result of this PR is to get 131 separate unittests executing on CI. These unit tests largely exercise the embeddingAPI where wasm function compilation is not involved. Some tests compilewasm functions but don&apos;t run them, but compiling wasm through Craneliftin MIRI is so slow that it doesn&apos;t seem worth it at this time. This doesmean that there&apos;s a pretty big hole in MIRI&apos;s test coverage, but that&apos;sto be expected as we&apos;re a JIT compiler after all.To get tests working in MIRI this PR uses a number of strategies:* When platform-specific code is involved there&apos;s now `#[cfg(miri)]` for  MIRI&apos;s version. For example there&apos;s a custom-built &quot;mmap&quot; just for  MIRI now. Many of these are simple noops, some are `unimplemented!()`  as they shouldn&apos;t be reached, and some are slightly nontrivial  implementations such as mmaps and trap handling (for native-to-native  function calls).* Many test modules are simply excluded via `#![cfg(not(miri))]` at the  top of the file. This excludes the entire module&apos;s worth of tests from  MIRI. Other modules have `#[cfg_attr(miri, ignore)]` annotations to  ignore tests by default on MIRI. The latter form is used in modules  where some tests work and some don&apos;t. This means that all future test  additions will need to be effectively annotated whether they work in  MIRI or not. My hope though is that there&apos;s enough precedent in the  test suite of what to do to not cause too much burden.* A number of locations are fixed with respect to MIRI&apos;s analysis. For  example `ComponentInstance`, the component equivalent of  `wasmtime_runtime::Instance`, was actually left out from the fix for  the CVE by accident. MIRI dutifully highlighted the issues here and  I&apos;ve fixed them locally. Some locations fixed for MIRI are changed to  something that looks similar but is subtly different. For example  retaining items in a `Store&lt;T&gt;` is now done with a Wasmtime-specific  `StoreBox&lt;T&gt;` type. This is because, with MIRI&apos;s analyses, moving a  `Box&lt;T&gt;` invalidates all pointers derived from this `Box&lt;T&gt;`. We don&apos;t  want these semantics, so we effectively have a custom `Box&lt;T&gt;` to suit  our needs in this regard.* Some default configuration is different under MIRI. For example most  linear memories are dynamic with no guards and no space reserved for  growth. Settings such as parallel compilation are disabled. These are  applied to make MIRI &quot;work by default&quot; in more places ideally. Some  tests which perform N iterations of something perform fewer iterations  on MIRI to not take quite so long.This PR is not intended to be a one-and-done-we-never-look-at-it-againkind of thing. Instead this is intended to lay the groundwork tocontinuously run MIRI in CI to catch any soundness issues. This feels,to me, overdue given the amount of `unsafe` code inside of Wasmtime. Myhope is that over time we can figure out how to run Wasm in MIRI butthat may take quite some time. Regardless this will be adding nontrivialmaintenance work to contributors to Wasmtime. MIRI will be run on CI formerges, MIRI will have test failures when everything else passes,MIRI&apos;s errors will need to be deciphered by those who have probablynever run MIRI before, things like that. Despite all this to me it seemsworth the cost at this time. Just getting this running caught twopossible soundness bugs in the component implementation that could havehad a real-world impact in the future![stacked]: https://github.com/rust-lang/unsafe-code-guidelines/blob/master/wip/stacked-borrows.md[tree]: https://perso.crans.org/vanille/treebor/[discuss]: https://rust-lang.zulipchat.com/#narrow/stream/269128-miri/topic/Tree.20vs.20Stacked.20Borrows.20.26.20a.20debugging.20question* Update alignment comment

            List of files:
            /wasmtime-44.0.1/tests/all/threads.rs</description>
        <pubDate>Wed, 03 May 2023 21:02:33 +0000</pubDate>
        <dc:creator>Alex Crichton &lt;alex@alexcrichton.com&gt;</dc:creator>
    </item>
<item>
        <title>6ce2ac19 - Refactor shared memory internals, expose embedder methods (#5311)</title>
        <link>http://172.16.0.5:8080/history/wasmtime-44.0.1/tests/all/threads.rs#6ce2ac19</link>
        <description>Refactor shared memory internals, expose embedder methods (#5311)This commit refactors the internals of `wasmtime_runtime::SharedMemory`a bit to expose the necessary functions to invoke from the`wasmtime::SharedMemory` layer. Notably some items are moved out of the`RwLock` from prior, such as the type and the `VMMemoryDefinition`.Additionally the organization around the `atomic_*` methods has beenredone to ensure that the `wasmtime`-layer abstraction has a singlemethod to call into which everything else uses as well.

            List of files:
            /wasmtime-44.0.1/tests/all/threads.rs</description>
        <pubDate>Tue, 22 Nov 2022 16:51:55 +0000</pubDate>
        <dc:creator>Alex Crichton &lt;alex@alexcrichton.com&gt;</dc:creator>
    </item>
<item>
        <title>b0939f66 - Remove explicit `S` type parameters (#5275)</title>
        <link>http://172.16.0.5:8080/history/wasmtime-44.0.1/tests/all/threads.rs#b0939f66</link>
        <description>Remove explicit `S` type parameters (#5275)* Remove explicit `S` type parametersThis commit removes the explicit `S` type parameter on `Func::typed` and`Instance::get_typed_func`. Historical versions of Rust required thatthis be a type parameter but recent rustcs support a mixture of explicittype parameters and `impl Trait`. This removes, at callsites, asuperfluous `, _` argument which otherwise never needs specification.* Fix mdbook examples

            List of files:
            /wasmtime-44.0.1/tests/all/threads.rs</description>
        <pubDate>Wed, 16 Nov 2022 05:04:26 +0000</pubDate>
        <dc:creator>Alex Crichton &lt;alex@alexcrichton.com&gt;</dc:creator>
    </item>
<item>
        <title>2be457c2 - Change the return type of `SharedMemory::data` (#5240)</title>
        <link>http://172.16.0.5:8080/history/wasmtime-44.0.1/tests/all/threads.rs#2be457c2</link>
        <description>Change the return type of `SharedMemory::data` (#5240)This commit is an attempt at improving the safety of using the returnvalue of the `SharedMemory::data` method. Previously this returned`*mut [u8]` which, while correct, is unwieldy and unsafe to work with.The new return value of `&amp;[UnsafeCell&lt;u8&gt;]` has a few advantages:* The lifetime of the returned data is now connected to the  `SharedMemory` itself, removing the possibility for a class of errors  of accidentally using the prior `*mut [u8]` beyond its original lifetime.* It&apos;s not possibly to safely access `.len()` as opposed to requiring an  `unsafe` dereference before.* The data internally within the slice is now what retains the `unsafe`  bits, namely indicating that accessing any memory inside of the  contents returned is `unsafe` but addressing it is safe.I was inspired by the `wiggle`-based discussion on #5229 and felt itappropriate to apply a similar change here.

            List of files:
            /wasmtime-44.0.1/tests/all/threads.rs</description>
        <pubDate>Thu, 10 Nov 2022 17:51:10 +0000</pubDate>
        <dc:creator>Alex Crichton &lt;alex@alexcrichton.com&gt;</dc:creator>
    </item>
<item>
        <title>2b52f47b - Add shared memories (#4187)</title>
        <link>http://172.16.0.5:8080/history/wasmtime-44.0.1/tests/all/threads.rs#2b52f47b</link>
        <description>Add shared memories (#4187)* Add shared memoriesThis change adds the ability to use shared memories in Wasmtime when the[threads proposal] is enabled. Shared memories are annotated as `shared`in the WebAssembly syntax, e.g., `(memory 1 1 shared)`, and areprotected from concurrent access during `memory.size` and `memory.grow`.[threads proposal]: https://github.com/WebAssembly/threads/blob/master/proposals/threads/Overview.mdIn order to implement this in Wasmtime, there are two main cases tocover:    - a program may simply create a shared memory and possibly export it;    this means that Wasmtime itself must be able to create shared    memories    - a user may create a shared memory externally and pass it in as an    import during instantiation; this is the case when the program    contains code like `(import &quot;env&quot; &quot;memory&quot; (memory 1 1    shared))`--this case is handled by a new Wasmtime API    type--`SharedMemory`Because of the first case, this change allows any of the currentmemory-creation mechanisms to work as-is. Wasmtime can still createeither static or dynamic memories in either on-demand or pooling modes,and any of these memories can be considered shared. When shared, the`Memory` runtime container will lock appropriately during `memory.size`and `memory.grow` operations; since all memories use this container, itis an ideal place for implementing the locking once and once only.The second case is covered by the new `SharedMemory` structure. It usesthe same `Mmap` allocation under the hood as non-shared memories, butallows the user to perform the allocation externally to Wasmtime andshare the memory across threads (via an `Arc`). The pointer address tothe actual memory is carefully wired through and owned by the`SharedMemory` structure itself. This means that there are differingviews of where to access the pointer (i.e., `VMMemoryDefinition`): forowned memories (the default), the `VMMemoryDefinition` is storeddirectly by the `VMContext`; in the `SharedMemory` case, however, this`VMContext` must point to this separate structure.To ensure that the `VMContext` can always point to the correct`VMMemoryDefinition`, this change alters the `VMContext` structure.Since a `SharedMemory` owns its own `VMMemoryDefinition`, the`defined_memories` table in the `VMContext` becomes a sequence ofpointers--in the shared memory case, they point to the`VMMemoryDefinition` owned by the `SharedMemory` and in the owned memorycase (i.e., not shared) they point to `VMMemoryDefinition`s stored in anew table, `owned_memories`.This change adds an additional indirection (through the `*mutVMMemoryDefinition` pointer) that could add overhead. Using an importedmemory as a proxy, we measured a 1-3% overhead of this approach on the`pulldown-cmark` benchmark. To avoid this, Cranelift-generated code willspecial-case the owned memory access (i.e., load a pointer directly tothe `owned_memories` entry) for `memory.size` so that onlyshared memories (and imported memories, as before) incur the indirectioncost.* review: remove thread feature check* review: swap wasmtime-types dependency for existing wasmtime-environ use* review: remove unused VMMemoryUnion* review: reword cross-engine error message* review: improve tests* review: refactor to separate prevent Memory &lt;-&gt; SharedMemory conversion* review: into_shared_memory -&gt; as_shared_memory* review: remove commented out code* review: limit shared min/max to 32 bits* review: skip imported memories* review: imported memories are not owned* review: remove TODO* review: document unsafe send + sync* review: add limiter assertion* review: remove TODO* review: improve tests* review: fix doc test* fix: fixes based on discussion with AlexThis changes several key parts: - adds memory indexes to imports and exports - makes `VMMemoryDefinition::current_length` an atomic usize* review: add `Extern::SharedMemory`* review: remove TODO* review: atomically load from VMMemoryDescription in JIT-generated code* review: add test probing the last available memory slot across threads* fix: move assertion to new location due to rebase* fix: doc link* fix: add TODOs to c-api* fix: broken doc link* fix: modify pooling allocator messages in tests* review: make owned_memory_index panic instead of returning an option* review: clarify calculation of num_owned_memories* review: move &apos;use&apos; to top of file* review: change &apos;*const [u8]&apos; to &apos;*mut [u8]&apos;* review: remove TODO* review: avoid hard-coding memory index* review: remove &apos;preallocation&apos; parameter from &apos;Memory::_new&apos;* fix: component model memory length* review: check that shared memory plans are static* review: ignore growth limits for shared memory* review: improve atomic store comment* review: add FIXME for memory growth failure* review: add comment about absence of bounds-checked &apos;memory.size&apos;* review: make &apos;current_length()&apos; doc comment more precise* review: more comments related to memory.size non-determinism* review: make &apos;vmmemory&apos; unreachable for shared memory* review: move code around* review: thread plan through to &apos;wrap()&apos;* review: disallow shared memory allocation with the pooling allocator

            List of files:
            /wasmtime-44.0.1/tests/all/threads.rs</description>
        <pubDate>Wed, 08 Jun 2022 17:13:40 +0000</pubDate>
        <dc:creator>Andrew Brown &lt;andrew.brown@intel.com&gt;</dc:creator>
    </item>
</channel>
</rss>
