Stream: git-wasmtime

Topic: wasmtime / PR #12994 winch: Properly zero extend the CAS ...


view this post on Zulip Wasmtime GitHub notifications bot (Apr 08 2026 at 22:52):

saulecabrera opened PR #12994 from saulecabrera:winch-properly-uextend-cmpxchg to bytecodealliance:main:

Accoding to the spec, the result of a compare-and-swap operation must be zero extended according to the result type. Prior to this commit the implementation was skipping the 32 -> 64 bit case.

When the swap happens, the value in rax remains untouched, however, it's possible that the higher bits are undefined, in which case the zero extension is needed to ensure that the right value is returned.

This bug is only reproducible for values in which the lower bits match the expected value, like in the example included in this commit.

<!--
Please make sure you include the following information:

Our development process is documented in the Wasmtime book:
https://docs.wasmtime.dev/contributing-development-process.html

Please ensure all communication follows the code of conduct:
https://github.com/bytecodealliance/wasmtime/blob/main/CODE_OF_CONDUCT.md
-->

view this post on Zulip Wasmtime GitHub notifications bot (Apr 08 2026 at 22:52):

saulecabrera requested uweigand for a review on PR #12994.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 08 2026 at 22:52):

saulecabrera requested wasmtime-compiler-reviewers for a review on PR #12994.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 08 2026 at 22:52):

saulecabrera requested fitzgen for a review on PR #12994.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 08 2026 at 22:52):

saulecabrera requested wasmtime-core-reviewers for a review on PR #12994.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 09 2026 at 02:33):

github-actions[bot] added the label winch on PR #12994.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 09 2026 at 02:33):

github-actions[bot] commented on PR #12994:

Subscribe to Label Action

cc @saulecabrera

<details>
This issue or pull request has been labeled: "winch"

Thus the following users have been cc'd because of the following labels:

To subscribe or unsubscribe from this label, edit the <code>.github/subscribe-to-label.json</code> configuration file.

Learn more.
</details>

view this post on Zulip Wasmtime GitHub notifications bot (Apr 09 2026 at 19:15):

fitzgen submitted PR review:

Thanks!

view this post on Zulip Wasmtime GitHub notifications bot (Apr 09 2026 at 19:16):

fitzgen added PR #12994 winch: Properly zero extend the CAS result to the merge queue.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 09 2026 at 19:51):

alexcrichton removed PR #12994 winch: Properly zero extend the CAS result from the merge queue.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 09 2026 at 19:51):

alexcrichton commented on PR #12994:

Manually removing from queue due to failure at https://github.com/bytecodealliance/wasmtime/actions/runs/24209086212/job/70672712892

view this post on Zulip Wasmtime GitHub notifications bot (Apr 10 2026 at 14:27):

saulecabrera updated PR #12994.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 10 2026 at 14:39):

saulecabrera commented on PR #12994:

Ok, I've fixed the issues. I'll re-add to the queue.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 10 2026 at 14:39):

saulecabrera has enabled auto merge for PR #12994.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 10 2026 at 14:39):

saulecabrera added PR #12994 winch: Properly zero extend the CAS result to the merge queue.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 10 2026 at 15:04):

saulecabrera removed PR #12994 winch: Properly zero extend the CAS result from the merge queue.

view this post on Zulip Wasmtime GitHub notifications bot (Apr 10 2026 at 15:04):

saulecabrera merged PR #12994.


Last updated: Apr 12 2026 at 23:10 UTC