Skip to content

GOL-987: Port async export parameter cleanup to 0.63 - #5

Merged
vigoo merged 1 commit into
wit-bindgen-golem-2.0from
gol-987-free-async-export-params-0.63
Nov 9, 2026
Merged

vigoo merged 1 commit into
wit-bindgen-golem-2.0from
gol-987-free-async-export-params-0.63

Conversation

@vigoo

@vigoo vigoo commented Nov 9, 2026

Copy link
Copy Markdown

Port #4 from wit-bindgen-golem-1.6 to the 0.63 fork used by Golem 2.0. Related: GOL-987, bytecodealliance#1757 and bytecodealliance#1758.

An async export receives indirect parameters in a block allocated through the guest allocator. The generated wrapper must release that block after it reads the arguments and before it can wait. Releasing it after the await leaks the block when the call is cancelled.

Core now passes the block pointer, size and alignment to CallInterface. Rust, C, C# and MoonBit release the block at their own argument-consumption boundary. Go removes the extra operand and keeps its existing runtime-managed unpin path. Sync export cleanup does not change.

Keep the 0.63 resource getter and setter cases in the Rust generator. Extend the stock Go expected-link-failure list without changing package-mode verification. Update the D instruction match; D does not support async exports.

The newer MoonBit scheduler also needs the completed-task queue cleanup from the upstream PR. An empty deque retains coroutine references in its backing buffer, and those coroutines refer back to the task lane. Shrink the empty queue when the task finishes to break that cycle. The older scheduler on the 1.6 fork did not need this change.

Bring over the async-many-arguments codegen and runtime fixtures, including cancellation, option/result payloads, records and direct parameters. Retain the C# lifted-parameter naming and namespace fixes from #4.

This PR changes only the wit-bindgen fork. It does not change consumer pins in golemcloud/golem#4350 or golemcloud/wasm-rquickjs#204. Those consumers must select the repaired revision after this PR lands.

Port #4 from the 1.6 fork, preserving 0.63 resource accessors and Go package-mode verification. Include the upstream MoonBit completed-task queue cleanup required by the newer scheduler, and adapt the D instruction match.

Amp-Thread-ID: https://ampcode.com/threads/T-01a1bfcc-f9f2-7110-b49b-b66644fa37d2

Co-authored-by: Aditya Salunkhe <aditya.salunkh919@gmail.com>
Amp-Thread-ID: https://ampcode.com/threads/T-01a1bfcc-f9f2-7110-b49b-b66644fa37d2
Co-authored-by: Amp <amp@ampcode.com>
@vigoo
vigoo merged commit 8d4e5f6 into wit-bindgen-golem-2.0 Nov 9, 2026
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.

1 participant