From 84630e042632892ac3d6dae501cdec18e7286d76 Mon Sep 17 00:00:00 2001 From: Simon Davies Date: Wed, 22 Apr 2026 20:30:15 +0100 Subject: [PATCH 1/2] fix: align code-validator hyperlight deps with hyperlight-js - Switch code-validator/guest from hyperlight-dev/hyperlight@620339a to simongdavies/hyperlight branch update-surrogate, matching deps/hyperlight-js - Drop removed 'init-paging' feature (absorbed into default in v0.13.1) - Add HYPERLIGHT_INITIAL_SURROGATES=4 to vitest.config.ts to avoid eagerly spawning 512 surrogate processes during tests Fixes SurrogateProcessManager creation failure on Windows. --- src/code-validator/guest/Cargo.toml | 10 +++++----- vitest.config.ts | 6 ++++++ 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/src/code-validator/guest/Cargo.toml b/src/code-validator/guest/Cargo.toml index 4745507..b83745c 100644 --- a/src/code-validator/guest/Cargo.toml +++ b/src/code-validator/guest/Cargo.toml @@ -17,11 +17,11 @@ license = "Apache-2.0" repository = "https://github.com/anthropics/hyperagent" [workspace.dependencies] -# Hyperlight dependencies - pinned to same revision as hyperlight-js -hyperlight-common = { git = "https://github.com/hyperlight-dev/hyperlight", rev = "620339aa95d508e8cbd1d38b4374f09090aade7b", default-features = false } -hyperlight-guest-bin = { git = "https://github.com/hyperlight-dev/hyperlight", rev = "620339aa95d508e8cbd1d38b4374f09090aade7b" } -hyperlight-guest = { git = "https://github.com/hyperlight-dev/hyperlight", rev = "620339aa95d508e8cbd1d38b4374f09090aade7b" } -hyperlight-host = { git = "https://github.com/hyperlight-dev/hyperlight", rev = "620339aa95d508e8cbd1d38b4374f09090aade7b", default-features = false, features = ["executable_heap", "init-paging", "kvm", "mshv3"] } +# Hyperlight dependencies - aligned with deps/hyperlight-js +hyperlight-common = { git = "https://github.com/simongdavies/hyperlight", branch = "update-surrogate", default-features = false } +hyperlight-guest-bin = { git = "https://github.com/simongdavies/hyperlight", branch = "update-surrogate" } +hyperlight-guest = { git = "https://github.com/simongdavies/hyperlight", branch = "update-surrogate" } +hyperlight-host = { git = "https://github.com/simongdavies/hyperlight", branch = "update-surrogate", default-features = false, features = ["executable_heap", "kvm", "mshv3"] } [profile.dev] panic = "abort" diff --git a/vitest.config.ts b/vitest.config.ts index c3ad1a6..649b88e 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -9,6 +9,12 @@ export default defineConfig({ include: ["tests/**/*.test.ts"], // Exclude compiled build artefacts and dependency clones exclude: ["dist/**", "node_modules/**", "deps/**"], + // On Windows, two SurrogateProcessManagers each pre-create a pool of + // surrogate processes. Keep the initial pool small — on-demand growth + // up to the default 512 max handles spikes without wasting resources. + env: { + HYPERLIGHT_INITIAL_SURROGATES: "4", + }, }, resolve: { alias: { From 06343d68b63b47a1959e1e0ad6e753e5c5c5225e Mon Sep 17 00:00:00 2001 From: Simon Davies Date: Wed, 22 Apr 2026 20:48:22 +0100 Subject: [PATCH 2/2] Apply suggestions from code review Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- src/code-validator/guest/Cargo.toml | 2 +- vitest.config.ts | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/code-validator/guest/Cargo.toml b/src/code-validator/guest/Cargo.toml index b83745c..258b846 100644 --- a/src/code-validator/guest/Cargo.toml +++ b/src/code-validator/guest/Cargo.toml @@ -17,7 +17,7 @@ license = "Apache-2.0" repository = "https://github.com/anthropics/hyperagent" [workspace.dependencies] -# Hyperlight dependencies - aligned with deps/hyperlight-js +# Hyperlight dependencies - aligned with the hyperlight-js runtime resolved via Cargo git checkout hyperlight-common = { git = "https://github.com/simongdavies/hyperlight", branch = "update-surrogate", default-features = false } hyperlight-guest-bin = { git = "https://github.com/simongdavies/hyperlight", branch = "update-surrogate" } hyperlight-guest = { git = "https://github.com/simongdavies/hyperlight", branch = "update-surrogate" } diff --git a/vitest.config.ts b/vitest.config.ts index 649b88e..7e94fdd 100644 --- a/vitest.config.ts +++ b/vitest.config.ts @@ -12,9 +12,12 @@ export default defineConfig({ // On Windows, two SurrogateProcessManagers each pre-create a pool of // surrogate processes. Keep the initial pool small — on-demand growth // up to the default 512 max handles spikes without wasting resources. - env: { - HYPERLIGHT_INITIAL_SURROGATES: "4", - }, + env: + process.platform === "win32" + ? { + HYPERLIGHT_INITIAL_SURROGATES: "4", + } + : {}, }, resolve: { alias: {