[codex] fix vm module lifecycle edges#4172
Merged
proggeramlug merged 1 commit intoJun 3, 2026
Merged
Conversation
This was referenced Jun 2, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Linked issues
Closes #3132
Closes #3133
Closes #3322
Behavior cluster
This PR tightens the experimental
node:vmmodule lifecycle surface aroundModule,SourceTextModule, andSyntheticModule:vm.Modulethrough the manifest/native table so direct calls compile and throw Node-shaped errorsvm.Module()fromnew vm.Module()error messages and preserves argument side effects before either throwvm.Module.lengthwith Node's valueSyntheticModule#setExport()for missing export names to throw Node-shaped no-codeReferenceErrors in pre-link, linked, and evaluated statesWhy batched
#3132, #3133, and #3322 share the same gated VM module constructors, runtime module handle model, HIR lowering, native table/manifest rows, and
test-parity/node-suite/vm/modules/lifecycle.tsfixture. Keeping them together avoids splitting one lifecycle state machine across multiple tiny PRs.Tests added
test-parity/node-suite/vm/modules/lifecycle.tswithvm.Modulecall/construct errors, function arity, argument side effects, andSyntheticModule#setExport()missing-name error cases.Commands run
PATH=/tmp/perry-node25-bin:$PATH node --experimental-vm-modules test-parity/node-suite/vm/modules/lifecycle.tsCARGO_BUILD_JOBS=2 RUSTFLAGS='-C linker=cc -C link-arg=-fuse-ld=bfd' cargo build -p perry -p perry-runtime -p perry-stdlib --releasePERRY_EXPERIMENTAL_VM_MODULES=1 PERRY_NO_AUTO_OPTIMIZE=1 PERRY_NO_CACHE=1 ./target/release/perry run test-parity/node-suite/vm/modules/lifecycle.tsCARGO_BUILD_JOBS=2 RUSTFLAGS='-C linker=cc -C link-arg=-fuse-ld=bfd' cargo test -p perry-codegen --test manifest_consistencyCARGO_BUILD_JOBS=2 RUSTFLAGS='-C linker=cc -C link-arg=-fuse-ld=bfd' cargo test -p perry-runtime node_vm(0 matched; runtime has no focusednode_vmunit tests)CARGO_BUILD_JOBS=2 RUSTFLAGS='-C linker=cc -C link-arg=-fuse-ld=bfd' cargo test -p perry-hir vm(0 matched; HIR smoke/filter check)CARGO_BUILD_JOBS=2 RUSTFLAGS='-C linker=cc -C link-arg=-fuse-ld=bfd' PERRY_NO_AUTO_OPTIMIZE=1 PERRY_NO_CACHE=1 PATH=/tmp/perry-node25-bin:$PATH ./run_parity_tests.sh --suite node-suite --module vm --filter modulescargo fmt --all -- --checkgit diff --check./scripts/check_file_size.shKnown limitations and non-goals
PERRY_EXPERIMENTAL_VM_MODULES.Script/context execution,compileFunction,measureMemory, or additional cached-data fidelity outside the existing cached-data fixture surface.