Skip to content

Simplify and optimize the way that enums are passed in fused adapters#10939

Merged
fitzgen merged 3 commits intobytecodealliance:mainfrom
fitzgen:fact-enum
Jun 5, 2025
Merged

Simplify and optimize the way that enums are passed in fused adapters#10939
fitzgen merged 3 commits intobytecodealliance:mainfrom
fitzgen:fact-enum

Conversation

@fitzgen
Copy link
Copy Markdown
Member

@fitzgen fitzgen commented Jun 5, 2025

instead of treating them like variants that don't have payloads, just check that the discriminant is in bounds.

instead of treating them like variants that don't have payloads, just check that
the discriminant is in bounds.
@fitzgen fitzgen requested a review from a team as a code owner June 5, 2025 21:54
@fitzgen fitzgen requested review from alexcrichton and removed request for a team June 5, 2025 21:54
Copy link
Copy Markdown
Member

@alexcrichton alexcrichton left a comment

Choose a reason for hiding this comment

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

If you're feeling particularly enterprising, mind adding a test to tests/misc_testsuite/component-model/*.wast? I think it should be reasonably easy to hook this all up and we could assert that traps don't happen for in-bounds values but do happen for out-of-bounds values

@fitzgen
Copy link
Copy Markdown
Member Author

fitzgen commented Jun 5, 2025

If you're feeling particularly enterprising, mind adding a test to tests/misc_testsuite/component-model/*.wast?

I'll give this a shot in a follow up PR

@fitzgen fitzgen enabled auto-merge June 5, 2025 22:46
@fitzgen fitzgen added this pull request to the merge queue Jun 5, 2025
Merged via the queue into bytecodealliance:main with commit f669c0a Jun 5, 2025
@fitzgen fitzgen deleted the fact-enum branch June 5, 2025 23:20
alexcrichton added a commit to alexcrichton/wasmtime that referenced this pull request Jun 6, 2025
This commit fixes two issues: (1) is that `--emit-clif` generates file
names that are different from symbol names and (2) is that `--emit-clif`
for components today has collisions on filenames which means that output
files can get corrupted. Currently (2) is causing spurious failures in
CI due to the test added in bytecodealliance#10939 being the first test with a component
and functions in modules where they clash to emit the same file.
github-merge-queue bot pushed a commit that referenced this pull request Jun 6, 2025
* Align symbol names with `--emit-clif`

This commit fixes two issues: (1) is that `--emit-clif` generates file
names that are different from symbol names and (2) is that `--emit-clif`
for components today has collisions on filenames which means that output
files can get corrupted. Currently (2) is causing spurious failures in
CI due to the test added in #10939 being the first test with a component
and functions in modules where they clash to emit the same file.

* Fix typo

* Fix tests

* Fix tests on Windows

Can't use `:` in filenames on Windows

prtest:full
dicej pushed a commit to dicej/wasmtime that referenced this pull request Jun 9, 2025
This commit fixes two issues: (1) is that `--emit-clif` generates file
names that are different from symbol names and (2) is that `--emit-clif`
for components today has collisions on filenames which means that output
files can get corrupted. Currently (2) is causing spurious failures in
CI due to the test added in bytecodealliance#10939 being the first test with a component
and functions in modules where they clash to emit the same file.
bongjunj pushed a commit to prosyslab/wasmtime that referenced this pull request Oct 20, 2025
…rs (bytecodealliance#10939)

* Simplify and optimize the way that `enum`s are passed in fused adapters

instead of treating them like variants that don't have payloads, just check that
the discriminant is in bounds.

* cargo +stable fmt
bongjunj pushed a commit to prosyslab/wasmtime that referenced this pull request Oct 20, 2025
* Align symbol names with `--emit-clif`

This commit fixes two issues: (1) is that `--emit-clif` generates file
names that are different from symbol names and (2) is that `--emit-clif`
for components today has collisions on filenames which means that output
files can get corrupted. Currently (2) is causing spurious failures in
CI due to the test added in bytecodealliance#10939 being the first test with a component
and functions in modules where they clash to emit the same file.

* Fix typo

* Fix tests

* Fix tests on Windows

Can't use `:` in filenames on Windows

prtest:full
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.

2 participants