Skip to content

Add relaxed-atomics feature flag - #8983

Merged
tlively merged 1 commit into
mainfrom
relaxed-memory-feature
Aug 12, 2026
Merged

Add relaxed-atomics feature flag#8983
tlively merged 1 commit into
mainfrom
relaxed-memory-feature

Conversation

@tlively

@tlively tlively commented Aug 11, 2026

Copy link
Copy Markdown
Member

We previously renamed the old "relaxed-atomics" feature to "acquire-release-atomics." Add an experimental "relaxed-atomics" feature that will allow "relaxed" atomics in addition to seqcst and acquire-release atomics. The "relaxed" atomics will actually be load-store ordered atomics, which prevent out-of-thin-air values for a (hopefully) modest performance cost. The name of the feature is likely to change in the future to more exactly represent the desired semantics.

We previously renamed the old "relaxed-atomics" feature to "acquire-release-atomics." Add an experimental "relaxed-atomics" feature that will allow "relaxed" atomics in addition to seqcst and acquire-release atomics. The "relaxed" atomics will actually be load-store ordered atomics, which prevent out-of-thin-air values for a (hopefully) modest performance cost. The name of the feature is likely to change in the future to more exactly represent the desired semantics.
@tlively
tlively requested a review from a team as a code owner August 11, 2026 03:58
@tlively
tlively requested review from aheejin and removed request for a team August 11, 2026 03:58
@chharvey

Copy link
Copy Markdown
Contributor

Sorry if i'm not understanding this fully, but why did #8982 rename FeatureSet.RelaxedAtomics to FeatureSet.AcquireReleaseAtomics, only for this PR to add it back in again? Shouldn’t RelaxedAtomics have been kept at 1 << 22 and AcquireReleaseAtomics been added with the new 1 << 27 value?

@tlively

tlively commented Aug 11, 2026

Copy link
Copy Markdown
Member Author

Yeah, sorry, it's kinda confusing. The old relaxed atomics feature corresponded to the https://github.com/WebAssembly/relaxed-atomics proposal, which has been renamed to acquire-release-atomics (and now redirects to https://github.com/WebAssembly/acquire-release-atomics). We renamed the feature to match the proposal renaming.

The new relaxed atomics feature does not (yet) correspond to any proposal. It adds a new "relaxed" memory ordering that is similar to (but slightly stronger than) C++'s relaxed memory ordering.

So we're reusing an old name for one feature as the name of a different new feature.

@chharvey chharvey left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks good from the JS side

@tlively
tlively requested a review from kripken August 12, 2026 00:09
@tlively
tlively merged commit 86a7c4c into main Aug 12, 2026
16 checks passed
@tlively
tlively deleted the relaxed-memory-feature branch August 12, 2026 06:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants