Document that modules must be WASI modules (#329)#402
Open
bushidocodes wants to merge 1 commit into
Open
Conversation
SLEdge assumes every module it loads is a WASI module that uses linear memory, but this assumption was undocumented. The runtime already validates it during dlopen: a non-WASI / no-linear-memory module fails because its aWsm-generated memory symbols (sledge_abi__init_mem, sledge_abi__wasm_memory_starting_pages/_max_pages) don't resolve. Document the requirement in docs/WASI.md: modules must be WASI modules compiled by aWsm and linked against libsledge, linear memory is mandatory, why wasi_snapshot_preview1_* symbol presence is not a useful WASI signal (whole-archive exports), and the --runtime-globals situation. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
675fd66 to
0f51179
Compare
Contributor
Author
|
runtime/include/sledge_abi_symbols.h already had the checks this issue discussed, so this is a doc-only change. |
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.
Closes #329.
Background
aWsm can emit WebAssembly outside the WASI spec (e.g. modules that don't use linear memory), but SLEdge is opinionated around WASI. That assumption was undocumented.
The "validate during dlopen" half of the issue is already satisfied by existing code:
sledge_abi_symbols_initresolves the aWsm-generated symbols and fails the load when the mandatory linear-memory symbols (sledge_abi__init_mem,sledge_abi__wasm_memory_starting_pages/_max_pages) are absent, which is exactly the non-WASI / no-linear-memory case. So this PR is docs-only.Changes
docs/WASI.md— new "Module Requirements and Assumptions" section:libsledge; non-WASI aWsm output is unsupported.wasi_snapshot_preview1_*symbol presence is not a usable WASI signal: those shims come fromlibsledgeand are unconditionally exported from every.sovia--whole-archive --export-dynamic.--runtime-globalsquestion (previously only an inline code comment).No runtime code changes.
🤖 Generated with Claude Code