Skip to content

Updates for Hyperlight 0.13 release#389

Open
jsturtevant wants to merge 9 commits intohyperlight-dev:mainfrom
jsturtevant:rally/388-remove-host-function-definition-region
Open

Updates for Hyperlight 0.13 release#389
jsturtevant wants to merge 9 commits intohyperlight-dev:mainfrom
jsturtevant:rally/388-remove-host-function-definition-region

Conversation

@jsturtevant
Copy link
Contributor

Instead of using a shared memory region or a host function callback
to provide host function definitions to the guest, the host now pushes
the serialized definitions directly as a parameter to InitWasmRuntime.

fixes #388

ludfjig
ludfjig previously approved these changes Feb 24, 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.

I think this looks good

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 removes the guest’s dependency on a dedicated “host function definition region” by having the host serialize host function definitions and pass them directly into the guest’s InitWasmRuntime call, aligning with upstream HL-core changes (issue #388).

Changes:

  • Update the guest wasm runtime to parse HostFunctionDetails from InitWasmRuntime parameters (VecBytes) instead of reading from a shared region / callback.
  • Update the host sandbox initialization to track + serialize registered host function definitions and pass them into InitWasmRuntime.
  • Remove SandboxBuilder::with_function_definition_size and document the breaking change; add [workspace] stanzas to excluded crates to avoid workspace resolution issues.

Reviewed changes

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

Show a summary per file
File Description
src/wasm_runtime/src/module.rs InitWasmRuntime now expects a VecBytes parameter containing serialized host function details and registers host funcs from it.
src/wasm_runtime/src/hostfuncs.rs Removes the old get_host_function_details() path.
src/wasm_runtime/src/component.rs Updates InitWasmRuntime signature in the component runtime interface (now takes VecBytes).
src/hyperlight_wasm/src/sandbox/proto_wasm_sandbox.rs Tracks host function definitions as they’re registered; serializes and passes them to InitWasmRuntime.
src/hyperlight_wasm/src/sandbox/sandbox_builder.rs Removes the builder API for host function definition region sizing.
src/hyperlight_wasm/src/sandbox/loaded_wasm_sandbox.rs Adds a regression test ensuring missing host functions fail module load.
src/hyperlight_wasm/Cargo.toml Adds hyperlight-common dependency used for flatbuffer wrapper types.
Cargo.toml Adds hyperlight-common to workspace dependencies.
Cargo.lock Locks hyperlight-common dependency.
src/rust_wasm_samples/Cargo.toml Adds [workspace] to make the crate a standalone workspace root when built directly.
src/hyperlight_wasm_macro/Cargo.toml Adds [workspace] to make the crate a standalone workspace root when built directly.
src/component_sample/Cargo.toml Adds [workspace] to make the crate a standalone workspace root when built directly.
CHANGELOG.md Documents the breaking removal of SandboxBuilder::with_function_definition_size.

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

dblnz
dblnz previously approved these changes Mar 5, 2026
Copy link
Contributor

@dblnz dblnz left a comment

Choose a reason for hiding this comment

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

LGTM!
I left some small comments that are not necessary to be addressed in this PR.

Copy link
Member

@syntactically syntactically left a comment

Choose a reason for hiding this comment

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

Mostly LGTM, except for the comment about HostPrint.

@dblnz
Copy link
Contributor

dblnz commented Mar 6, 2026

Have you tried compiling this with the latest hyperlight main? I'm having some issues locally when I'm trying to build

@jsturtevant jsturtevant force-pushed the rally/388-remove-host-function-definition-region branch from c5b5956 to fdc9d14 Compare March 6, 2026 22:08
@jsturtevant jsturtevant changed the title Remove host function definition region dependency Updates for Hyperlight 0.13 release Mar 6, 2026
Copy link
Contributor

@dblnz dblnz left a comment

Choose a reason for hiding this comment

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

This looks good to me! Thanks for taking care of the changes from hyperlight v0.13.0.
This needs a rebase, there are some conflicts

Instead of using a shared memory region or a host function callback
to provide host function definitions to the guest, the host now pushes
the serialized definitions directly as a parameter to InitWasmRuntime.

Signed-off-by: James Sturtevant <jsturtevant@gmail.com>
rust_wasm_samples, hyperlight_wasm_macro, and component_sample were
missing empty [workspace] tables in their Cargo.toml files. Without
this, Cargo resolves to the main checkout's workspace root when run
from a git worktree, causing 'believes it's in a workspace' errors.
wasm_runtime already had this marker.

Signed-off-by: James Sturtevant <jsturtevant@gmail.com>
Signed-off-by: James Sturtevant <jsturtevant@gmail.com>
Signed-off-by: James Sturtevant <jsturtevant@gmail.com>
Signed-off-by: James Sturtevant <jsturtevant@gmail.com>
Signed-off-by: James Sturtevant <jsturtevant@gmail.com>
Signed-off-by: James Sturtevant <jsturtevant@gmail.com>
@jsturtevant jsturtevant force-pushed the rally/388-remove-host-function-definition-region branch from 6cba4bd to 53b218f Compare March 10, 2026 17:40
Signed-off-by: James Sturtevant <jsturtevant@gmail.com>
Signed-off-by: James Sturtevant <jsturtevant@gmail.com>
@jsturtevant jsturtevant requested a review from dblnz March 10, 2026 19:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Remove host function definition region

6 participants