Skip to content

feat(go): add UseWasmInterpreter config for signal-safe WASM execution - #514

Merged
fabriziodemaria merged 2 commits into
mainfrom
fdema/go-wasm-interpreter-mode
Aug 11, 2026
Merged

feat(go): add UseWasmInterpreter config for signal-safe WASM execution#514
fabriziodemaria merged 2 commits into
mainfrom
fdema/go-wasm-interpreter-mode

Conversation

@fabriziodemaria

Copy link
Copy Markdown
Member

Summary

  • Add UseWasmInterpreter to ProviderConfig and ProviderTestConfig so callers can opt into wazero interpreter mode instead of the default JIT compiler.
  • When enabled, the runtime is created with wazero.NewRuntimeConfigInterpreter(), keeping WASM evaluation on normal Go goroutine stacks so SIGPROF/SIGURG can be handled safely on linux/arm64.
  • Default behavior is unchanged (UseWasmInterpreter: false).

Motivation

temporal-worker pods on linux/arm64 under CPU profiling or goroutine preemption can exit silently (exit code 139, no Go traceback) when signals land during wazero JIT execution. Interpreter mode trades performance for signal safety.

Usage

provider, err := confidence.NewProvider(ctx, confidence.ProviderConfig{
    ClientSecret:       "...",
    EncryptionKey:      "...",
    UseWasmInterpreter: true,
})

Test plan

  • go test ./confidence/internal/local_resolver/... -run InterpreterMode
  • go build ./...
  • Benchmark flag evaluation with and without interpreter mode on arm64
  • Enable UseWasmInterpreter: true on temporal-worker staging and monitor crash rate + latency

Made with Cursor

Allow services on arm64 under CPU profiling or preemption to opt into
wazero's interpreter engine, avoiding silent SIGPROF/SIGURG process death
during JIT WASM execution.
@fabriziodemaria
fabriziodemaria marked this pull request as ready for review August 11, 2026 08:10
Explain when to enable wazero interpreter mode on linux/arm64, the
approximate ~50x WASM-layer slowdown vs JIT, and how to reproduce the
comparison locally. Includes ResolveProcess JIT vs interpreter benchmarks.
@fabriziodemaria
fabriziodemaria merged commit a4f6a23 into main Aug 11, 2026
10 checks passed
@fabriziodemaria
fabriziodemaria deleted the fdema/go-wasm-interpreter-mode branch August 11, 2026 08:28
@github-actions github-actions Bot mentioned this pull request Aug 11, 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.

2 participants