feat: add recursion check and separate threads table#21
Open
GordonSmith wants to merge 2 commits intomainfrom
Open
feat: add recursion check and separate threads table#21GordonSmith wants to merge 2 commits intomainfrom
GordonSmith wants to merge 2 commits intomainfrom
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR aligns the C++ canonical ABI implementation with upstream component-model changes by adding component hierarchy tracking and recursion detection, and separating thread entries into a dedicated table.
Changes:
- Add
ComponentInstance::parent,reflexive_ancestors(),is_reflexive_ancestor_of(), andcall_might_be_recursive()for component hierarchy and recursion detection - Separate thread storage into
ComponentInstance::threads(distinct fromtable) and update all thread operations accordingly - Wrap
Store::invokecaller in a hostSupertaskwithinstance=nullptr, and bump reference submodules
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
include/cmcpp/context.hpp |
Core changes: new parent field, ancestry/recursion methods, threads table, thread op updates |
include/cmcpp/runtime.hpp |
Wraps host caller in a Supertask with instance=nullptr before forwarding to func |
test/main.cpp |
Updates existing thread tests to use inst.threads and adds new tests for ancestry/recursion APIs |
ref/component-model |
Bumps component-model submodule reference |
ref/wit-bindgen |
Bumps wit-bindgen submodule reference |
ref/wasm-micro-runtime |
Bumps wasm-micro-runtime submodule reference |
Align with upstream canonical ABI changes: - Add ComponentInstance::parent for component hierarchy tracking - Add reflexive_ancestors() and is_reflexive_ancestor_of() methods - Add call_might_be_recursive() to detect recursive cross-component calls - Separate thread entries into dedicated ComponentInstance::threads table - Wrap Store::invoke caller in host Supertask with instance=nullptr - Update all thread operations to use threads table instead of table - Add tests for ancestry methods and recursion detection - Bump canonical reference submodules Refs: component-model commits 3a00c74, 5f49720 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
6224c98 to
4e8be12
Compare
Signed-off-by: Gordon Smith <GordonJSmith@gmail.com>
Welcome to Codecov 🎉Once you merge this PR into your default branch, you're all set! Codecov will compare coverage reports and display results in all future pull requests. Thanks for integrating Codecov - We've got you covered ☂️ |
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.
Align with upstream canonical ABI changes:
Refs: component-model commits 3a00c74, 5f49720