Stream: git-wasmtime

Topic: wasmtime / PR #12506 Add fiber implementation for riscv32...


view this post on Zulip Wasmtime GitHub notifications bot (Feb 03 2026 at 19:18):

max-dau opened PR #12506 from COLORADIO-Project:fibers-on-riscv32imac to bytecodealliance:main:

This adds an implementation for riscv32imac (and other architectures with identical registers) to the internal fiber crate. This enables usage of the async feature of wasmtime on such platforms.

This feature was first discussed here on Zulip: #wasmtime > Wasmtime-fiber on RISCV32

Our concrete implementation was also discussed here: #wasmtime > Question about 64-bit RISC-V fiber implementation

view this post on Zulip Wasmtime GitHub notifications bot (Feb 03 2026 at 19:18):

max-dau requested cfallin for a review on PR #12506.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 03 2026 at 19:18):

max-dau requested wasmtime-core-reviewers for a review on PR #12506.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 03 2026 at 19:45):

cfallin submitted PR review:

Thanks! This looks basically fine to me except for the alignment issue below and formatting nits.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 03 2026 at 19:45):

cfallin created PR review comment:

The spacing/formatting here and below is nonstandard. Could you ensure that there is no space before commas (see e.g. line 46 addi sp , sp , -0x40), and one space after commas (see e.g. this line sw ra,-0x4(sp))?

view this post on Zulip Wasmtime GitHub notifications bot (Feb 03 2026 at 19:45):

cfallin created PR review comment:

If we want to be 16-byte-aligned, these two fields together are 8 bytes (two 32-bit pointers) so the whole struct is going to be off by 8 bytes, right?

Do we need additional padding between ra and last_sp?

view this post on Zulip Wasmtime GitHub notifications bot (Feb 03 2026 at 20:08):

max-dau updated PR #12506.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 03 2026 at 20:10):

max-dau created PR review comment:

I've adjusted the spacing around the commas in the newest commit. The spacing was also copied from the riscv64 implementation, so I've adjusted the spacing there too.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 03 2026 at 20:10):

max-dau submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 03 2026 at 20:18):

max-dau submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 03 2026 at 20:18):

max-dau created PR review comment:

I was confused about this as well. In nostd.rs (and unix.rs), only the spot between ra and last_sp is explicitly documented to be 16-byte aligned. We also only move the stack pointer to that address, not to the very end of the struct.

I've tested both a version with and a version without 8 bytes of padding between ra and last_sp. Both work fine on my device. I'm honestly not sure whether padding is needed there. If you think we should add padding there, I am happy to add a commit introducing this padding.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 03 2026 at 22:26):

cfallin submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 03 2026 at 22:26):

cfallin created PR review comment:

So I think a few things are going on here:

Given all that, I think if we put 8 bytes of padding before last_sp, we'll have satisfied the alignment requirements.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 03 2026 at 22:28):

cfallin edited PR review comment.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 03 2026 at 22:39):

max-dau updated PR #12506.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 03 2026 at 22:41):

max-dau submitted PR review.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 03 2026 at 22:41):

max-dau created PR review comment:

I've added the padding in the newest commit, thanks for taking the time to look into this!

view this post on Zulip Wasmtime GitHub notifications bot (Feb 03 2026 at 22:45):

cfallin submitted PR review:

Thanks!

view this post on Zulip Wasmtime GitHub notifications bot (Feb 03 2026 at 22:45):

cfallin has enabled auto merge for PR #12506.

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

cfallin added PR #12506 Add fiber implementation for riscv32imac to the merge queue.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 03 2026 at 23:15):

cfallin merged PR #12506.

view this post on Zulip Wasmtime GitHub notifications bot (Feb 03 2026 at 23:15):

cfallin removed PR #12506 Add fiber implementation for riscv32imac from the merge queue.


Last updated: Feb 24 2026 at 04:36 UTC