Skip to content

Add option to enable pulley support for pre-compilation and runtime of modules and components#358

Merged
dblnz merged 3 commits intohyperlight-dev:mainfrom
dblnz:pulley-support
Feb 13, 2026
Merged

Add option to enable pulley support for pre-compilation and runtime of modules and components#358
dblnz merged 3 commits intohyperlight-dev:mainfrom
dblnz:pulley-support

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 .

To check a module's compilation option there's no need to provide the --pulley option, it automatically infers it from the ELFs flags.

This also extends the heap size for the debug modules, which are larger than the already assigned size

@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 3 times, most recently from 0e540e8 to 656ffaf Compare February 10, 2026 18:13
ludfjig
ludfjig previously approved these changes Feb 11, 2026
Copy link
Contributor

@ludfjig ludfjig left a comment

Choose a reason for hiding this comment

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

LGTM

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 10 out of 11 changed files in this pull request and generated 6 comments.

Comments suppressed due to low confidence (1)

src/hyperlight_wasm_aot/src/main.rs:174

  • This unconditional println!("{}", error_message) adds noisy stdout output and can duplicate the later eprintln!/parsed-version output. Consider removing it or gating it behind a verbose/debug flag, and prefer stderr for unexpected errors.
                                    let error_message = e.to_string();
                                    println!("{}", error_message);
                                    if !error_message.starts_with(
                                        "Module was compiled with incompatible Wasmtime version",
                                    ) {
                                        eprintln!("{}", error_message);
                                        return;

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

jprendes
jprendes previously approved these changes Feb 13, 2026
Copy link
Contributor

@jprendes jprendes left a comment

Choose a reason for hiding this comment

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

LGT

Signed-off-by: Doru Blânzeanu <dblnz@pm.me>
Signed-off-by: Doru Blânzeanu <dblnz@pm.me>
@dblnz dblnz merged commit 734fb51 into hyperlight-dev:main Feb 13, 2026
32 of 37 checks passed
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.

7 participants