Skip to content

[Shared Everything] struct.wait on unshared should trap#8498

Merged
kripken merged 9 commits intoWebAssembly:mainfrom
kripken:struct.wait.un
Mar 19, 2026
Merged

[Shared Everything] struct.wait on unshared should trap#8498
kripken merged 9 commits intoWebAssembly:mainfrom
kripken:struct.wait.un

Conversation

@kripken
Copy link
Copy Markdown
Member

@kripken kripken commented Mar 19, 2026

No description provided.

@kripken kripken requested a review from tlively March 19, 2026 20:25
@kripken kripken requested a review from a team as a code owner March 19, 2026 20:25
@kripken
Copy link
Copy Markdown
Member Author

kripken commented Mar 19, 2026

@tlively looks like the spec test errors on this PR, as it has a wait on a non-shared struct. Is the spec test wrong...?

@stevenfontanella
Copy link
Copy Markdown
Member

The spec test was written by me. I think the spec isn't clear on what should happen with a non-shared waitqueue, this is all it says:
image

Since the spec test cases never actually need to be woken up by another thread, I could see it making sense for a non-shared waitqueue but I'm not sure if it's useful to allow it at all. e.g. one of the cases is that the control word doesn't match so the thread doesn't block.

Anyway the test isn't from the proposal so feel free to change it if needed.

@tlively
Copy link
Copy Markdown
Member

tlively commented Mar 19, 2026

Yeah, we should update the README to be more precise (probably as part of the ongoing redesign of waitqueues), but this is to match the analogous behavior of the existing wait instructions.

@kripken
Copy link
Copy Markdown
Member Author

kripken commented Mar 19, 2026

Sounds good @stevenfontanella @tlively , I updated the spec test.

Comment thread test/spec/waitqueue.wast

(module
(type $t (struct (field (mut waitqueue))))
(type $t (shared (struct (field (mut waitqueue)))))
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

It would be good to at least add a TODO for adding a test for the trap-on-unshared behavior.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

I added a full spec test and removed the exec test.

@kripken kripken merged commit 0e5e24c into WebAssembly:main Mar 19, 2026
16 checks passed
@kripken kripken deleted the struct.wait.un branch March 19, 2026 23:13
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