Skip to content

feat(emulation): add caller-owned modules and persistent execution - #1448

Merged
gmh5225 merged 1 commit into
devfrom
codex/runtime-modules-api-20261019
Oct 19, 2026
Merged

gmh5225 merged 1 commit into
devfrom
codex/runtime-modules-api-20261019

Conversation

@Letenz

@Letenz Letenz commented Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator

Adds a caller-owned catalogue for binary/debug resources and persistent CPU execution. Callers register official or private modules through the same interface, choose eager/lazy preparation, and bind resources into a stopped address space. A recoverable missing-resource stop retains its request token and execution state so the caller can supply a resource and resume.

ModuleSet, generic mapping/publication transactions and execution control share ownership across the C++ API, versioned C ABI, Python SDK and JSON-lines CLI. Source/debug identity validation, failed-publication rollback, cumulative budgets and finite integer-ABI calls remain explicit. Source/PDB symbol addresses are metadata; access and execution require the relevant mapping/model authority. Preexisting opaque export observations are validated by their environment without granting RAM permissions.

The public execution factory in this PR supports raw CPU buffers. The Windows driver adapter is the dependent follow-up #1449; the unregistered-driver rejection is covered even when driver emulation is compiled in. Process/Ring3 adapters remain a design reservation.

Integration base: 9e3b7d948fb585d715e333169f6ef54f8649926b. The inherited settled-handler query is inline in its existing C++ header so Windows shared-SDK tests do not depend on an unexported private DLL symbol.

The regression counts below were collected before the final upstream-only integration, on captured base 1e82f9c1128df07eb8e1e161a179874bc75b4b30. Integration onto 9e3b7d948 preserves the tested feature files and upstream changes; overlapping documentation/test additions were merged and the scoped diffs checked. Per the requested delivery scope, the final upstream refresh does not trigger another full regression.

Validation uses Release, pinned LLVM r6 and the repository's dependency-refreshing build entry point:

python scripts/build.py BUILD --parallel 4 --target neverd NeverDExecutionRunTests NeverDExecutionSessionTests NeverDExecutionCAPITests NeverDExecutionRunJSONTests NeverDModuleTests NeverDModuleBindingTests NeverDModuleCAPITests NeverDResourcePauseTests NeverDExecutionBudgetTests NeverDRunControlTests NeverDIntegerABITests NeverDExecutionCAPIDisabledTests NeverDSessionCAPITests NeverDDebugInfoTests NeverDPDBIdentityTests NeverDMemoryLifecycleTests NeverDProjectionCacheTests NeverDRAMTransactionTests NeverDParallelExecutionTests NeverDCPUEmulationTests
ctest --test-dir BUILD --output-on-failure -R "^NeverD(Execution|Module)CLITests$"
  • Windows CPU-on/driver-off SDK/CLI: 1,372 passing C++ test executions, 1,702 skipped and the same three pre-existing fixture compiler failures; CLI 2/2.
  • Ubuntu API-only SDK/CLI: 1,393 passing C++ executions, 1,689 skipped, zero failures; CLI 2/2. The final ownership split also passes the 56-case standalone generic mapping target on Ubuntu; its linked symbols contain no Windows kernel model.
  • Python SDK audit and 218 unit tests pass on both hosts (96 skipped). Mypy reports no issues in the six SDK source files. Documentation audit covers 309 Markdown files / 10 locales; changed C/C++ is checked with clang-format 22.1.2.

The three Windows failures are SessionCAPITest.AStatedNoReturnCalleeKeepsItsArguments, AStatedNoReturnReachesTheCallersOfItsCallers, and ANameLeadsToOneAddress: the existing fixture compiler supplies -fPIE -pie to clang's MSVC target. These cases pass on Ubuntu. Other skips cover optional native transports and fixtures absent from this software-emulation profile. Repeated cases across targets are counted as executions.

No executables, PDBs, sample drivers or local lab artifacts are included. Callers provide their resources through the documented API.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants