Skip to content

fix(wasm): arm epoch deadline before instantiation#359

Merged
ciaranra merged 1 commit into
devfrom
fix-wasm-instance-deadline
Jul 15, 2026
Merged

fix(wasm): arm epoch deadline before instantiation#359
ciaranra merged 1 commit into
devfrom
fix-wasm-instance-deadline

Conversation

@qciaran

@qciaran qciaran commented Jul 15, 2026

Copy link
Copy Markdown
Collaborator

Summary

  • Arm the Wasmtime epoch deadline before Instance::new so module start functions receive the configured timeout.
  • Add a Rust regression test covering initial construction and init-time re-instantiation with a tracked WAT fixture.
  • Exercise the same WAT fixture through the built pecos-rslib wheel in the Python compatibility matrix, including macOS arm64.

Context

With Wasmtime 46 on macOS arm64, the epoch thread can advance while a sufficiently complex module is being instantiated. The store previously kept Wasmtime's default epoch deadline until exec armed it for an exported call, so Instance::new could trap with interrupt before execution began.

This PR arms the existing timeout deadline for every instance creation. It intentionally tracks only the textual WAT regression fixture; no WASM binary is added.

Validation

  • cargo test -p pecos-wasm
  • cargo clippy -p pecos-wasm --all-targets -- -D warnings
  • cargo fmt --all --check
  • uv run ruff check scripts/ci/smoke_wasm_foreign_object.py
  • uv run ruff format --check scripts/ci/smoke_wasm_foreign_object.py
  • qemulator targeted WASM tests: 6 passed
  • qemulator full suite against an optimized patched pecos-rslib: 199 passed, 3 skipped

@ciaranra
ciaranra marked this pull request as ready for review July 15, 2026 17:39
@ciaranra
ciaranra self-requested a review as a code owner July 15, 2026 17:39
@ciaranra
ciaranra merged commit 5539807 into dev Jul 15, 2026
68 of 69 checks passed
@ciaranra
ciaranra deleted the fix-wasm-instance-deadline branch July 15, 2026 17:40
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