Repository navigation
Test real non-JS WASM execution - #9816
Merged
youknowone merged 4 commits intoNov 13, 2026
Merged
Conversation
Contributor
|
Caution Review failedThe pull request is closed.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
youknowdot
force-pushed
the
test/non-js-wasm-runner-20261112
branch
from
November 12, 2026 09:39
7adce4f to
a8d32fc
Compare
youknowdot
force-pushed
the
test/non-js-wasm-runner-20261112
branch
from
November 13, 2026 04:58
61773d8 to
c180129
Compare
Pass source through a guest-owned allocation ABI, preserve the no-OS VM, and report explicit JSON results and process failures. Enforce bounded input, host deadlines, and an import allowlist. Exercise the execution and failure contract in the existing WASM CI job. Assisted-by: Codex:unknown
Upgrade the native host to Wasmer 7.5 and cover valid, out-of-bounds and unaligned atomic operations. Preserve the no-OS guest import contract and existing CI resources. Assisted-by: Codex:unknown
Let eval take ownership of the alloc_source buffer and drop free_source. The host now prints guest output to stdout and exits 0/1/2 instead of emitting JSON; remove the timeout watchdog, source size limit and the serde_json dependency. Reduce the contract tests to guest execution, Python errors, invalid input, the import allowlist and a trap, dropping the host-protocol and Wasmer atomic-bounds fixtures. Assisted-by: Grok:grok-4.7 Assisted-by: Claude:claude-opus-5-5
Add env.kv_get and env.kv_put host imports backed by an in-memory map, and expose them to Python as a native kv module (kv.get / kv.put). kv_get returns -1 for a missing key or the full value length, copying the value only when it fits so the guest can retry with a larger buffer. The host allows exactly these three imports. Assisted-by: Grok:grok-4.7 Assisted-by: Claude:claude-opus-5-5
youknowdot
force-pushed
the
test/non-js-wasm-runner-20261112
branch
from
November 13, 2026 06:58
c180129 to
d8b5490
Compare
youknowone
approved these changes
Nov 13, 2026
youknowone
marked this pull request as ready for review
November 13, 2026 08:15
Codex Review Summary: ❌ FailedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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.
Summary
Turn the non-JS
wasm32-unknown-unknownexample into a real execution test that fails when the guest fails.-c CODEor a UTF-8 file into a buffer obtained from the guest'salloc_source;eval(ptr, len)takes ownership of that buffer, runs it, and reports thereprof the last expression or the Python exception throughenv.print.kvmodule (kv.get(key) -> bytes | None,kv.put(key, value)) backed by theenv.kv_get/env.kv_puthost imports and an in-memory map owned by the host.kv_getreturns -1 for a missing key or the full value length, copying only when the value fits so the guest can retry with a larger buffer. This wires up thekv_get/kv_putscaffold that was previously declared but never called.wasm-runtime MODULE.wasm (-c CODE | FILE.py). Guest output goes to stdout. Exit status is 0 on success, 1 for a Python exception, 2 for invalid input or a host/runtime error (trap, missing export, bad arguments).env.print,env.kv_get,env.kv_putbefore instantiation. This replaces the CIwasm-objdumpcheck, which never failed the job; the wabt setup is removed.getrandombackend reports unsupported instead of returningOkwithout writing bytes.Tests
test_runtime.py(run with host CPython in the existing WASM CI job) checks against the real guest: supplied source and no-OS identity (sys.platform, 32-bitmaxsize, noposix/nt/js), file source, empty source, host storage round trip (missing key, overwrite, 16 KiB value through the retry path), Python exceptions (assertion, syntax error, failing__repr__), non-UTF-8 source, missing source, an unexpected import, and a guest trap.Verification
Guest and host build, Clippy
-D warnings, rustfmt, ruff, and all 9 contract tests pass locally.AI assistance: initial implementation with OpenAI Codex; simplification and host storage with Grok (grok-4.7) and Claude (claude-opus-5-5).
🤖 Generated with Claude Code