Skip to content

GUFA: Don't misoptimize struct/array atomics#8484

Merged
kripken merged 7 commits intoWebAssembly:mainfrom
kripken:gufa.struct.rmw
Mar 18, 2026
Merged

GUFA: Don't misoptimize struct/array atomics#8484
kripken merged 7 commits intoWebAssembly:mainfrom
kripken:gufa.struct.rmw

Conversation

@kripken
Copy link
Member

@kripken kripken commented Mar 18, 2026

For now, just write an unknown value of the proper type.

Simplify ArrayStore similarly: remove special multibyte handling and
just pass in an unknown value of the type.

Fixes #8473

@kripken kripken requested a review from tlively March 18, 2026 17:15
Copy link
Member

Choose a reason for hiding this comment

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

I guess we should put these new test cases in a separate "rmw" test file for now so we can ignore it selectively in the fuzzer.

Copy link
Member Author

Choose a reason for hiding this comment

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

Oh, are there more known issues? I was hoping this was it...

Copy link
Member

Choose a reason for hiding this comment

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

Still finding lots of issues 😬

Copy link
Member Author

Choose a reason for hiding this comment

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

Are you fuzzing in a special way? I don't see stuff...

Copy link
Member

Choose a reason for hiding this comment

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

Oh, I'm fuzzing with a patch that makes the fuzzer generate new RMW operations from scratch. Since that's finding problems, I assume the same problems could be found from initial contents, even if it might take a lot longer.

Copy link
Member Author

Choose a reason for hiding this comment

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

Ok, separated out.

Comment on lines -3268 to -3270
if (multibyte) {
valueContents = PossibleContents::fromType(value->type);
}
Copy link
Member

Choose a reason for hiding this comment

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

Are these multibyte changes a drive-by fix? Are they NFC? This isn't clear to me.

Copy link
Member Author

Choose a reason for hiding this comment

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

This uses the new code added for the rmw instrs, as mentioned in the description,

Simplify ArrayStore similarly: remove special multibyte handling and
just pass in an unknown value of the type.

The old code manually saw "multibyte" and applied an unknown value. This sends
it in without a special multibyte param.

@kripken kripken merged commit 5283ba0 into WebAssembly:main Mar 18, 2026
16 checks passed
@kripken kripken deleted the gufa.struct.rmw branch March 18, 2026 21:40
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.

TypeRefiningGUFA errors on visitStructCmpxchg etc.

2 participants