Stream: git-wasmtime

Topic: wasmtime / PR #13563 add monotonic clock "pause" feature ...


view this post on Zulip Wasmtime GitHub notifications bot (Jun 04 2026 at 22:34):

dicej opened PR #13563 from dicej:p1-adapter-pause-monotonic-clock to bytecodealliance:main:

This adds a new adapter_monotonic_clock_set_paused export to the adapter which toggles whether clock_time_get will call monotonic_clock::now when called with CLOCKID_MONOTONIC versus returning a cached value instead.

This is a workaround for guest language runtimes whose cabi_realloc implementations may call clock_time_get. Since calling imports from cabi_realloc is disallowed, this will trap if the adapter calls monotonic_clock::now. We can avoid the trap by using a cached value instead.

This helps us address
https://github.com/bytecodealliance/componentize-go/issues/56. In that case, cabi_realloc is implemented by calling
unsafe.SliceData to allocate a segment of the appropriate size and alignment from the GC-managed heap and then pinning it using pinner.Pin until it is no longer needed. However, such an allocation may trigger a GC under memory pressure, and as of this writing the Go collector calls clock_time_get to measure time spent in various stages of the GC process.

An alternative fix for the componentize-go issue would be to modify the Go runtime to avoid such calls on WASI during GC, but getting that upstream is likely to be significantly more difficult than working around it in the adapter. If and when Go supports WASIp3 or later natively, the adapter will no longer be used, in which case we will certainly address this upstream.

<!--
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 (Jun 04 2026 at 22:34):

dicej requested pchickey for a review on PR #13563.

view this post on Zulip Wasmtime GitHub notifications bot (Jun 04 2026 at 22:34):

dicej requested wasmtime-wasi-reviewers for a review on PR #13563.

view this post on Zulip Wasmtime GitHub notifications bot (Jun 04 2026 at 23:56):

:thumbs_up: alexcrichton submitted PR review:

I'm not thrilled about it, but I suspect you aren't either, and so long as Go is an unchangable monolith I don't think there are many other realistic options on the table.

view this post on Zulip Wasmtime GitHub notifications bot (Jun 04 2026 at 23:56):

alexcrichton added PR #13563 add monotonic clock "pause" feature to p1->p2 adapter to the merge queue.

view this post on Zulip Wasmtime GitHub notifications bot (Jun 05 2026 at 00:19):

:check: alexcrichton merged PR #13563.

view this post on Zulip Wasmtime GitHub notifications bot (Jun 05 2026 at 00:19):

alexcrichton removed PR #13563 add monotonic clock "pause" feature to p1->p2 adapter from the merge queue.


Last updated: Jul 29 2026 at 05:03 UTC