Enable wasm GC support (native) - #10
Merged
Merged
Conversation
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
WAMR_BUILD_GC 1inhost/cmake/Findwamr.cmake- native host now accepts modules using wasm-GC struct typescart_gc()/cart_alloc_trackedmanage a separate linear-memory arena for host-returned struct/string buffers, unrelated to WAMR's own GC heap, which the runtime collects automatically.claude/skills/andAGENTS.md(see below)Verification
.watcart usingstruct.new/struct.get+ anull0import loads and runs cleanly under the GC-enabled host for 300+ frames, zero errorsrm -rf build), confirmed-DWASM_ENABLE_GC=1actually compiled into 52 build steps and GC symbols (wasm_obj_is_struct_objetc.) present in the binary - not a stale/cached buildWhat's still blocked (documented in the skill, not fixed here)
wasm-wasitarget is genuinely close (standalone WASI + custom-module imports, real GC struct usage) but hits a real WAMR loader gap: it unconditionally rejects any GC array type withanyrefelements, which sits deep in Kotlin's stdlib. Also needs-Xwasm-use-traps-instead-of-exceptionssince WAMR's fast interpreter and exception-handling are a hard-incompatible build combination.dart2wasmJS namespace and the JS-string-builtins proposal, ruled out by the existing "no JS glue" rule, same as emscripten.Doc accuracy pass
Went through
AGENTS.mdand every.claude/skills/*/SKILL.mdchecking claims against the actual codebase:AGENTS.md: fixed the stale "No wasm GC proposal" line, added detail on the fast-interp/exception-handling build incompatibilityadd-api-function/SKILL.md: addedTilemap/i32[](existing types the skill's list omitted) andgui.yml/tile.yml(existing API groups missing from the example list)tools/docker/README.md: python was listed under "experimental (can't call null0 host-functions yet)" and missing from the build/publish command lists - confirmed by screenshot that python carts do call host functions correctly (clear/draw_rectanglerender fine), moved it into the normal listAPI.mdand a few language bindings that had a staleNULL0_VERSIONconstant (npm run genhadn't been re-run since the last version bump)fix-host-bug/SKILL.md,make-cart/SKILL.md+references/languages.mdchecked against source - no drift foundTest plan