Skip to content

Conversation

@dblnz
Copy link
Contributor

@dblnz dblnz commented Feb 4, 2026

This PR adds an option to enable pulley interpreter instead of the default cranelift for wasmtime.

To use pulley one needs to:

  1. Precompile the module/component for pulley64 target. It can be done using hyperlight-wasm-aot compile --pulley command
  2. Enable the pulley feature for hyperlight-wasm to build the wasm_runtime with pulley feature that correctly sets the config.target("pulley64") for the Config passed to the wasmtime Engine .

@dblnz dblnz added the kind/enhancement New feature or request label Feb 4, 2026
andreiltd
andreiltd previously approved these changes Feb 4, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds support for the Pulley interpreter as an alternative to Cranelift for WebAssembly compilation and execution in Hyperlight. Pulley is an interpreted execution mode for WebAssembly that can be enabled at both AOT compilation time and runtime.

Changes:

  • Added --pulley flag to the AOT compilation tool to target the pulley64 architecture
  • Added pulley feature flag to enable pulley runtime support in the wasm_runtime and hyperlight_wasm crates
  • Added Justfile recipes to build and test modules/components with pulley support

Reviewed changes

Copilot reviewed 9 out of 9 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
src/wasm_runtime/src/module.rs Configures wasmtime engine to use pulley64 target when pulley feature is enabled
src/wasm_runtime/src/component.rs Configures wasmtime engine to use pulley64 target when pulley feature is enabled for component model
src/wasm_runtime/build.rs Adds cfg alias for pulley feature flag
src/wasm_runtime/Cargo.toml Adds pulley feature that enables wasmtime's pulley support
src/hyperlight_wasm_aot/src/main.rs Adds --pulley command-line flag and logic to compile for pulley64 target
src/hyperlight_wasm_aot/Cargo.toml Unconditionally enables pulley feature in wasmtime since AOT tool needs both targets
src/hyperlight_wasm/build.rs Propagates pulley feature flag to wasm_runtime build
src/hyperlight_wasm/Cargo.toml Adds pulley feature flag
Justfile Adds recipes to build and test pulley-compiled modules and components
Comments suppressed due to low confidence (1)

src/hyperlight_wasm_aot/src/main.rs:194

  • When compiling for the pulley target with debug enabled, the code still calls config.cranelift_opt_level(OptLevel::None). Since pulley is an interpreter that doesn't use Cranelift, this setting may be ignored or could potentially cause issues. Consider wrapping Cranelift-specific configuration in a conditional check to only apply when not using pulley (e.g., if !pulley { config.cranelift_opt_level(OptLevel::None); }).
    if debug {
        config.debug_info(true);
        config.cranelift_opt_level(OptLevel::None);

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

simongdavies
simongdavies previously approved these changes Feb 4, 2026
Copy link
Contributor

@simongdavies simongdavies left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one small comment about version checking

jsturtevant
jsturtevant previously approved these changes Feb 4, 2026
Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 9 out of 9 changed files in this pull request and generated 3 comments.

Comments suppressed due to low confidence (1)

src/hyperlight_wasm_aot/src/main.rs:202

  • When compiling for pulley64 target with debug enabled, the code sets cranelift_opt_level(OptLevel::None) which is specific to the Cranelift compiler. This may cause unexpected behavior or errors when using the pulley interpreter. Consider conditionally applying this setting only when not using pulley, or verify that this setting is safely ignored by pulley.
    if debug {
        config.debug_info(true);
        config.cranelift_opt_level(OptLevel::None);

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

simongdavies
simongdavies previously approved these changes Feb 10, 2026
@dblnz dblnz force-pushed the pulley-support branch 2 times, most recently from 2567f4a to 0e540e8 Compare February 10, 2026 17:11
Signed-off-by: Doru Blânzeanu <dblnz@pm.me>
Signed-off-by: Doru Blânzeanu <dblnz@pm.me>
let mut proto_wasm_sandbox = SandboxBuilder::new()
.with_guest_input_buffer_size(256 * 1024)
.with_guest_heap_size(768 * 1024)
.with_guest_heap_size(1280 * 1024)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pulley debug binaries are really big

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

kind/enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants