repo
stringlengths
5
53
pr_number
int32
1
321k
task_type
stringclasses
2 values
issue_text
stringlengths
0
81.2k
pr_title
stringlengths
1
319
pr_body
stringlengths
0
105k
base_sha
stringlengths
40
40
head_sha
stringlengths
40
40
gold_diff
stringlengths
0
202M
changed_files
listlengths
0
100
review_threads
listlengths
0
100
test_patch
stringlengths
0
23.4M
merged
bool
1 class
WasmEdge/WasmEdge
4,938
issue_to_patch
fix(wasi): reject symlink targets that resolve outside the preopen root
`path_symlink` rejected absolute targets but accepted relative targets containing `..` that ascend above the preopen root, storing them verbatim. This aligns symlink-target handling with the RESOLVE_BENEATH path resolution WASI enforces: a target that would resolve outside the base (preopened) directory is rejected. -...
41a01b6b4f40defbac0dd551663c542cdcf9ae76
4a69d8872ad2116b5c946aa4c429d9b60f0ab843
diff --git a/include/host/wasi/environ.h b/include/host/wasi/environ.h index 823a140beabf..ea4ca4c77437 100644 --- a/include/host/wasi/environ.h +++ b/include/host/wasi/environ.h @@ -846,10 +846,13 @@ class Environ : public PollerContext { if (!VINode::isPathValid(NewPath)) { return WasiUnexpect(__WASI_ERRN...
[ "include/host/wasi/environ.h", "include/host/wasi/vinode.h", "lib/host/wasi/vinode.cpp", "test/host/wasi/wasi.cpp" ]
[ { "comment": "VINode::pathSymlink resolves the destination path with __WASI_LOOKUPFLAGS_SYMLINK_FOLLOW. If the destination already exists as a symlink, resolvePath will follow it and may end up creating the new symlink at the symlink target instead of returning __WASI_ERRNO_EXIST for the original destination pa...
diff --git a/test/host/wasi/wasi.cpp b/test/host/wasi/wasi.cpp index c7d4aa948e7c..a39b07c3e25b 100644 --- a/test/host/wasi/wasi.cpp +++ b/test/host/wasi/wasi.cpp @@ -4003,6 +4003,9 @@ TEST(WasiTest, SymbolicLink) { WasmEdge::Host::WasiPathSymlink WasiPathSymlink(Env); WasmEdge::Host::WasiPathUnlinkFile WasiPathU...
true
WasmEdge/WasmEdge
4,938
comment_to_fix
fix(wasi): reject symlink targets that resolve outside the preopen root
VINode::pathSymlink resolves the destination path with __WASI_LOOKUPFLAGS_SYMLINK_FOLLOW. If the destination already exists as a symlink, resolvePath will follow it and may end up creating the new symlink at the symlink target instead of returning __WASI_ERRNO_EXIST for the original destination path. For creation APIs ...
41a01b6b4f40defbac0dd551663c542cdcf9ae76
4a69d8872ad2116b5c946aa4c429d9b60f0ab843
diff --git a/lib/host/wasi/vinode.cpp b/lib/host/wasi/vinode.cpp index 4179920a755b..b8fcd0757cb5 100644 --- a/lib/host/wasi/vinode.cpp +++ b/lib/host/wasi/vinode.cpp @@ -256,8 +256,19 @@ WasiExpect<void> VINode::pathSymlink(std::string_view OldPath, if (!New->can(__WASI_RIGHTS_PATH_SYMLINK)) { return WasiUnexp...
[ "lib/host/wasi/vinode.cpp" ]
[ { "comment": "VINode::pathSymlink resolves the destination path with __WASI_LOOKUPFLAGS_SYMLINK_FOLLOW. If the destination already exists as a symlink, resolvePath will follow it and may end up creating the new symlink at the symlink target instead of returning __WASI_ERRNO_EXIST for the original destination pa...
true
WasmEdge/WasmEdge
4,938
comment_to_fix
fix(wasi): reject symlink targets that resolve outside the preopen root
The removeSymlink helper doesn't assert that the unlink succeeded (it only checks that the hostcall returned true). If unlink fails, the symlink can be left behind and cause cascading failures or flaky behavior in later test sections.
41a01b6b4f40defbac0dd551663c542cdcf9ae76
4a69d8872ad2116b5c946aa4c429d9b60f0ab843
diff --git a/test/host/wasi/wasi.cpp b/test/host/wasi/wasi.cpp index c7d4aa948e7c..a39b07c3e25b 100644 --- a/test/host/wasi/wasi.cpp +++ b/test/host/wasi/wasi.cpp @@ -4003,6 +4003,9 @@ TEST(WasiTest, SymbolicLink) { WasmEdge::Host::WasiPathSymlink WasiPathSymlink(Env); WasmEdge::Host::WasiPathUnlinkFile WasiPathU...
[ "test/host/wasi/wasi.cpp" ]
[ { "comment": "The removeSymlink helper doesn't assert that the unlink succeeded (it only checks that the hostcall returned true). If unlink fails, the symlink can be left behind and cause cascading failures or flaky behavior in later test sections.", "path": "test/host/wasi/wasi.cpp", "hunk": "@@ -4128,...
true
WasmEdge/WasmEdge
4,938
comment_to_fix
fix(wasi): reject symlink targets that resolve outside the preopen root
After calling WasiPathRemoveDirectory, the test doesn't assert Errno is __WASI_ERRNO_SUCCESS. If directory removal fails (e.g., because the directory isn't empty), the failure will be silently ignored and can affect later test cases when run in the same working directory.
41a01b6b4f40defbac0dd551663c542cdcf9ae76
4a69d8872ad2116b5c946aa4c429d9b60f0ab843
diff --git a/test/host/wasi/wasi.cpp b/test/host/wasi/wasi.cpp index c7d4aa948e7c..a39b07c3e25b 100644 --- a/test/host/wasi/wasi.cpp +++ b/test/host/wasi/wasi.cpp @@ -4003,6 +4003,9 @@ TEST(WasiTest, SymbolicLink) { WasmEdge::Host::WasiPathSymlink WasiPathSymlink(Env); WasmEdge::Host::WasiPathUnlinkFile WasiPathU...
[ "test/host/wasi/wasi.cpp" ]
[ { "comment": "After calling WasiPathRemoveDirectory, the test doesn't assert Errno is __WASI_ERRNO_SUCCESS. If directory removal fails (e.g., because the directory isn't empty), the failure will be silently ignored and can affect later test cases when run in the same working directory.", "path": "test/host/...
true
WasmEdge/WasmEdge
4,938
comment_to_fix
fix(wasi): reject symlink targets that resolve outside the preopen root
`resolvePath` now has a `ResolvedDepth` out-param, but it is not set on all successful return paths. In particular, the early returns for trailing `.` and `..` currently return `Buffer` without updating `ResolvedDepth`, which violates the header contract (“set …; left untouched on error paths”) and can yield an incorre...
41a01b6b4f40defbac0dd551663c542cdcf9ae76
4a69d8872ad2116b5c946aa4c429d9b60f0ab843
diff --git a/lib/host/wasi/vinode.cpp b/lib/host/wasi/vinode.cpp index 4179920a755b..b8fcd0757cb5 100644 --- a/lib/host/wasi/vinode.cpp +++ b/lib/host/wasi/vinode.cpp @@ -256,8 +256,19 @@ WasiExpect<void> VINode::pathSymlink(std::string_view OldPath, if (!New->can(__WASI_RIGHTS_PATH_SYMLINK)) { return WasiUnexp...
[ "lib/host/wasi/vinode.cpp" ]
[ { "comment": "`resolvePath` now has a `ResolvedDepth` out-param, but it is not set on all successful return paths. In particular, the early returns for trailing `.` and `..` currently return `Buffer` without updating `ResolvedDepth`, which violates the header contract (“set …; left untouched on error paths”) an...
true
WasmEdge/WasmEdge
4,936
issue_to_patch
fix(common): resolve Clang compilation error in uint128_fallback subtraction
## Description This PR fixes a compilation failure encountered when building WasmEdge with developer tests enabled on arm64 macOS using a standard LLVM/Clang toolchain. The custom `uint128_fallback` structure lacks a native unary bitwise NOT (`~`) operator, which causes modern strict compilers to fail with an `i...
cb21baa4c300477ad6d0c627e397271804f9fd69
667c30df0d8b8cc58129914bade9470d68137451
diff --git a/include/common/int128.h b/include/common/int128.h index 40f49e7270e8..168f488050dd 100644 --- a/include/common/int128.h +++ b/include/common/int128.h @@ -581,8 +581,8 @@ operator+(detail::uint128_fallback LHS, unsigned int RHS) { inline constexpr detail::uint128_fallback operator-(unsigned int LHS, det...
[ "include/common/int128.h" ]
[]
true
WasmEdge/WasmEdge
4,874
issue_to_patch
test: add unit tests for common/spdlog.cpp logging API
## Description Add comprehensive unit tests for the WasmEdge logging API in `lib/common/spdlog.cpp`, which previously had zero test coverage. **Functions tested:** - `setLoggingLevelFromString` — all 9 valid level strings (`trace`, `debug`, `info`, `warn`, `warning`, `error`, `critical`, `fatal`, `off`) plus...
1cd04e4b35ebc86c937527f0146c2ec56fd701b3
b2caac9e218b8eb26cb4f599328cb55248ee084b
[ "test/common/CMakeLists.txt", "test/common/spdlogTest.cpp" ]
[]
diff --git a/test/common/CMakeLists.txt b/test/common/CMakeLists.txt index 030358670238..e3d009ad0b3b 100644 --- a/test/common/CMakeLists.txt +++ b/test/common/CMakeLists.txt @@ -4,6 +4,7 @@ wasmedge_add_executable(wasmedgeCommonTests int128Test.cpp hashTest.cpp + spdlogTest.cpp ) add_test(wasmedgeCommonTes...
true
WasmEdge/WasmEdge
4,929
issue_to_patch
docs: sync Japanese README
## Description This PR updates README-ja.md to sync it with the latest English README.md. The scope is intentionally limited to the Japanese README only. It does not modify README.md, README-zh.md, or README-zh-TW.md. Related issue: Part of #4228 ## Changes - Synced outdated or missing sections in README-ja....
9595a74d5d1535130b73ff1def563499c9a6e552
b8562b10a499373cc6c533920b0386c2f3e9abb1
diff --git a/README-ja.md b/README-ja.md index 248067ceadc9..b82e60043861 100644 --- a/README-ja.md +++ b/README-ja.md @@ -8,9 +8,11 @@ ![WasmEdge Logo](/docs/wasmedge-runtime-logo.png) -# [🤩 WasmEdge は、ご自身のデバイスで LLM を実行する最も簡単で早い方法です。 🤩](https://www.secondstate.io/articles/wasm-runtime-agi/) +# [🤩 WasmEdge は、手元...
[ "README-ja.md" ]
[]
true
WasmEdge/WasmEdge
4,928
issue_to_patch
ci(linter): bump to clang-format-20
## Description Ensure that the CI uses a pinned clang-format version, 20. ## Checklist Before submitting this PR, please ensure the following: - [x] **DCO Signed-off**: All commits are signed-off (`git commit -s`). CI workflows will only be approved if DCO check is passed. - [x] **Commit Messages**: Run `c...
bf4a593681e8b19f63c580da7d8f99678a4a79d2
74a2d2acc518687ea42a53281d0f0e0dd5a6d16f
diff --git a/.github/workflows/reusable-call-linter.yml b/.github/workflows/reusable-call-linter.yml index 75596266b5e7..493999b228e8 100644 --- a/.github/workflows/reusable-call-linter.yml +++ b/.github/workflows/reusable-call-linter.yml @@ -24,7 +24,7 @@ jobs: - name: Install clang-format run: | ...
[ ".github/workflows/reusable-call-linter.yml", "lib/system/fault.cpp", "plugins/wasi_crypto/asymmetric_common/keypair.cpp", "plugins/wasi_crypto/symmetric/ctx.cpp", "plugins/wasi_crypto/symmetric/state.cpp" ]
[]
true
WasmEdge/WasmEdge
4,863
issue_to_patch
feat(component,validator): resource, start, externdesc, tag validation
## Description Tag in core-export alias and inline-export - validate(Alias) core-export branch maps CoreSortType::Tag to ExternalType::Tag instead of falling into the unsupported default. - validate(CoreInstance) inline-export switch picks up Tag, so an inline-exported tag is registered as Tag rather than rejected...
59514b7c785b974eaf766dbc416a561392af57f4
d3eb7205052ad970d45dde8fe2718026e9986105
diff --git a/include/common/enum.inc b/include/common/enum.inc index fdde6715bb76..94a8626955b8 100644 --- a/include/common/enum.inc +++ b/include/common/enum.inc @@ -1118,6 +1118,8 @@ E(InstanceMissingExpectedExport, 0x02B2, "missing expected export") E(InvalidExportName, 0x02B3, "not a valid export name") // Extern...
[ "include/common/enum.inc", "include/validator/component_context.h", "include/validator/validator.h", "lib/validator/component_validator.cpp", "lib/validator/validator.cpp", "test/component/ComponentValidatorTest.cpp", "test/spec/spectest.cpp" ]
[ { "comment": "Why are we create this instance at the point? This means if someone create another constructor for `Validator` then\r\n\r\n1. one could set `CoreFuncType_I32_I32` to something else\r\n2. or one forgot to configure it", "path": "lib/validator/validator.cpp", "hunk": "@@ -65,6 +80,12 @@ chec...
diff --git a/test/component/ComponentValidatorTest.cpp b/test/component/ComponentValidatorTest.cpp index a58cbdd9c425..4d3766f08fe4 100644 --- a/test/component/ComponentValidatorTest.cpp +++ b/test/component/ComponentValidatorTest.cpp @@ -659,8 +659,9 @@ TEST(ComponentValidatorTest, InstanceTypeExportCaseFoldConflict) ...
true
WasmEdge/WasmEdge
4,863
comment_to_fix
feat(component,validator): resource, start, externdesc, tag validation
Why are we create this instance at the point? This means if someone create another constructor for `Validator` then 1. one could set `CoreFuncType_I32_I32` to something else 2. or one forgot to configure it
59514b7c785b974eaf766dbc416a561392af57f4
d3eb7205052ad970d45dde8fe2718026e9986105
diff --git a/lib/validator/validator.cpp b/lib/validator/validator.cpp index c0695aa5c04b..84cf8ea41ec4 100644 --- a/lib/validator/validator.cpp +++ b/lib/validator/validator.cpp @@ -18,6 +18,21 @@ namespace Validator { namespace { +// One-shot builder for the pre-defined core function SubTypes. +AST::SubType make...
[ "lib/validator/validator.cpp" ]
[ { "comment": "Why are we create this instance at the point? This means if someone create another constructor for `Validator` then\r\n\r\n1. one could set `CoreFuncType_I32_I32` to something else\r\n2. or one forgot to configure it", "path": "lib/validator/validator.cpp", "hunk": "@@ -65,6 +80,12 @@ chec...
true
WasmEdge/WasmEdge
4,924
issue_to_patch
ci(dependabot): bump github/codeql-action from 4.36.0 to 4.36.1
Bumps [github/codeql-action](https://github.com/github/codeql-action) from 4.36.0 to 4.36.1. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/github/codeql-action/releases">github/codeql-action's releases</a>.</em></p> <blockquote> <h2>v4.36.1</h2> <p>No user facing changes.</p...
1cf5d532d796d81d200a3069672ecdbaa2c7b7d3
785fa4f78e764b1603ddb14a83076225b96a82bf
diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 1e9967ac6f83..13fe7810abda 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -81,7 +81,7 @@ jobs: # Initializes the CodeQL tools for scanning. - name: Initialize C...
[ ".github/workflows/codeql-analysis.yml" ]
[]
true
WasmEdge/WasmEdge
4,925
issue_to_patch
ci(dependabot): bump actions/checkout from 6.0.2 to 6.0.3
Bumps [actions/checkout](https://github.com/actions/checkout) from 6.0.2 to 6.0.3. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/actions/checkout/releases">actions/checkout's releases</a>.</em></p> <blockquote> <h2>v6.0.3</h2> <h2>What's Changed</h2> <ul> <li>Update changelo...
fcbea0b6d591e23e264f59fc359ac490e2cf07ed
89ef93456791ce80419c82fea53c0cce0f151a3f
diff --git a/.github/workflows/IWYU_scan.yml b/.github/workflows/IWYU_scan.yml index 2fbccd1a070e..1c09f09380ac 100644 --- a/.github/workflows/IWYU_scan.yml +++ b/.github/workflows/IWYU_scan.yml @@ -48,7 +48,7 @@ jobs: with: egress-policy: audit - - uses: actions/checkout@de0fac2e4500dabe0009e67214...
[ ".github/workflows/IWYU_scan.yml", ".github/workflows/build-extensions.yml", ".github/workflows/build.yml", ".github/workflows/build_for_nix.yml", ".github/workflows/build_for_openwrt.yml", ".github/workflows/build_for_riscv.yml", ".github/workflows/build_for_s390x.yml", ".github/workflows/codeql-anal...
[]
true
WasmEdge/WasmEdge
4,915
issue_to_patch
feat(validator/component): enumerate exports of imported/aliased modules
Component instance definitions could not resolve an alias-export into an instance produced by instantiating an imported, declared, or outer-aliased core module / component. The validator only derived instance exports from a locally-defined module/component's inline AST, so every other case got an empty export table and...
f8698d157b1c1f63a9c1671e9eee5cfd0c0f3f6e
428090e44d478134cfac8a45a3e547c9693d781b
diff --git a/include/validator/component_context.h b/include/validator/component_context.h index 7011d7b18a99..ad82ac737fca 100644 --- a/include/validator/component_context.h +++ b/include/validator/component_context.h @@ -12,6 +12,7 @@ #include <string> #include <unordered_map> #include <unordered_set> +#include <v...
[ "include/validator/component_context.h", "lib/validator/component_context.cpp", "lib/validator/component_validator.cpp", "test/spec/spectest.cpp" ]
[]
diff --git a/test/spec/spectest.cpp b/test/spec/spectest.cpp index ef4622fa28e6..fecf7fdca54c 100644 --- a/test/spec/spectest.cpp +++ b/test/spec/spectest.cpp @@ -318,7 +318,7 @@ std::map<std::string, ComponentModelSupport> ComponentModelFolders = { // Test table: the testing status of load, validate, instantiate,...
true
WasmEdge/WasmEdge
4,921
issue_to_patch
fix(driver): register the --run-mode CLI flag
## Description --run-mode is declared, constructed, and consumed by the runtime tool, and the --enable-jit / --force-interpreter deprecation warnings tell users to switch to it, but the parser registration was dropped in a refactor, so --run-mode=<mode> was rejected as an unknown option. Restore the add_option call ...
e1ffd9c8d02e46da22daf845d3f3797a00ad6ad9
024129a7605f6ec5f781e1679b465f1a9b9592b9
diff --git a/include/driver/tool.h b/include/driver/tool.h index ae582fb77d25..7a75ca86bb54 100644 --- a/include/driver/tool.h +++ b/include/driver/tool.h @@ -15,6 +15,7 @@ #include "driver/options.h" #include "plugin/plugin.h" #include "po/argument_parser.h" +#include <optional> #include <string_view> namespace...
[ "include/driver/tool.h", "lib/driver/runtimeTool.cpp", "test/driver/driverToolTest.cpp" ]
[ { "comment": "**<sub><sub>![P1 Badge](https://img.shields.io/badge/P1-orange?style=flat)</sub></sub> Remove change-explaining test comments**\n\nThe repo instructions in `AGENTS.md` say not to add inline comments explaining the change. This new regression note describes why the test was added and why it is par...
diff --git a/test/driver/driverToolTest.cpp b/test/driver/driverToolTest.cpp index 66eba83edef3..6d951d62bff6 100644 --- a/test/driver/driverToolTest.cpp +++ b/test/driver/driverToolTest.cpp @@ -2,7 +2,9 @@ // SPDX-FileCopyrightText: 2019-2024 Second State INC #include "common/defines.h" +#include "driver/tool.h" ...
true
WasmEdge/WasmEdge
4,921
comment_to_fix
fix(driver): register the --run-mode CLI flag
**<sub><sub>![P1 Badge](https://img.shields.io/badge/P1-orange?style=flat)</sub></sub> Remove change-explaining test comments** The repo instructions in `AGENTS.md` say not to add inline comments explaining the change. This new regression note describes why the test was added and why it is parse-only rather than docu...
e1ffd9c8d02e46da22daf845d3f3797a00ad6ad9
024129a7605f6ec5f781e1679b465f1a9b9592b9
diff --git a/test/driver/driverToolTest.cpp b/test/driver/driverToolTest.cpp index 66eba83edef3..6d951d62bff6 100644 --- a/test/driver/driverToolTest.cpp +++ b/test/driver/driverToolTest.cpp @@ -2,7 +2,9 @@ // SPDX-FileCopyrightText: 2019-2024 Second State INC #include "common/defines.h" +#include "driver/tool.h" ...
[ "test/driver/driverToolTest.cpp" ]
[ { "comment": "**<sub><sub>![P1 Badge](https://img.shields.io/badge/P1-orange?style=flat)</sub></sub> Remove change-explaining test comments**\n\nThe repo instructions in `AGENTS.md` say not to add inline comments explaining the change. This new regression note describes why the test was added and why it is par...
true
WasmEdge/WasmEdge
4,921
comment_to_fix
fix(driver): register the --run-mode CLI flag
**<sub><sub>![P2 Badge](https://img.shields.io/badge/P2-yellow?style=flat)</sub></sub> Reject invalid run-mode values** Registering `--run-mode` as an unconstrained string makes typos such as `--run-mode=jti` parse successfully; `Tool()` then calls `parseRunModeArg()`, whose fall-through returns `RunMode::Interpreter...
e1ffd9c8d02e46da22daf845d3f3797a00ad6ad9
024129a7605f6ec5f781e1679b465f1a9b9592b9
diff --git a/include/driver/tool.h b/include/driver/tool.h index ae582fb77d25..7a75ca86bb54 100644 --- a/include/driver/tool.h +++ b/include/driver/tool.h @@ -15,6 +15,7 @@ #include "driver/options.h" #include "plugin/plugin.h" #include "po/argument_parser.h" +#include <optional> #include <string_view> namespace...
[ "include/driver/tool.h" ]
[ { "comment": "**<sub><sub>![P2 Badge](https://img.shields.io/badge/P2-yellow?style=flat)</sub></sub> Reject invalid run-mode values**\n\nRegistering `--run-mode` as an unconstrained string makes typos such as `--run-mode=jti` parse successfully; `Tool()` then calls `parseRunModeArg()`, whose fall-through retur...
true
WasmEdge/WasmEdge
4,920
issue_to_patch
fix: reject non-funcref tables/refs in call_indirect and call_ref
## Description A table whose element type is a concrete non-funcref reference (e.g. `(ref null $s)` for a struct type) passed validation because the checks used `ValType::isFuncRefType()`, which treats any concrete type index as a funcref. Such a module would then reinterpret the struct reference as a `FunctionInsta...
b2bab2a0362825ef260a7c460aac3e86574e26fd
d8e960504dd48ece15046476fc30f91ef3a3c04e
diff --git a/include/common/types.h b/include/common/types.h index de5d23764ee3..6a3ba6e9d3c8 100644 --- a/include/common/types.h +++ b/include/common/types.h @@ -689,6 +689,9 @@ inline ValVariant ValueFromType(ValType Type) noexcept { inline const Runtime::Instance::FunctionInstance * retrieveFuncRef(const RefVari...
[ "include/common/types.h", "lib/executor/engine/controlInstr.cpp", "lib/validator/formchecker.cpp", "test/executor/ExecutorRegressionTest.cpp" ]
[ { "comment": "What if we report \"this is not a function\"?", "path": "include/common/types.h", "hunk": "@@ -689,6 +689,9 @@ inline ValVariant ValueFromType(ValType Type) noexcept {\n \n inline const Runtime::Instance::FunctionInstance *\n retrieveFuncRef(const RefVariant &Val) {\n+ if (!Val.getType()....
diff --git a/test/executor/ExecutorRegressionTest.cpp b/test/executor/ExecutorRegressionTest.cpp index 1b8bad5cc0c8..d131b0629b3c 100644 --- a/test/executor/ExecutorRegressionTest.cpp +++ b/test/executor/ExecutorRegressionTest.cpp @@ -482,6 +482,39 @@ std::array<WasmEdge::Byte, 134> ThrowRefMultiParamWasm{ 0x00, 0...
true
WasmEdge/WasmEdge
4,920
comment_to_fix
fix: reject non-funcref tables/refs in call_indirect and call_ref
What if we report "this is not a function"?
b2bab2a0362825ef260a7c460aac3e86574e26fd
d8e960504dd48ece15046476fc30f91ef3a3c04e
diff --git a/include/common/types.h b/include/common/types.h index de5d23764ee3..6a3ba6e9d3c8 100644 --- a/include/common/types.h +++ b/include/common/types.h @@ -689,6 +689,9 @@ inline ValVariant ValueFromType(ValType Type) noexcept { inline const Runtime::Instance::FunctionInstance * retrieveFuncRef(const RefVari...
[ "include/common/types.h" ]
[ { "comment": "What if we report \"this is not a function\"?", "path": "include/common/types.h", "hunk": "@@ -689,6 +689,9 @@ inline ValVariant ValueFromType(ValType Type) noexcept {\n \n inline const Runtime::Instance::FunctionInstance *\n retrieveFuncRef(const RefVariant &Val) {\n+ if (!Val.getType()....
true
WasmEdge/WasmEdge
4,922
issue_to_patch
fix(test/llvm): drop redundant libs from wasmedgeLazyJITTests
wasmedgeVM already PUBLIC-links wasmedgeCommon, wasmedgeLoader and wasmedgeValidator, so listing them again on wasmedgeLazyJITTests put each archive on the link line twice and produced the macOS linker warning "ld: warning: ignoring duplicate libraries". Link wasmedgeVM alone, matching every other wasmedgeVM-consuming ...
d8c45f15de5ae3bff12c48e59ce24d0603dba7f7
b79fcc938b9076d5829d8261b96cd180dd5fd521
[ "test/llvm/CMakeLists.txt" ]
[]
diff --git a/test/llvm/CMakeLists.txt b/test/llvm/CMakeLists.txt index 5ea30c71314d..d71ea8411577 100644 --- a/test/llvm/CMakeLists.txt +++ b/test/llvm/CMakeLists.txt @@ -21,9 +21,6 @@ add_test(wasmedgeLazyJITTests wasmedgeLazyJITTests) target_link_libraries(wasmedgeLazyJITTests PRIVATE - wasmedgeCommon - wasme...
true
WasmEdge/WasmEdge
4,913
issue_to_patch
fix(test/plugins/zlib): remove concrete types to fix devirtualization
## Description <!-- Describe your changes here --> Similar to #4910, tests for the Zlib plugin were breaking the build. Here are the failing build logs before this change: ``` build $ cmake -DWASMEDGE_BUILD_TESTS=ON -DWASMEDGE_PLUGIN_ZLIB=ON .. && make -j 2 /usr/bin/ld: /tmp/ccEhMzob.ltrans0.ltrans.o: in function ...
9091ce4f3c89a11efa5a2b84e5a0e8cc44ddebe1
950ef897f78905d32292d9a9744fa006b06005cd
[ "test/plugins/wasmedge_zlib/wasmedge_zlib.cpp" ]
[]
diff --git a/test/plugins/wasmedge_zlib/wasmedge_zlib.cpp b/test/plugins/wasmedge_zlib/wasmedge_zlib.cpp index b777abf2bb63..cb6ce197ad1d 100644 --- a/test/plugins/wasmedge_zlib/wasmedge_zlib.cpp +++ b/test/plugins/wasmedge_zlib/wasmedge_zlib.cpp @@ -84,38 +84,32 @@ TEST(WasmEdgeZlibTest, DeflateInflateCycle) { auto...
true
WasmEdge/WasmEdge
4,911
issue_to_patch
chore: add community meeting issue template
Assisted-by: Claude (Anthropic) ## Checklist Before submitting this PR, please ensure the following: - [x] **DCO Signed-off**: All commits are signed-off (`git commit -s`). CI workflows will only be approved if DCO check is passed. - [x] **Commit Messages**: Run `commitlint` on your commit messages to ensure ...
d3cbc241ac51f9781a9756aef2c0ef1fee4f3a61
9774c747d2fd9b954a347f008f13f1c0342ce1da
diff --git a/.github/ISSUE_TEMPLATE/community_meeting.yml b/.github/ISSUE_TEMPLATE/community_meeting.yml new file mode 100644 index 000000000000..a9955406663a --- /dev/null +++ b/.github/ISSUE_TEMPLATE/community_meeting.yml @@ -0,0 +1,40 @@ +name: "Community Meeting" +description: Propose and discuss topics for the mon...
[ ".github/ISSUE_TEMPLATE/community_meeting.yml" ]
[]
true
WasmEdge/WasmEdge
4,910
issue_to_patch
fix(test/plugins/image): remove concrete types to fix devirtualization
## Description This was breaking the build because of undefined references to LoadJPG::body, LoadPNG::body, LoadImage::body. I have removed `dynamic_cast<concrete_type>` and the inclusion of the concrete Load* types from `image_func.h` This fixes the build as can be seen here: ``` build $ cmake -DWASMEDGE_BUILD_...
b9ea291328e0ab1edaf59283522067c57da785a1
85cbb921b36f91b08e11e23eddce916f685e8afe
[ "test/plugins/wasmedge_image/wasmedge_image.cpp" ]
[ { "comment": "Remove this line.", "path": "test/plugins/wasmedge_image/wasmedge_image.cpp", "hunk": "@@ -179,8 +179,8 @@ TEST(WasmEdgeImageTest, LoadJPG) {\n auto *FuncInst = ImgMod->findFuncExports(\"load_jpg\");\n EXPECT_NE(FuncInst, nullptr);\n EXPECT_TRUE(FuncInst->isHostFunction());\n- auto ...
diff --git a/test/plugins/wasmedge_image/wasmedge_image.cpp b/test/plugins/wasmedge_image/wasmedge_image.cpp index 4f449727ff42..479afbd07cd6 100644 --- a/test/plugins/wasmedge_image/wasmedge_image.cpp +++ b/test/plugins/wasmedge_image/wasmedge_image.cpp @@ -2,8 +2,8 @@ // SPDX-FileCopyrightText: 2019-2024 Second Stat...
true
WasmEdge/WasmEdge
4,910
comment_to_fix
fix(test/plugins/image): remove concrete types to fix devirtualization
Remove this line.
b9ea291328e0ab1edaf59283522067c57da785a1
85cbb921b36f91b08e11e23eddce916f685e8afe
diff --git a/test/plugins/wasmedge_image/wasmedge_image.cpp b/test/plugins/wasmedge_image/wasmedge_image.cpp index 4f449727ff42..479afbd07cd6 100644 --- a/test/plugins/wasmedge_image/wasmedge_image.cpp +++ b/test/plugins/wasmedge_image/wasmedge_image.cpp @@ -2,8 +2,8 @@ // SPDX-FileCopyrightText: 2019-2024 Second Stat...
[ "test/plugins/wasmedge_image/wasmedge_image.cpp" ]
[ { "comment": "Remove this line.", "path": "test/plugins/wasmedge_image/wasmedge_image.cpp", "hunk": "@@ -179,8 +179,8 @@ TEST(WasmEdgeImageTest, LoadJPG) {\n auto *FuncInst = ImgMod->findFuncExports(\"load_jpg\");\n EXPECT_NE(FuncInst, nullptr);\n EXPECT_TRUE(FuncInst->isHostFunction());\n- auto ...
true
WasmEdge/WasmEdge
4,910
comment_to_fix
fix(test/plugins/image): remove concrete types to fix devirtualization
Ditto
b9ea291328e0ab1edaf59283522067c57da785a1
85cbb921b36f91b08e11e23eddce916f685e8afe
diff --git a/test/plugins/wasmedge_image/wasmedge_image.cpp b/test/plugins/wasmedge_image/wasmedge_image.cpp index 4f449727ff42..479afbd07cd6 100644 --- a/test/plugins/wasmedge_image/wasmedge_image.cpp +++ b/test/plugins/wasmedge_image/wasmedge_image.cpp @@ -2,8 +2,8 @@ // SPDX-FileCopyrightText: 2019-2024 Second Stat...
[ "test/plugins/wasmedge_image/wasmedge_image.cpp" ]
[ { "comment": "Ditto", "path": "test/plugins/wasmedge_image/wasmedge_image.cpp", "hunk": "@@ -320,8 +320,8 @@ TEST(WasmEdgeImageTest, LoadPNG) {\n auto *FuncInst = ImgMod->findFuncExports(\"load_png\");\n EXPECT_NE(FuncInst, nullptr);\n EXPECT_TRUE(FuncInst->isHostFunction());\n- auto &HostFuncIns...
true
WasmEdge/WasmEdge
4,910
comment_to_fix
fix(test/plugins/image): remove concrete types to fix devirtualization
Ditto
b9ea291328e0ab1edaf59283522067c57da785a1
85cbb921b36f91b08e11e23eddce916f685e8afe
diff --git a/test/plugins/wasmedge_image/wasmedge_image.cpp b/test/plugins/wasmedge_image/wasmedge_image.cpp index 4f449727ff42..479afbd07cd6 100644 --- a/test/plugins/wasmedge_image/wasmedge_image.cpp +++ b/test/plugins/wasmedge_image/wasmedge_image.cpp @@ -2,8 +2,8 @@ // SPDX-FileCopyrightText: 2019-2024 Second Stat...
[ "test/plugins/wasmedge_image/wasmedge_image.cpp" ]
[ { "comment": "Ditto", "path": "test/plugins/wasmedge_image/wasmedge_image.cpp", "hunk": "@@ -459,8 +459,8 @@ TEST(WasmEdgeImageTest, LoadImage) {\n auto *FuncInst = ImgMod->findFuncExports(\"load_image\");\n EXPECT_NE(FuncInst, nullptr);\n EXPECT_TRUE(FuncInst->isHostFunction());\n- auto &HostFun...
true
WasmEdge/WasmEdge
4,897
issue_to_patch
bug: StoreManager::reset leaves component registrations intact ### Summary StoreManager::reset() clears NamedMod but does not clear NamedComp. After reset(), findComponent() can still return a previously registered component name. ### Current State In include/runtime/storemgr.h, reset() only unlinks and clears Name...
fix: storemanager::reset clears namedcomp
## Description <!-- Describe your changes here --> fixed #4896 ## Checklist Before submitting this PR, please ensure the following: - [x] **DCO Signed-off**: All commits are signed-off (`git commit -s`). CI workflows will only be approved if DCO check is passed. - [x] **Commit Messages**: Run `commitlint` on...
7fb4cd621b7b9858c64b711c7150377f03f58c83
ea1aeeab61c0f814615cd85442c3d3231d76f6b1
diff --git a/include/runtime/storemgr.h b/include/runtime/storemgr.h index 7504895a499f..95af2fe04f76 100644 --- a/include/runtime/storemgr.h +++ b/include/runtime/storemgr.h @@ -76,6 +76,7 @@ class StoreManager { ->unlinkStore(this, Name); } NamedMod.clear(); + NamedComp.clear(); } /// ...
[ "include/runtime/storemgr.h" ]
[]
true
WasmEdge/WasmEdge
4,802
issue_to_patch
refactor(executor): extract SIMD superinstruction primitives into header
## Summary - Introduces `include/executor/engine/simd_ops.h` — a single set of inline, free-function SIMD op templates (arithmetic, min/max, fmin/fmax, neg/abs/sqrt, ceil/floor/trunc/nearest, popcnt, v128 bitwise, narrow/widen conversions). - Converts the `Executor::runVector*` member functions in `binary_numeric_vect...
f1d20116e4c3c00f5572a6801e450d84fe6b0e6b
9a2e6cc2ab0ff6c8af4e3369dfc1430f16b80e25
diff --git a/include/executor/engine/binary_numeric_vector.ipp b/include/executor/engine/binary_numeric_vector.ipp index d87f8bbdebb4..83ac43ffeac4 100644 --- a/include/executor/engine/binary_numeric_vector.ipp +++ b/include/executor/engine/binary_numeric_vector.ipp @@ -2,6 +2,7 @@ // SPDX-License-Identifier: Apache-2...
[ "include/executor/engine/binary_numeric_vector.ipp", "include/executor/engine/simd_ops.h", "include/executor/engine/unary_numeric_vector.ipp" ]
[ { "comment": "This function is not used in ipp.", "path": "include/executor/engine/simd_ops.h", "hunk": "@@ -0,0 +1,279 @@\n+// SPDX-License-Identifier: Apache-2.0\n+// SPDX-FileCopyrightText: 2019-2024 Second State INC\n+\n+//===-- wasmedge/executor/engine/simd_ops.h - SIMD op free templates ------===/...
true
WasmEdge/WasmEdge
4,802
comment_to_fix
refactor(executor): extract SIMD superinstruction primitives into header
This function is not used in ipp.
f1d20116e4c3c00f5572a6801e450d84fe6b0e6b
9a2e6cc2ab0ff6c8af4e3369dfc1430f16b80e25
diff --git a/include/executor/engine/simd_ops.h b/include/executor/engine/simd_ops.h new file mode 100644 index 000000000000..db1abeb67939 --- /dev/null +++ b/include/executor/engine/simd_ops.h @@ -0,0 +1,237 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2019-2024 Second State INC + +//===-- wa...
[ "include/executor/engine/simd_ops.h" ]
[ { "comment": "This function is not used in ipp.", "path": "include/executor/engine/simd_ops.h", "hunk": "@@ -0,0 +1,279 @@\n+// SPDX-License-Identifier: Apache-2.0\n+// SPDX-FileCopyrightText: 2019-2024 Second State INC\n+\n+//===-- wasmedge/executor/engine/simd_ops.h - SIMD op free templates ------===/...
true
WasmEdge/WasmEdge
4,802
comment_to_fix
refactor(executor): extract SIMD superinstruction primitives into header
The `v128` series of functions is not used in the executor.
f1d20116e4c3c00f5572a6801e450d84fe6b0e6b
9a2e6cc2ab0ff6c8af4e3369dfc1430f16b80e25
diff --git a/include/executor/engine/simd_ops.h b/include/executor/engine/simd_ops.h new file mode 100644 index 000000000000..db1abeb67939 --- /dev/null +++ b/include/executor/engine/simd_ops.h @@ -0,0 +1,237 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2019-2024 Second State INC + +//===-- wa...
[ "include/executor/engine/simd_ops.h" ]
[ { "comment": "The `v128` series of functions is not used in the executor.", "path": "include/executor/engine/simd_ops.h", "hunk": "@@ -0,0 +1,279 @@\n+// SPDX-License-Identifier: Apache-2.0\n+// SPDX-FileCopyrightText: 2019-2024 Second State INC\n+\n+//===-- wasmedge/executor/engine/simd_ops.h - SIMD op...
true
WasmEdge/WasmEdge
4,802
comment_to_fix
refactor(executor): extract SIMD superinstruction primitives into header
I found that in the original implementation, there will have a check like this: ```cpp else if constexpr (sizeof(T) == 8) ``` What's the reason to remove all of them?
f1d20116e4c3c00f5572a6801e450d84fe6b0e6b
9a2e6cc2ab0ff6c8af4e3369dfc1430f16b80e25
diff --git a/include/executor/engine/simd_ops.h b/include/executor/engine/simd_ops.h new file mode 100644 index 000000000000..db1abeb67939 --- /dev/null +++ b/include/executor/engine/simd_ops.h @@ -0,0 +1,237 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2019-2024 Second State INC + +//===-- wa...
[ "include/executor/engine/simd_ops.h" ]
[ { "comment": "I found that in the original implementation, there will have a check like this:\n\n```cpp\nelse if constexpr (sizeof(T) == 8)\n```\n\nWhat's the reason to remove all of them?", "path": "include/executor/engine/simd_ops.h", "hunk": "@@ -0,0 +1,237 @@\n+// SPDX-License-Identifier: Apache-2.0...
true
WasmEdge/WasmEdge
4,905
issue_to_patch
fix: fix lookup error while vm unregister module
## Description This PR fixes a key mismatch bug in `unsafeUnregisterModule` where it incorrectly attempts to look up `RegModMap` using the registered module `Name` (alias) instead of its internal `Module.getID()`. During module registration, `RegModMap` is populated using `Module.getID()` as the key. However, `un...
874c575eea013312e8c6563104d68400a6fe3250
3132936e67dde5775212df7a028152d37e5619b7
diff --git a/lib/vm/vm.cpp b/lib/vm/vm.cpp index 229d1b32ccb9..074be9d96e93 100644 --- a/lib/vm/vm.cpp +++ b/lib/vm/vm.cpp @@ -345,19 +345,19 @@ VM::unsafeRegisterModule(std::string_view Name, } Expect<void> VM::unsafeUnregisterModule(std::string_view Name) { - auto RegMapIt = RegModMap.find(std::string(Name)); - ...
[ "lib/vm/vm.cpp" ]
[]
true
WasmEdge/WasmEdge
4,726
issue_to_patch
LFX Workspace: Implement module instance dependency tree in WASM store ### Project Title Implement module instance dependency tree in WASM store ### Motivation In the current WasmEdge implementation, multiple WebAssembly modules can be loaded, linked, and registered into the `Store`. However, there is a lack of a s...
feat: implement module instance dependency tree in WASM store
## Description <!-- Describe your changes here --> ## Checklist Before submitting this PR, please ensure the following: - [x] **DCO Signed-off**: All commits are signed-off (`git commit -s`). CI workflows will only be approved if DCO check is passed. - [x] **Commit Messages**: Run `commitlint` on your commit...
01832097cb0b108ee280d0d0bcd2ee04459c644e
d43add2ef2038d516fbd29ee2d3c5722f63d9b2b
diff --git a/.github/scripts/whitelist.symbols b/.github/scripts/whitelist.symbols index 74f8260662e9..0057ffe0fd8b 100644 --- a/.github/scripts/whitelist.symbols +++ b/.github/scripts/whitelist.symbols @@ -226,6 +226,7 @@ WasmEdge_VMAsyncRunWasmFromFile WasmEdge_VMCleanup WasmEdge_VMCreate WasmEdge_VMDelete +WasmEd...
[ ".github/scripts/whitelist.symbols", "include/api/wasmedge/wasmedge_deprecated.h", "include/api/wasmedge/wasmedge_vm.h", "include/runtime/instance/module.h", "include/runtime/storemgr.h", "include/vm/vm.h", "lib/api/wasmedge.cpp", "lib/executor/instantiate/module.cpp", "lib/vm/CMakeLists.txt", "li...
[ { "comment": "Don't just delete the API.\nYou should move the old API to the deprecated header and make sure that still works.", "path": "include/api/wasmedge/wasmedge_vm.h", "hunk": "@@ -603,18 +603,19 @@ WasmEdge_VMGetFunctionList(const WasmEdge_VMContext *Cxt,\n const WasmE...
diff --git a/test/api/APIUnitTest.cpp b/test/api/APIUnitTest.cpp index a9ecec756528..fceae8b76a10 100644 --- a/test/api/APIUnitTest.cpp +++ b/test/api/APIUnitTest.cpp @@ -223,6 +223,59 @@ char *Preopens[] = {&PreopensVec[0], &PreopensVec[12], &PreopensVec[21], &PreopensVec[32], &PreopensVec[49]}; ...
true
WasmEdge/WasmEdge
4,726
comment_to_fix
feat: implement module instance dependency tree in WASM store
Don't just delete the API. You should move the old API to the deprecated header and make sure that still works.
01832097cb0b108ee280d0d0bcd2ee04459c644e
d43add2ef2038d516fbd29ee2d3c5722f63d9b2b
diff --git a/include/api/wasmedge/wasmedge_vm.h b/include/api/wasmedge/wasmedge_vm.h index 36c9471ac50a..12bdf4521e1c 100644 --- a/include/api/wasmedge/wasmedge_vm.h +++ b/include/api/wasmedge/wasmedge_vm.h @@ -604,18 +604,15 @@ WasmEdge_VMGetFunctionList(const WasmEdge_VMContext *Cxt, const...
[ "include/api/wasmedge/wasmedge_vm.h" ]
[ { "comment": "Don't just delete the API.\nYou should move the old API to the deprecated header and make sure that still works.", "path": "include/api/wasmedge/wasmedge_vm.h", "hunk": "@@ -603,18 +603,19 @@ WasmEdge_VMGetFunctionList(const WasmEdge_VMContext *Cxt,\n const WasmE...
true
WasmEdge/WasmEdge
4,726
comment_to_fix
feat: implement module instance dependency tree in WASM store
As mentioned. And redirect the old API to the new one.
01832097cb0b108ee280d0d0bcd2ee04459c644e
d43add2ef2038d516fbd29ee2d3c5722f63d9b2b
diff --git a/lib/api/wasmedge.cpp b/lib/api/wasmedge.cpp index e1cee5d131ec..45d041447fa7 100644 --- a/lib/api/wasmedge.cpp +++ b/lib/api/wasmedge.cpp @@ -2665,7 +2665,10 @@ WASMEDGE_CAPI_EXPORT void WasmEdge_ModuleInstanceAddGlobal( WASMEDGE_CAPI_EXPORT void WasmEdge_ModuleInstanceDelete(WasmEdge_ModuleInstanceCon...
[ "lib/api/wasmedge.cpp" ]
[ { "comment": "As mentioned. And redirect the old API to the new one.", "path": "lib/api/wasmedge.cpp", "hunk": "@@ -3508,7 +3508,7 @@ WASMEDGE_CAPI_EXPORT void WasmEdge_VMCleanup(WasmEdge_VMContext *Cxt) noexcept {\n }\n }\n \n-void WasmEdge_VMForceDeleteRegisteredModule(\n+void WasmEdge_VMDeleteRegis...
true
WasmEdge/WasmEdge
4,726
comment_to_fix
feat: implement module instance dependency tree in WASM store
When unregister module, I don't think we need to return the module instance to caller.
01832097cb0b108ee280d0d0bcd2ee04459c644e
d43add2ef2038d516fbd29ee2d3c5722f63d9b2b
diff --git a/lib/vm/vm.cpp b/lib/vm/vm.cpp index cf594a8be374..229d1b32ccb9 100644 --- a/lib/vm/vm.cpp +++ b/lib/vm/vm.cpp @@ -159,7 +159,7 @@ void VM::unsafeInitVM() { void VM::unsafeLoadBuiltInHosts() { // Load the built-in host modules from configuration. // TODO: This will be extended for versioned WASI in t...
[ "lib/vm/vm.cpp" ]
[ { "comment": "When unregister module, I don't think we need to return the module instance to caller.", "path": "lib/vm/vm.cpp", "hunk": "@@ -235,6 +235,21 @@ VM::unsafeRegisterModule(const Runtime::Instance::ModuleInstance &ModInst,\n return ExecutorEngine.registerModule(StoreRef, ModInst, Name);\n }\...
true
WasmEdge/WasmEdge
4,726
comment_to_fix
feat: implement module instance dependency tree in WASM store
Link the anonymous module to store is not necessary.
01832097cb0b108ee280d0d0bcd2ee04459c644e
d43add2ef2038d516fbd29ee2d3c5722f63d9b2b
diff --git a/lib/vm/vm.cpp b/lib/vm/vm.cpp index cf594a8be374..229d1b32ccb9 100644 --- a/lib/vm/vm.cpp +++ b/lib/vm/vm.cpp @@ -159,7 +159,7 @@ void VM::unsafeInitVM() { void VM::unsafeLoadBuiltInHosts() { // Load the built-in host modules from configuration. // TODO: This will be extended for versioned WASI in t...
[ "lib/vm/vm.cpp" ]
[ { "comment": "Link the anonymous module to store is not necessary.", "path": "lib/vm/vm.cpp", "hunk": "@@ -309,6 +324,7 @@ VM::unsafeRunWasmFile(const AST::Module &Module, std::string_view Func,\n EXPECTED_TRY(ValidatorEngine.validate(Module));\n EXPECTED_TRY(ActiveModInst,\n Executor...
true
WasmEdge/WasmEdge
4,726
comment_to_fix
feat: implement module instance dependency tree in WASM store
Ditto.
01832097cb0b108ee280d0d0bcd2ee04459c644e
d43add2ef2038d516fbd29ee2d3c5722f63d9b2b
diff --git a/lib/vm/vm.cpp b/lib/vm/vm.cpp index cf594a8be374..229d1b32ccb9 100644 --- a/lib/vm/vm.cpp +++ b/lib/vm/vm.cpp @@ -159,7 +159,7 @@ void VM::unsafeInitVM() { void VM::unsafeLoadBuiltInHosts() { // Load the built-in host modules from configuration. // TODO: This will be extended for versioned WASI in t...
[ "lib/vm/vm.cpp" ]
[ { "comment": "Ditto.", "path": "lib/vm/vm.cpp", "hunk": "@@ -486,6 +502,7 @@ Expect<void> VM::unsafeInstantiate() {\n \n EXPECTED_TRY(ActiveModInst,\n ExecutorEngine.instantiateModule(StoreRef, *Mod));\n+ StoreRef.linkAnonymousModule(ActiveModInst.get());", "resolving_sha": "...
true
WasmEdge/WasmEdge
4,726
comment_to_fix
feat: implement module instance dependency tree in WASM store
In the explaination of header, it's not necessary to describe the degree system about the implmentation. You only need to explain that the module would be safely deleted when there's no dependency on it.
01832097cb0b108ee280d0d0bcd2ee04459c644e
d43add2ef2038d516fbd29ee2d3c5722f63d9b2b
diff --git a/include/api/wasmedge/wasmedge_vm.h b/include/api/wasmedge/wasmedge_vm.h index 36c9471ac50a..12bdf4521e1c 100644 --- a/include/api/wasmedge/wasmedge_vm.h +++ b/include/api/wasmedge/wasmedge_vm.h @@ -604,18 +604,15 @@ WasmEdge_VMGetFunctionList(const WasmEdge_VMContext *Cxt, const...
[ "include/api/wasmedge/wasmedge_vm.h" ]
[ { "comment": "In the explaination of header, it's not necessary to describe the degree system about the implmentation. You only need to explain that the module would be safely deleted when there's no dependency on it.", "path": "include/api/wasmedge/wasmedge_vm.h", "hunk": "@@ -603,18 +603,18 @@ WasmEdg...
true
WasmEdge/WasmEdge
4,726
comment_to_fix
feat: implement module instance dependency tree in WASM store
Should notify the modules to reset self-degree. Also should consider the case about the imported modules not owned by this VM.
01832097cb0b108ee280d0d0bcd2ee04459c644e
d43add2ef2038d516fbd29ee2d3c5722f63d9b2b
diff --git a/lib/vm/vm.cpp b/lib/vm/vm.cpp index cf594a8be374..229d1b32ccb9 100644 --- a/lib/vm/vm.cpp +++ b/lib/vm/vm.cpp @@ -159,7 +159,7 @@ void VM::unsafeInitVM() { void VM::unsafeLoadBuiltInHosts() { // Load the built-in host modules from configuration. // TODO: This will be extended for versioned WASI in t...
[ "lib/vm/vm.cpp" ]
[ { "comment": "Should notify the modules to reset self-degree.\nAlso should consider the case about the imported modules not owned by this VM.", "path": "lib/vm/vm.cpp", "hunk": "@@ -235,6 +235,18 @@ VM::unsafeRegisterModule(const Runtime::Instance::ModuleInstance &ModInst,\n return ExecutorEngine.regi...
true
WasmEdge/WasmEdge
4,726
comment_to_fix
feat: implement module instance dependency tree in WASM store
Since already moved the store linking procedure to the timing of reseting the self-degree, I don't think the unlinking is needed here.
01832097cb0b108ee280d0d0bcd2ee04459c644e
d43add2ef2038d516fbd29ee2d3c5722f63d9b2b
diff --git a/include/runtime/instance/module.h b/include/runtime/instance/module.h index b36298df538a..0e705abae6f5 100644 --- a/include/runtime/instance/module.h +++ b/include/runtime/instance/module.h @@ -78,17 +78,22 @@ class ModuleInstance { std::function<void(void *)> Finalizer = nullptr) ...
[ "include/runtime/instance/module.h" ]
[ { "comment": "Since already moved the store linking procedure to the timing of reseting the self-degree, I don't think the unlinking is needed here.", "path": "include/runtime/instance/module.h", "hunk": "@@ -76,15 +76,20 @@ class ModuleInstance {\n std::function<void(void *)> Finalizer...
true
WasmEdge/WasmEdge
4,726
comment_to_fix
feat: implement module instance dependency tree in WASM store
Why don't you call `tryToDelete` in `resetSelfDegree` and `decrementInDegree`?
01832097cb0b108ee280d0d0bcd2ee04459c644e
d43add2ef2038d516fbd29ee2d3c5722f63d9b2b
diff --git a/include/runtime/instance/module.h b/include/runtime/instance/module.h index b36298df538a..0e705abae6f5 100644 --- a/include/runtime/instance/module.h +++ b/include/runtime/instance/module.h @@ -78,17 +78,22 @@ class ModuleInstance { std::function<void(void *)> Finalizer = nullptr) ...
[ "include/runtime/instance/module.h" ]
[ { "comment": "Why don't you call `tryToDelete` in `resetSelfDegree` and `decrementInDegree`?", "path": "include/runtime/instance/module.h", "hunk": "@@ -76,15 +76,20 @@ class ModuleInstance {\n std::function<void(void *)> Finalizer = nullptr)\n : ModName(Name), HostData(Data), Hos...
true
WasmEdge/WasmEdge
4,726
comment_to_fix
feat: implement module instance dependency tree in WASM store
Remove `this->`.
01832097cb0b108ee280d0d0bcd2ee04459c644e
d43add2ef2038d516fbd29ee2d3c5722f63d9b2b
diff --git a/include/runtime/instance/module.h b/include/runtime/instance/module.h index b36298df538a..0e705abae6f5 100644 --- a/include/runtime/instance/module.h +++ b/include/runtime/instance/module.h @@ -78,17 +78,22 @@ class ModuleInstance { std::function<void(void *)> Finalizer = nullptr) ...
[ "include/runtime/instance/module.h" ]
[ { "comment": "Remove `this->`.", "path": "include/runtime/instance/module.h", "hunk": "@@ -76,17 +76,19 @@ class ModuleInstance {\n std::function<void(void *)> Finalizer = nullptr)\n : ModName(Name), HostData(Data), HostDataFinalizer(Finalizer) {}\n virtual ~ModuleInstance() noe...
true
WasmEdge/WasmEdge
4,726
comment_to_fix
feat: implement module instance dependency tree in WASM store
Is it redundant? If the map is empty, I think the for loop below would do nothing.
01832097cb0b108ee280d0d0bcd2ee04459c644e
d43add2ef2038d516fbd29ee2d3c5722f63d9b2b
diff --git a/include/runtime/instance/module.h b/include/runtime/instance/module.h index b36298df538a..0e705abae6f5 100644 --- a/include/runtime/instance/module.h +++ b/include/runtime/instance/module.h @@ -78,17 +78,22 @@ class ModuleInstance { std::function<void(void *)> Finalizer = nullptr) ...
[ "include/runtime/instance/module.h" ]
[ { "comment": "Is it redundant?\nIf the map is empty, I think the for loop below would do nothing.", "path": "include/runtime/instance/module.h", "hunk": "@@ -530,6 +532,53 @@ class ModuleInstance {\n LinkedStore.erase(LinkedStoreKey{Store, std::string(Name)});\n }\n \n+ void unlinkAllStores() noe...
true
WasmEdge/WasmEdge
4,726
comment_to_fix
feat: implement module instance dependency tree in WASM store
Follow the format of defining WASM binary above (like `FibonacciWasm`).
01832097cb0b108ee280d0d0bcd2ee04459c644e
d43add2ef2038d516fbd29ee2d3c5722f63d9b2b
diff --git a/test/api/APIUnitTest.cpp b/test/api/APIUnitTest.cpp index a9ecec756528..fceae8b76a10 100644 --- a/test/api/APIUnitTest.cpp +++ b/test/api/APIUnitTest.cpp @@ -223,6 +223,59 @@ char *Preopens[] = {&PreopensVec[0], &PreopensVec[12], &PreopensVec[21], &PreopensVec[32], &PreopensVec[49]}; ...
[ "test/api/APIUnitTest.cpp" ]
[ { "comment": "Follow the format of defining WASM binary above (like `FibonacciWasm`).", "path": "test/api/APIUnitTest.cpp", "hunk": "@@ -223,6 +223,62 @@ char *Preopens[] = {&PreopensVec[0], &PreopensVec[12], &PreopensVec[21],\n &PreopensVec[32], &PreopensVec[49]};\n char TPath[] = \...
true
WasmEdge/WasmEdge
4,726
comment_to_fix
feat: implement module instance dependency tree in WASM store
For the VMs/Loaders/etc. you didn't modify the configuration, the `Conf` is not needed.
01832097cb0b108ee280d0d0bcd2ee04459c644e
d43add2ef2038d516fbd29ee2d3c5722f63d9b2b
diff --git a/test/api/APIUnitTest.cpp b/test/api/APIUnitTest.cpp index a9ecec756528..fceae8b76a10 100644 --- a/test/api/APIUnitTest.cpp +++ b/test/api/APIUnitTest.cpp @@ -223,6 +223,59 @@ char *Preopens[] = {&PreopensVec[0], &PreopensVec[12], &PreopensVec[21], &PreopensVec[32], &PreopensVec[49]}; ...
[ "test/api/APIUnitTest.cpp" ]
[ { "comment": "For the VMs/Loaders/etc. you didn't modify the configuration, the `Conf` is not needed.", "path": "test/api/APIUnitTest.cpp", "hunk": "@@ -3911,6 +3967,594 @@ TEST(APICoreTest, VM) {\n WasmEdge_VMDelete(VM);\n }\n \n+TEST(APICoreTest, VMDeleteRegistered) {\n+ WasmEdge_ConfigureContext *...
true
WasmEdge/WasmEdge
4,726
comment_to_fix
feat: implement module instance dependency tree in WASM store
Use `[](void *, const WasmEdge_CallingFrameContext *, ...`
01832097cb0b108ee280d0d0bcd2ee04459c644e
d43add2ef2038d516fbd29ee2d3c5722f63d9b2b
diff --git a/test/api/APIUnitTest.cpp b/test/api/APIUnitTest.cpp index a9ecec756528..fceae8b76a10 100644 --- a/test/api/APIUnitTest.cpp +++ b/test/api/APIUnitTest.cpp @@ -223,6 +223,59 @@ char *Preopens[] = {&PreopensVec[0], &PreopensVec[12], &PreopensVec[21], &PreopensVec[32], &PreopensVec[49]}; ...
[ "test/api/APIUnitTest.cpp" ]
[ { "comment": "Use `[](void *, const WasmEdge_CallingFrameContext *, ...`", "path": "test/api/APIUnitTest.cpp", "hunk": "@@ -3911,6 +3967,594 @@ TEST(APICoreTest, VM) {\n WasmEdge_VMDelete(VM);\n }\n \n+TEST(APICoreTest, VMDeleteRegistered) {\n+ WasmEdge_ConfigureContext *Conf = WasmEdge_ConfigureCrea...
true
WasmEdge/WasmEdge
4,726
comment_to_fix
feat: implement module instance dependency tree in WASM store
fix the naming style.
01832097cb0b108ee280d0d0bcd2ee04459c644e
d43add2ef2038d516fbd29ee2d3c5722f63d9b2b
diff --git a/test/api/APIUnitTest.cpp b/test/api/APIUnitTest.cpp index a9ecec756528..fceae8b76a10 100644 --- a/test/api/APIUnitTest.cpp +++ b/test/api/APIUnitTest.cpp @@ -223,6 +223,59 @@ char *Preopens[] = {&PreopensVec[0], &PreopensVec[12], &PreopensVec[21], &PreopensVec[32], &PreopensVec[49]}; ...
[ "test/api/APIUnitTest.cpp" ]
[ { "comment": "fix the naming style.", "path": "test/api/APIUnitTest.cpp", "hunk": "@@ -3911,6 +3967,594 @@ TEST(APICoreTest, VM) {\n WasmEdge_VMDelete(VM);\n }\n \n+TEST(APICoreTest, VMDeleteRegistered) {\n+ WasmEdge_ConfigureContext *Conf = WasmEdge_ConfigureCreate();\n+ WasmEdge_ExecutorContext *E...
true
WasmEdge/WasmEdge
4,726
comment_to_fix
feat: implement module instance dependency tree in WASM store
`PFuncName` is better.
01832097cb0b108ee280d0d0bcd2ee04459c644e
d43add2ef2038d516fbd29ee2d3c5722f63d9b2b
diff --git a/test/api/APIUnitTest.cpp b/test/api/APIUnitTest.cpp index a9ecec756528..fceae8b76a10 100644 --- a/test/api/APIUnitTest.cpp +++ b/test/api/APIUnitTest.cpp @@ -223,6 +223,59 @@ char *Preopens[] = {&PreopensVec[0], &PreopensVec[12], &PreopensVec[21], &PreopensVec[32], &PreopensVec[49]}; ...
[ "test/api/APIUnitTest.cpp" ]
[ { "comment": "`PFuncName` is better.", "path": "test/api/APIUnitTest.cpp", "hunk": "@@ -3911,6 +3967,594 @@ TEST(APICoreTest, VM) {\n WasmEdge_VMDelete(VM);\n }\n \n+TEST(APICoreTest, VMDeleteRegistered) {\n+ WasmEdge_ConfigureContext *Conf = WasmEdge_ConfigureCreate();\n+ WasmEdge_ExecutorContext *...
true
WasmEdge/WasmEdge
4,726
comment_to_fix
feat: implement module instance dependency tree in WASM store
Remove the redundant line
01832097cb0b108ee280d0d0bcd2ee04459c644e
d43add2ef2038d516fbd29ee2d3c5722f63d9b2b
diff --git a/test/api/APIUnitTest.cpp b/test/api/APIUnitTest.cpp index a9ecec756528..fceae8b76a10 100644 --- a/test/api/APIUnitTest.cpp +++ b/test/api/APIUnitTest.cpp @@ -223,6 +223,59 @@ char *Preopens[] = {&PreopensVec[0], &PreopensVec[12], &PreopensVec[21], &PreopensVec[32], &PreopensVec[49]}; ...
[ "test/api/APIUnitTest.cpp" ]
[ { "comment": "Remove the redundant line", "path": "test/api/APIUnitTest.cpp", "hunk": "@@ -3911,6 +3967,594 @@ TEST(APICoreTest, VM) {\n WasmEdge_VMDelete(VM);\n }\n \n+TEST(APICoreTest, VMDeleteRegistered) {\n+ WasmEdge_ConfigureContext *Conf = WasmEdge_ConfigureCreate();\n+ WasmEdge_ExecutorContex...
true
WasmEdge/WasmEdge
4,726
comment_to_fix
feat: implement module instance dependency tree in WASM store
You should call VMDelete before the end of this scope.
01832097cb0b108ee280d0d0bcd2ee04459c644e
d43add2ef2038d516fbd29ee2d3c5722f63d9b2b
diff --git a/test/api/APIUnitTest.cpp b/test/api/APIUnitTest.cpp index a9ecec756528..fceae8b76a10 100644 --- a/test/api/APIUnitTest.cpp +++ b/test/api/APIUnitTest.cpp @@ -223,6 +223,59 @@ char *Preopens[] = {&PreopensVec[0], &PreopensVec[12], &PreopensVec[21], &PreopensVec[32], &PreopensVec[49]}; ...
[ "test/api/APIUnitTest.cpp" ]
[ { "comment": "You should call VMDelete before the end of this scope.", "path": "test/api/APIUnitTest.cpp", "hunk": "@@ -3911,6 +3967,594 @@ TEST(APICoreTest, VM) {\n WasmEdge_VMDelete(VM);\n }\n \n+TEST(APICoreTest, VMDeleteRegistered) {\n+ WasmEdge_ConfigureContext *Conf = WasmEdge_ConfigureCreate()...
true
WasmEdge/WasmEdge
4,726
comment_to_fix
feat: implement module instance dependency tree in WASM store
You should call VMDelete before the end of this scope.
01832097cb0b108ee280d0d0bcd2ee04459c644e
d43add2ef2038d516fbd29ee2d3c5722f63d9b2b
diff --git a/test/api/APIUnitTest.cpp b/test/api/APIUnitTest.cpp index a9ecec756528..fceae8b76a10 100644 --- a/test/api/APIUnitTest.cpp +++ b/test/api/APIUnitTest.cpp @@ -223,6 +223,59 @@ char *Preopens[] = {&PreopensVec[0], &PreopensVec[12], &PreopensVec[21], &PreopensVec[32], &PreopensVec[49]}; ...
[ "test/api/APIUnitTest.cpp" ]
[ { "comment": "You should call VMDelete before the end of this scope.", "path": "test/api/APIUnitTest.cpp", "hunk": "@@ -3911,6 +3967,594 @@ TEST(APICoreTest, VM) {\n WasmEdge_VMDelete(VM);\n }\n \n+TEST(APICoreTest, VMDeleteRegistered) {\n+ WasmEdge_ConfigureContext *Conf = WasmEdge_ConfigureCreate()...
true
WasmEdge/WasmEdge
4,726
comment_to_fix
feat: implement module instance dependency tree in WASM store
You should call VMDelete and StoreDelete before the end of this scope.
01832097cb0b108ee280d0d0bcd2ee04459c644e
d43add2ef2038d516fbd29ee2d3c5722f63d9b2b
diff --git a/test/api/APIUnitTest.cpp b/test/api/APIUnitTest.cpp index a9ecec756528..fceae8b76a10 100644 --- a/test/api/APIUnitTest.cpp +++ b/test/api/APIUnitTest.cpp @@ -223,6 +223,59 @@ char *Preopens[] = {&PreopensVec[0], &PreopensVec[12], &PreopensVec[21], &PreopensVec[32], &PreopensVec[49]}; ...
[ "test/api/APIUnitTest.cpp" ]
[ { "comment": "You should call VMDelete and StoreDelete before the end of this scope.", "path": "test/api/APIUnitTest.cpp", "hunk": "@@ -3911,6 +3967,594 @@ TEST(APICoreTest, VM) {\n WasmEdge_VMDelete(VM);\n }\n \n+TEST(APICoreTest, VMDeleteRegistered) {\n+ WasmEdge_ConfigureContext *Conf = WasmEdge_C...
true
WasmEdge/WasmEdge
4,726
comment_to_fix
feat: implement module instance dependency tree in WASM store
You should call VMDelete and StoreDelete before the end of this scope.
01832097cb0b108ee280d0d0bcd2ee04459c644e
d43add2ef2038d516fbd29ee2d3c5722f63d9b2b
diff --git a/test/api/APIUnitTest.cpp b/test/api/APIUnitTest.cpp index a9ecec756528..fceae8b76a10 100644 --- a/test/api/APIUnitTest.cpp +++ b/test/api/APIUnitTest.cpp @@ -223,6 +223,59 @@ char *Preopens[] = {&PreopensVec[0], &PreopensVec[12], &PreopensVec[21], &PreopensVec[32], &PreopensVec[49]}; ...
[ "test/api/APIUnitTest.cpp" ]
[ { "comment": "You should call VMDelete and StoreDelete before the end of this scope.", "path": "test/api/APIUnitTest.cpp", "hunk": "@@ -3911,6 +3967,594 @@ TEST(APICoreTest, VM) {\n WasmEdge_VMDelete(VM);\n }\n \n+TEST(APICoreTest, VMDeleteRegistered) {\n+ WasmEdge_ConfigureContext *Conf = WasmEdge_C...
true
WasmEdge/WasmEdge
4,726
comment_to_fix
feat: implement module instance dependency tree in WASM store
You should call VMDelete and StoreDelete before the end of this scope.
01832097cb0b108ee280d0d0bcd2ee04459c644e
d43add2ef2038d516fbd29ee2d3c5722f63d9b2b
diff --git a/test/api/APIUnitTest.cpp b/test/api/APIUnitTest.cpp index a9ecec756528..fceae8b76a10 100644 --- a/test/api/APIUnitTest.cpp +++ b/test/api/APIUnitTest.cpp @@ -223,6 +223,59 @@ char *Preopens[] = {&PreopensVec[0], &PreopensVec[12], &PreopensVec[21], &PreopensVec[32], &PreopensVec[49]}; ...
[ "test/api/APIUnitTest.cpp" ]
[ { "comment": "You should call VMDelete and StoreDelete before the end of this scope.", "path": "test/api/APIUnitTest.cpp", "hunk": "@@ -3911,6 +3967,594 @@ TEST(APICoreTest, VM) {\n WasmEdge_VMDelete(VM);\n }\n \n+TEST(APICoreTest, VMDeleteRegistered) {\n+ WasmEdge_ConfigureContext *Conf = WasmEdge_C...
true
WasmEdge/WasmEdge
4,726
comment_to_fix
feat: implement module instance dependency tree in WASM store
You should call VMDelete and StoreDelete before the end of this scope.
01832097cb0b108ee280d0d0bcd2ee04459c644e
d43add2ef2038d516fbd29ee2d3c5722f63d9b2b
diff --git a/test/api/APIUnitTest.cpp b/test/api/APIUnitTest.cpp index a9ecec756528..fceae8b76a10 100644 --- a/test/api/APIUnitTest.cpp +++ b/test/api/APIUnitTest.cpp @@ -223,6 +223,59 @@ char *Preopens[] = {&PreopensVec[0], &PreopensVec[12], &PreopensVec[21], &PreopensVec[32], &PreopensVec[49]}; ...
[ "test/api/APIUnitTest.cpp" ]
[ { "comment": "You should call VMDelete and StoreDelete before the end of this scope.", "path": "test/api/APIUnitTest.cpp", "hunk": "@@ -3911,6 +3967,594 @@ TEST(APICoreTest, VM) {\n WasmEdge_VMDelete(VM);\n }\n \n+TEST(APICoreTest, VMDeleteRegistered) {\n+ WasmEdge_ConfigureContext *Conf = WasmEdge_C...
true
WasmEdge/WasmEdge
4,726
comment_to_fix
feat: implement module instance dependency tree in WASM store
Host function allocation should not be here. Please refer to the explaination of `WasmEdge_ModuleInstanceAddFunction` API. This API will move the ownership of host function object to the callee.
01832097cb0b108ee280d0d0bcd2ee04459c644e
d43add2ef2038d516fbd29ee2d3c5722f63d9b2b
diff --git a/test/api/APIUnitTest.cpp b/test/api/APIUnitTest.cpp index a9ecec756528..fceae8b76a10 100644 --- a/test/api/APIUnitTest.cpp +++ b/test/api/APIUnitTest.cpp @@ -223,6 +223,59 @@ char *Preopens[] = {&PreopensVec[0], &PreopensVec[12], &PreopensVec[21], &PreopensVec[32], &PreopensVec[49]}; ...
[ "test/api/APIUnitTest.cpp" ]
[ { "comment": "Host function allocation should not be here.\nPlease refer to the explaination of `WasmEdge_ModuleInstanceAddFunction` API. This API will move the ownership of host function object to the callee.", "path": "test/api/APIUnitTest.cpp", "hunk": "@@ -3911,6 +3967,594 @@ TEST(APICoreTest, VM) {...
true
WasmEdge/WasmEdge
4,726
comment_to_fix
feat: implement module instance dependency tree in WASM store
Host function allocation should not be here. Please refer to the explaination of WasmEdge_ModuleInstanceAddFunction API. This API will move the ownership of host function object to the callee.
01832097cb0b108ee280d0d0bcd2ee04459c644e
d43add2ef2038d516fbd29ee2d3c5722f63d9b2b
diff --git a/test/api/APIUnitTest.cpp b/test/api/APIUnitTest.cpp index a9ecec756528..fceae8b76a10 100644 --- a/test/api/APIUnitTest.cpp +++ b/test/api/APIUnitTest.cpp @@ -223,6 +223,59 @@ char *Preopens[] = {&PreopensVec[0], &PreopensVec[12], &PreopensVec[21], &PreopensVec[32], &PreopensVec[49]}; ...
[ "test/api/APIUnitTest.cpp" ]
[ { "comment": "Host function allocation should not be here.\nPlease refer to the explaination of WasmEdge_ModuleInstanceAddFunction API. This API will move the ownership of host function object to the callee.", "path": "test/api/APIUnitTest.cpp", "hunk": "@@ -3911,6 +3967,594 @@ TEST(APICoreTest, VM) {\n...
true
WasmEdge/WasmEdge
4,726
comment_to_fix
feat: implement module instance dependency tree in WASM store
As above.
01832097cb0b108ee280d0d0bcd2ee04459c644e
d43add2ef2038d516fbd29ee2d3c5722f63d9b2b
diff --git a/test/api/APIUnitTest.cpp b/test/api/APIUnitTest.cpp index a9ecec756528..fceae8b76a10 100644 --- a/test/api/APIUnitTest.cpp +++ b/test/api/APIUnitTest.cpp @@ -223,6 +223,59 @@ char *Preopens[] = {&PreopensVec[0], &PreopensVec[12], &PreopensVec[21], &PreopensVec[32], &PreopensVec[49]}; ...
[ "test/api/APIUnitTest.cpp" ]
[ { "comment": "As above.", "path": "test/api/APIUnitTest.cpp", "hunk": "@@ -3911,6 +3967,594 @@ TEST(APICoreTest, VM) {\n WasmEdge_VMDelete(VM);\n }\n \n+TEST(APICoreTest, VMDeleteRegistered) {\n+ WasmEdge_ConfigureContext *Conf = WasmEdge_ConfigureCreate();\n+ WasmEdge_ExecutorContext *Exec = WasmEd...
true
WasmEdge/WasmEdge
4,726
comment_to_fix
feat: implement module instance dependency tree in WASM store
I think the TEST() here is for the module deletion API. Why below uses VM?
01832097cb0b108ee280d0d0bcd2ee04459c644e
d43add2ef2038d516fbd29ee2d3c5722f63d9b2b
diff --git a/test/api/APIUnitTest.cpp b/test/api/APIUnitTest.cpp index a9ecec756528..fceae8b76a10 100644 --- a/test/api/APIUnitTest.cpp +++ b/test/api/APIUnitTest.cpp @@ -223,6 +223,59 @@ char *Preopens[] = {&PreopensVec[0], &PreopensVec[12], &PreopensVec[21], &PreopensVec[32], &PreopensVec[49]}; ...
[ "test/api/APIUnitTest.cpp" ]
[ { "comment": "I think the TEST() here is for the module deletion API. Why below uses VM?", "path": "test/api/APIUnitTest.cpp", "hunk": "@@ -3911,6 +3967,594 @@ TEST(APICoreTest, VM) {\n WasmEdge_VMDelete(VM);\n }\n \n+TEST(APICoreTest, VMDeleteRegistered) {\n+ WasmEdge_ConfigureContext *Conf = WasmEd...
true
WasmEdge/WasmEdge
4,726
comment_to_fix
feat: implement module instance dependency tree in WASM store
You've checked the `Cxt` not nullptr here, therefore can use `fromModCxt(Cxt)->terminate()` directly.
01832097cb0b108ee280d0d0bcd2ee04459c644e
d43add2ef2038d516fbd29ee2d3c5722f63d9b2b
diff --git a/lib/api/wasmedge.cpp b/lib/api/wasmedge.cpp index e1cee5d131ec..45d041447fa7 100644 --- a/lib/api/wasmedge.cpp +++ b/lib/api/wasmedge.cpp @@ -2665,7 +2665,10 @@ WASMEDGE_CAPI_EXPORT void WasmEdge_ModuleInstanceAddGlobal( WASMEDGE_CAPI_EXPORT void WasmEdge_ModuleInstanceDelete(WasmEdge_ModuleInstanceCon...
[ "lib/api/wasmedge.cpp" ]
[ { "comment": "You've checked the `Cxt` not nullptr here, therefore can use `fromModCxt(Cxt)->terminate()` directly.", "path": "lib/api/wasmedge.cpp", "hunk": "@@ -2665,7 +2665,12 @@ WASMEDGE_CAPI_EXPORT void WasmEdge_ModuleInstanceAddGlobal(\n \n WASMEDGE_CAPI_EXPORT void\n WasmEdge_ModuleInstanceDelete...
true
WasmEdge/WasmEdge
4,726
comment_to_fix
feat: implement module instance dependency tree in WASM store
`auto &StoreMgr`. The getter returns reference already, don't convert to pointer again.
01832097cb0b108ee280d0d0bcd2ee04459c644e
d43add2ef2038d516fbd29ee2d3c5722f63d9b2b
diff --git a/lib/api/wasmedge.cpp b/lib/api/wasmedge.cpp index e1cee5d131ec..45d041447fa7 100644 --- a/lib/api/wasmedge.cpp +++ b/lib/api/wasmedge.cpp @@ -2665,7 +2665,10 @@ WASMEDGE_CAPI_EXPORT void WasmEdge_ModuleInstanceAddGlobal( WASMEDGE_CAPI_EXPORT void WasmEdge_ModuleInstanceDelete(WasmEdge_ModuleInstanceCon...
[ "lib/api/wasmedge.cpp" ]
[ { "comment": "`auto &StoreMgr`. The getter returns reference already, don't convert to pointer again.", "path": "lib/api/wasmedge.cpp", "hunk": "@@ -3532,28 +3535,31 @@ WASMEDGE_CAPI_EXPORT void WasmEdge_VMCleanup(WasmEdge_VMContext *Cxt) noexcept {\n }\n }\n \n-void WasmEdge_VMForceDeleteRegisteredMo...
true
WasmEdge/WasmEdge
4,899
issue_to_patch
ci(dependabot): bump step-security/harden-runner from 2.19.3 to 2.19.4
Bumps [step-security/harden-runner](https://github.com/step-security/harden-runner) from 2.19.3 to 2.19.4. <details> <summary>Release notes</summary> <p><em>Sourced from <a href="https://github.com/step-security/harden-runner/releases">step-security/harden-runner's releases</a>.</em></p> <blockquote> <h2>v2.19.4</h2> <...
8a248a6dfc037be81c307cb635c9374344249ba2
bbbb2317d39bda8270694cae34c3a9bc102c92a0
diff --git a/.github/workflows/IWYU_scan.yml b/.github/workflows/IWYU_scan.yml index 07b154249926..2fbccd1a070e 100644 --- a/.github/workflows/IWYU_scan.yml +++ b/.github/workflows/IWYU_scan.yml @@ -44,7 +44,7 @@ jobs: version: ${{ steps.prep.outputs.version }} steps: - name: Harden the runner (Audit a...
[ ".github/workflows/IWYU_scan.yml", ".github/workflows/build-extensions.yml", ".github/workflows/build.yml", ".github/workflows/build_for_nix.yml", ".github/workflows/build_for_openwrt.yml", ".github/workflows/build_for_riscv.yml", ".github/workflows/build_for_s390x.yml", ".github/workflows/codeql-anal...
[]
true
WasmEdge/WasmEdge
4,723
issue_to_patch
LFX Workspace: Enable JIT mode support for per-function compilation ### Project Title Enable JIT mode support for per-function compilation ### Motivation WasmEdge’s JIT mode improves execution speed by compiling WebAssembly modules into native code before runtime. However, it compiles the entire module upfront, inc...
feat: implement per function compilation in jit
## Description Implemented the plan defined in https://github.com/WasmEdge/WasmEdge/issues/4693. - [x] Write more tests verifying robustness. (Added spec tests) ## Checklist Before submitting this PR, please ensure the following: - [x] **DCO Signed-off**: All commits are signed-off (`git commit -s`). CI w...
9d431499ab32e01ac19e61738eafa310f700d31e
67f93b5a08e799af47f68e08dba299c6a6dbc88d
diff --git a/cmake/Helper.cmake b/cmake/Helper.cmake index cf2df52c54eb..26c6e8fb6f3d 100644 --- a/cmake/Helper.cmake +++ b/cmake/Helper.cmake @@ -33,6 +33,7 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC") /wd4819 # file contains a character not in current code page /wd4127 # conditional expression is constant ...
[ "cmake/Helper.cmake", "include/ast/module.h", "include/common/enum.inc", "include/common/executable.h", "include/driver/tool.h", "include/executor/executor.h", "include/llvm/compiler.h", "include/llvm/data.h", "include/llvm/jit.h", "include/runtime/instance/function.h", "include/runtime/instance...
[ { "comment": "It seems you are using the `printf` debugging method; that's fine. However, I suggest adding a prefix to these messages, which will make it easier to clean up the debug messages when your PR is ready.", "path": "lib/llvm/compiler.cpp", "hunk": "@@ -3981,12 +3986,15 @@ class FunctionCompile...
diff --git a/test/llvm/CMakeLists.txt b/test/llvm/CMakeLists.txt index e9ec0b847de1..5ea30c71314d 100644 --- a/test/llvm/CMakeLists.txt +++ b/test/llvm/CMakeLists.txt @@ -12,3 +12,18 @@ target_link_libraries(wasmedgeLLVMCoreTests wasmedgeTestSpec wasmedgeVM ) + +wasmedge_add_executable(wasmedgeLazyJITTests + La...
true
WasmEdge/WasmEdge
4,723
comment_to_fix
feat: implement per function compilation in jit
It seems you are using the `printf` debugging method; that's fine. However, I suggest adding a prefix to these messages, which will make it easier to clean up the debug messages when your PR is ready.
9d431499ab32e01ac19e61738eafa310f700d31e
67f93b5a08e799af47f68e08dba299c6a6dbc88d
diff --git a/lib/llvm/compiler.cpp b/lib/llvm/compiler.cpp index 39da94d9a9ac..330e245f51c3 100644 --- a/lib/llvm/compiler.cpp +++ b/lib/llvm/compiler.cpp @@ -9,6 +9,7 @@ #include "common/spdlog.h" #include "data.h" #include "llvm.h" +#include "spdlog/spdlog.h" #include "system/allocator.h" #include <algorithm> ...
[ "lib/llvm/compiler.cpp" ]
[ { "comment": "It seems you are using the `printf` debugging method; that's fine. However, I suggest adding a prefix to these messages, which will make it easier to clean up the debug messages when your PR is ready.", "path": "lib/llvm/compiler.cpp", "hunk": "@@ -3981,12 +3986,15 @@ class FunctionCompile...
true
WasmEdge/WasmEdge
4,723
comment_to_fix
feat: implement per function compilation in jit
Since you are updating some important elements, this does not seem to be a thread-safe method. You should follow the same naming style for the function name to indicate this.
9d431499ab32e01ac19e61738eafa310f700d31e
67f93b5a08e799af47f68e08dba299c6a6dbc88d
diff --git a/lib/vm/vm.cpp b/lib/vm/vm.cpp index 680d35094656..cf594a8be374 100644 --- a/lib/vm/vm.cpp +++ b/lib/vm/vm.cpp @@ -3,7 +3,9 @@ #include "vm/vm.h" +#include "ast/instruction.h" #include "ast/module.h" +#include "common/enum_errcode.hpp" #include "common/errcode.h" #include "common/types.h" #include ...
[ "lib/vm/vm.cpp" ]
[ { "comment": "Since you are updating some important elements, this does not seem to be a thread-safe method. You should follow the same naming style for the function name to indicate this.", "path": "lib/vm/vm.cpp", "hunk": "@@ -703,5 +943,146 @@ const Runtime::Instance::ModuleInstance *VM::unsafeGetAct...
true
WasmEdge/WasmEdge
4,723
comment_to_fix
feat: implement per function compilation in jit
What's the reason for using the `void *` type here?
9d431499ab32e01ac19e61738eafa310f700d31e
67f93b5a08e799af47f68e08dba299c6a6dbc88d
diff --git a/include/llvm/jit.h b/include/llvm/jit.h index 480fa4e2a745..c15eb4a8dc82 100644 --- a/include/llvm/jit.h +++ b/include/llvm/jit.h @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// SPDX-FileCopyrightText: 2019-2024 Second State INC +// SPDX-FileCopyrightText: 2019-2026 Second State INC //===-- ...
[ "include/llvm/jit.h" ]
[ { "comment": "What's the reason for using the `void *` type here?", "path": "include/llvm/jit.h", "hunk": "@@ -33,18 +36,41 @@ class JITLibrary : public Executable {\n \n std::vector<Symbol<void>> getCodes(size_t Offset,\n size_t Size) noexcept override;\n+ bool i...
true
WasmEdge/WasmEdge
4,723
comment_to_fix
feat: implement per function compilation in jit
I am wondering if we can use `std::unique_ptr` or `std::shared_ptr<CompileContext>` instead of raw pointers in these places.
9d431499ab32e01ac19e61738eafa310f700d31e
67f93b5a08e799af47f68e08dba299c6a6dbc88d
diff --git a/lib/llvm/compiler.cpp b/lib/llvm/compiler.cpp index 39da94d9a9ac..330e245f51c3 100644 --- a/lib/llvm/compiler.cpp +++ b/lib/llvm/compiler.cpp @@ -9,6 +9,7 @@ #include "common/spdlog.h" #include "data.h" #include "llvm.h" +#include "spdlog/spdlog.h" #include "system/allocator.h" #include <algorithm> ...
[ "lib/llvm/compiler.cpp" ]
[ { "comment": "I am wondering if we can use `std::unique_ptr` or `std::shared_ptr<CompileContext>` instead of raw pointers in these places.", "path": "lib/llvm/compiler.cpp", "hunk": "@@ -6325,13 +6383,319 @@ Expect<void> Compiler::compile(const AST::FunctionSection &FuncSec,\n FunctionCompiler FC(*C...
true
WasmEdge/WasmEdge
4,723
comment_to_fix
feat: implement per function compilation in jit
Why use `static_cast` instead of `dynamic_cast` here?
9d431499ab32e01ac19e61738eafa310f700d31e
67f93b5a08e799af47f68e08dba299c6a6dbc88d
diff --git a/lib/llvm/jit.cpp b/lib/llvm/jit.cpp index 4bf3cc80386a..f0afb693f598 100644 --- a/lib/llvm/jit.cpp +++ b/lib/llvm/jit.cpp @@ -2,29 +2,96 @@ // SPDX-FileCopyrightText: 2019-2024 Second State INC #include "llvm/jit.h" -#include "common/spdlog.h" #include "data.h" #include "llvm.h" +#include "spdlog/s...
[ "lib/llvm/jit.cpp" ]
[ { "comment": "Why use `static_cast` instead of `dynamic_cast` here?", "path": "lib/llvm/jit.cpp", "hunk": "@@ -51,43 +52,65 @@ std::vector<Symbol<void>> JITLibrary::getCodes(size_t Offset,\n std::vector<Symbol<void>> Result;\n Result.reserve(Size);\n for (size_t I = 0; I < Size; ++I) {\n- const...
true
WasmEdge/WasmEdge
4,723
comment_to_fix
feat: implement per function compilation in jit
What is the reason for changing the `private:` section and adding `friend class` here?
9d431499ab32e01ac19e61738eafa310f700d31e
67f93b5a08e799af47f68e08dba299c6a6dbc88d
diff --git a/include/llvm/jit.h b/include/llvm/jit.h index 480fa4e2a745..c15eb4a8dc82 100644 --- a/include/llvm/jit.h +++ b/include/llvm/jit.h @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// SPDX-FileCopyrightText: 2019-2024 Second State INC +// SPDX-FileCopyrightText: 2019-2026 Second State INC //===-- ...
[ "include/llvm/jit.h" ]
[ { "comment": "What is the reason for changing the `private:` section and adding `friend class` here?", "path": "include/llvm/jit.h", "hunk": "@@ -33,18 +36,41 @@ class JITLibrary : public Executable {\n \n std::vector<Symbol<void>> getCodes(size_t Offset,\n size_t ...
true
WasmEdge/WasmEdge
4,723
comment_to_fix
feat: implement per function compilation in jit
It seems you copied and pasted these sections multiple times across functions. Why?
9d431499ab32e01ac19e61738eafa310f700d31e
67f93b5a08e799af47f68e08dba299c6a6dbc88d
diff --git a/lib/executor/engine/proxy.cpp b/lib/executor/engine/proxy.cpp index 8fba0a4f08db..819b78494515 100644 --- a/lib/executor/engine/proxy.cpp +++ b/lib/executor/engine/proxy.cpp @@ -107,6 +107,7 @@ const Executable::IntrinsicsTable Executor::Intrinsics = { ENTRY(kMemAtomicWait, proxyMemAtomicWait), E...
[ "lib/executor/engine/proxy.cpp" ]
[ { "comment": "It seems you copied and pasted these sections multiple times across functions. Why?", "path": "lib/executor/engine/proxy.cpp", "hunk": "@@ -123,6 +123,15 @@ Expect<void> Executor::proxyCall(Runtime::StackManager &StackMgr,\n const uint32_t FuncIdx, const Va...
true
WasmEdge/WasmEdge
4,723
comment_to_fix
feat: implement per function compilation in jit
What's the maximum possible value of `FuncInsts.size()` here? If this number is large, an O(n) algorithm will never be acceptable.
9d431499ab32e01ac19e61738eafa310f700d31e
67f93b5a08e799af47f68e08dba299c6a6dbc88d
diff --git a/include/runtime/instance/module.h b/include/runtime/instance/module.h index f35a34c20842..b36298df538a 100644 --- a/include/runtime/instance/module.h +++ b/include/runtime/instance/module.h @@ -37,6 +37,7 @@ #include <shared_mutex> #include <string> #include <type_traits> +#include <unordered_map> #inc...
[ "include/runtime/instance/module.h" ]
[ { "comment": "What's the maximum possible value of `FuncInsts.size()` here? \nIf this number is large, an O(n) algorithm will never be acceptable.", "path": "include/runtime/instance/module.h", "hunk": "@@ -228,6 +228,24 @@ class ModuleInstance {\n return std::forward<CallbackT>(CallBack)(ExpGlobal...
true
WasmEdge/WasmEdge
4,723
comment_to_fix
feat: implement per function compilation in jit
I don't think it's a good idea to have members with the `Pending` prefix. We should package them into a structure or class and create the corresponding member functions to handle the setters and getters.
9d431499ab32e01ac19e61738eafa310f700d31e
67f93b5a08e799af47f68e08dba299c6a6dbc88d
diff --git a/include/vm/vm.h b/include/vm/vm.h index 543a4c19712e..afa401415a0f 100644 --- a/include/vm/vm.h +++ b/include/vm/vm.h @@ -26,12 +26,20 @@ #include "runtime/instance/module.h" #include "runtime/storemgr.h" +#ifdef WASMEDGE_USE_LLVM +#include "llvm/compiler.h" +#include "llvm/data.h" +#include "llvm/jit....
[ "include/vm/vm.h" ]
[ { "comment": "I don't think it's a good idea to have members with the `Pending` prefix. We should package them into a structure or class and create the corresponding member functions to handle the setters and getters.", "path": "include/vm/vm.h", "hunk": "@@ -400,6 +403,35 @@ class VM {\n /// Referenc...
true
WasmEdge/WasmEdge
4,723
comment_to_fix
feat: implement per function compilation in jit
What is the reason for changing this definition?
9d431499ab32e01ac19e61738eafa310f700d31e
67f93b5a08e799af47f68e08dba299c6a6dbc88d
diff --git a/lib/llvm/compiler.cpp b/lib/llvm/compiler.cpp index 39da94d9a9ac..330e245f51c3 100644 --- a/lib/llvm/compiler.cpp +++ b/lib/llvm/compiler.cpp @@ -9,6 +9,7 @@ #include "common/spdlog.h" #include "data.h" #include "llvm.h" +#include "spdlog/spdlog.h" #include "system/allocator.h" #include <algorithm> ...
[ "lib/llvm/compiler.cpp" ]
[ { "comment": "What is the reason for changing this definition?", "path": "lib/llvm/compiler.cpp", "hunk": "@@ -127,7 +129,7 @@ static inline LLVMCodeGenOptLevel toLLVMCodeGenLevel(\n \n struct LLVM::Compiler::CompileContext {\n LLVM::Context LLContext;\n- LLVM::Module &LLModule;\n+ std::reference_wr...
true
WasmEdge/WasmEdge
4,723
comment_to_fix
feat: implement per function compilation in jit
Can you explain the mechanism you used for the `Prefix`?
9d431499ab32e01ac19e61738eafa310f700d31e
67f93b5a08e799af47f68e08dba299c6a6dbc88d
diff --git a/lib/llvm/compiler.cpp b/lib/llvm/compiler.cpp index 39da94d9a9ac..330e245f51c3 100644 --- a/lib/llvm/compiler.cpp +++ b/lib/llvm/compiler.cpp @@ -9,6 +9,7 @@ #include "common/spdlog.h" #include "data.h" #include "llvm.h" +#include "spdlog/spdlog.h" #include "system/allocator.h" #include <algorithm> ...
[ "lib/llvm/compiler.cpp" ]
[ { "comment": "Can you explain the mechanism you used for the `Prefix`?", "path": "lib/llvm/compiler.cpp", "hunk": "@@ -204,10 +206,11 @@ struct LLVM::Compiler::CompileContext {\n std::vector<LLVM::Type> MemoryAddrTypes;\n std::vector<LLVM::Type> TableAddrTypes;\n std::vector<LLVM::Type> Globals;\n...
true
WasmEdge/WasmEdge
4,723
comment_to_fix
feat: implement per function compilation in jit
I don't think this is correct. Here is the case: Lazy mode JIT is enabled, but the symbol doesn't exist before or after the compilation.
9d431499ab32e01ac19e61738eafa310f700d31e
67f93b5a08e799af47f68e08dba299c6a6dbc88d
diff --git a/lib/llvm/jit.cpp b/lib/llvm/jit.cpp index 4bf3cc80386a..f0afb693f598 100644 --- a/lib/llvm/jit.cpp +++ b/lib/llvm/jit.cpp @@ -2,29 +2,96 @@ // SPDX-FileCopyrightText: 2019-2024 Second State INC #include "llvm/jit.h" -#include "common/spdlog.h" #include "data.h" #include "llvm.h" +#include "spdlog/s...
[ "lib/llvm/jit.cpp" ]
[ { "comment": "I don't think this is correct. \nHere is the case: Lazy mode JIT is enabled, but the symbol doesn't exist before or after the compilation.", "path": "lib/llvm/jit.cpp", "hunk": "@@ -51,43 +52,65 @@ std::vector<Symbol<void>> JITLibrary::getCodes(size_t Offset,\n std::vector<Symbol<void>>...
true
WasmEdge/WasmEdge
4,723
comment_to_fix
feat: implement per function compilation in jit
These sections should be static after the first compilation. What is the reason that we have to recompile all of them each time?
9d431499ab32e01ac19e61738eafa310f700d31e
67f93b5a08e799af47f68e08dba299c6a6dbc88d
diff --git a/lib/llvm/compiler.cpp b/lib/llvm/compiler.cpp index 39da94d9a9ac..330e245f51c3 100644 --- a/lib/llvm/compiler.cpp +++ b/lib/llvm/compiler.cpp @@ -9,6 +9,7 @@ #include "common/spdlog.h" #include "data.h" #include "llvm.h" +#include "spdlog/spdlog.h" #include "system/allocator.h" #include <algorithm> ...
[ "lib/llvm/compiler.cpp" ]
[ { "comment": "These sections should be static after the first compilation. What is the reason that we have to recompile all of them each time?", "path": "lib/llvm/compiler.cpp", "hunk": "@@ -6325,13 +6383,310 @@ Expect<void> Compiler::compile(const AST::FunctionSection &FuncSec,\n FunctionCompiler F...
true
WasmEdge/WasmEdge
4,723
comment_to_fix
feat: implement per function compilation in jit
You will call this `checkLazyCompilation` somewhere, and your `LazyCompilationHandler` is using an `unsafe` function, `unsafeLazyCompileFunction`. How do you ensure the state is correctly managed during a multi-threading execution model?
9d431499ab32e01ac19e61738eafa310f700d31e
67f93b5a08e799af47f68e08dba299c6a6dbc88d
diff --git a/include/executor/executor.h b/include/executor/executor.h index c68eb2d8d81f..0002cff2f68c 100644 --- a/include/executor/executor.h +++ b/include/executor/executor.h @@ -202,6 +202,13 @@ class Executor { Expect<void> registerPostHostFunction(void *HostData, std::...
[ "include/executor/executor.h" ]
[ { "comment": "You will call this `checkLazyCompilation` somewhere, and your `LazyCompilationHandler` is using an `unsafe` function, `unsafeLazyCompileFunction`. How do you ensure the state is correctly managed during a multi-threading execution model?", "path": "include/executor/executor.h", "hunk": "@@...
true
WasmEdge/WasmEdge
4,723
comment_to_fix
feat: implement per function compilation in jit
Please explain why we will have a non-owning module and a series of owned modules.
9d431499ab32e01ac19e61738eafa310f700d31e
67f93b5a08e799af47f68e08dba299c6a6dbc88d
diff --git a/include/llvm/jit.h b/include/llvm/jit.h index 480fa4e2a745..c15eb4a8dc82 100644 --- a/include/llvm/jit.h +++ b/include/llvm/jit.h @@ -1,5 +1,5 @@ // SPDX-License-Identifier: Apache-2.0 -// SPDX-FileCopyrightText: 2019-2024 Second State INC +// SPDX-FileCopyrightText: 2019-2026 Second State INC //===-- ...
[ "include/llvm/jit.h" ]
[ { "comment": "Please explain why we will have a non-owning module and a series of owned modules.", "path": "include/llvm/jit.h", "hunk": "@@ -33,18 +37,44 @@ class JITLibrary : public Executable {\n \n std::vector<Symbol<void>> getCodes(size_t Offset,\n size_t Size...
true
WasmEdge/WasmEdge
4,723
comment_to_fix
feat: implement per function compilation in jit
Could you explain the design and logic inside the `unsafeLazyCompileFunction` function? It's strange that we check whether `ModuleInstance` is `nullptr` or `ModInst`, and then we set `ModuleInstance` to `ModInst` directly.
9d431499ab32e01ac19e61738eafa310f700d31e
67f93b5a08e799af47f68e08dba299c6a6dbc88d
diff --git a/lib/vm/vm.cpp b/lib/vm/vm.cpp index 680d35094656..cf594a8be374 100644 --- a/lib/vm/vm.cpp +++ b/lib/vm/vm.cpp @@ -3,7 +3,9 @@ #include "vm/vm.h" +#include "ast/instruction.h" #include "ast/module.h" +#include "common/enum_errcode.hpp" #include "common/errcode.h" #include "common/types.h" #include ...
[ "lib/vm/vm.cpp" ]
[ { "comment": "Could you explain the design and logic inside the `unsafeLazyCompileFunction` function? \nIt's strange that we check whether `ModuleInstance` is `nullptr` or `ModInst`, and then we set `ModuleInstance` to `ModInst` directly.", "path": "lib/vm/vm.cpp", "hunk": "@@ -714,5 +949,150 @@ const ...
true
WasmEdge/WasmEdge
4,723
comment_to_fix
feat: implement per function compilation in jit
Why is the `const_cast` required?
9d431499ab32e01ac19e61738eafa310f700d31e
67f93b5a08e799af47f68e08dba299c6a6dbc88d
diff --git a/lib/vm/vm.cpp b/lib/vm/vm.cpp index 680d35094656..cf594a8be374 100644 --- a/lib/vm/vm.cpp +++ b/lib/vm/vm.cpp @@ -3,7 +3,9 @@ #include "vm/vm.h" +#include "ast/instruction.h" #include "ast/module.h" +#include "common/enum_errcode.hpp" #include "common/errcode.h" #include "common/types.h" #include ...
[ "lib/vm/vm.cpp" ]
[ { "comment": "Why is the `const_cast` required?", "path": "lib/vm/vm.cpp", "hunk": "@@ -207,10 +243,101 @@ Expect<void> VM::unsafeRegisterModule(std::string_view Name,\n }\n // Validate module.\n EXPECTED_TRY(ValidatorEngine.validate(Module));\n+ spdlog::info(\"Module validated: {}\"sv, Module.ge...
true
WasmEdge/WasmEdge
4,723
comment_to_fix
feat: implement per function compilation in jit
I don't think this is valid; if the pointer returned by `Mod.get()` changes and some other module uses the same address, this `Prefix` will no longer be `unique`.
9d431499ab32e01ac19e61738eafa310f700d31e
67f93b5a08e799af47f68e08dba299c6a6dbc88d
diff --git a/lib/vm/vm.cpp b/lib/vm/vm.cpp index 680d35094656..cf594a8be374 100644 --- a/lib/vm/vm.cpp +++ b/lib/vm/vm.cpp @@ -3,7 +3,9 @@ #include "vm/vm.h" +#include "ast/instruction.h" #include "ast/module.h" +#include "common/enum_errcode.hpp" #include "common/errcode.h" #include "common/types.h" #include ...
[ "lib/vm/vm.cpp" ]
[ { "comment": "I don't think this is valid; if the pointer returned by `Mod.get()` changes and some other module uses the same address, this `Prefix` will no longer be `unique`.", "path": "lib/vm/vm.cpp", "hunk": "@@ -433,59 +560,147 @@ Expect<void> VM::unsafeInstantiate() {\n spdlog::error(ErrCode::...
true
WasmEdge/WasmEdge
4,723
comment_to_fix
feat: implement per function compilation in jit
This proxy of `return_call` eliminates the benefits of tail calls, which avoid growing the program stack.
9d431499ab32e01ac19e61738eafa310f700d31e
67f93b5a08e799af47f68e08dba299c6a6dbc88d
diff --git a/lib/executor/engine/proxy.cpp b/lib/executor/engine/proxy.cpp index 8fba0a4f08db..819b78494515 100644 --- a/lib/executor/engine/proxy.cpp +++ b/lib/executor/engine/proxy.cpp @@ -107,6 +107,7 @@ const Executable::IntrinsicsTable Executor::Intrinsics = { ENTRY(kMemAtomicWait, proxyMemAtomicWait), E...
[ "lib/executor/engine/proxy.cpp" ]
[ { "comment": "This proxy of `return_call` eliminates the benefits of tail calls, which avoid growing the program stack.", "path": "lib/executor/engine/proxy.cpp", "hunk": "@@ -143,6 +148,128 @@ Expect<void> Executor::proxyCall(Runtime::StackManager &StackMgr,\n return {};\n }\n \n+Expect<void> Executo...
true
WasmEdge/WasmEdge
4,723
comment_to_fix
feat: implement per function compilation in jit
Why do we need this?
9d431499ab32e01ac19e61738eafa310f700d31e
67f93b5a08e799af47f68e08dba299c6a6dbc88d
diff --git a/cmake/Helper.cmake b/cmake/Helper.cmake index cf2df52c54eb..26c6e8fb6f3d 100644 --- a/cmake/Helper.cmake +++ b/cmake/Helper.cmake @@ -33,6 +33,7 @@ if(CMAKE_CXX_COMPILER_ID MATCHES "MSVC") /wd4819 # file contains a character not in current code page /wd4127 # conditional expression is constant ...
[ "cmake/Helper.cmake" ]
[ { "comment": "Why do we need this?", "path": "cmake/Helper.cmake", "hunk": "@@ -33,6 +33,7 @@ if(CMAKE_CXX_COMPILER_ID MATCHES \"MSVC\")\n /wd4819 # file contains a character not in current code page\n /wd4127 # conditional expression is constant\n /wd4611 # interaction between '_setjmp' and...
true
WasmEdge/WasmEdge
4,723
comment_to_fix
feat: implement per function compilation in jit
This appears to be debug information. Remove it if it is no longer needed.
9d431499ab32e01ac19e61738eafa310f700d31e
67f93b5a08e799af47f68e08dba299c6a6dbc88d
diff --git a/lib/llvm/compiler.cpp b/lib/llvm/compiler.cpp index 39da94d9a9ac..330e245f51c3 100644 --- a/lib/llvm/compiler.cpp +++ b/lib/llvm/compiler.cpp @@ -9,6 +9,7 @@ #include "common/spdlog.h" #include "data.h" #include "llvm.h" +#include "spdlog/spdlog.h" #include "system/allocator.h" #include <algorithm> ...
[ "lib/llvm/compiler.cpp" ]
[ { "comment": "This appears to be debug information. Remove it if it is no longer needed.", "path": "lib/llvm/compiler.cpp", "hunk": "@@ -3998,12 +4003,15 @@ class FunctionCompiler {\n }\n void compileAtomicWait(unsigned MemoryIndex, uint64_t MemoryOffset,\n LLVM::Type Target...
true
WasmEdge/WasmEdge
4,723
comment_to_fix
feat: implement per function compilation in jit
This appears to be debug information. Remove it if it is no longer needed.
9d431499ab32e01ac19e61738eafa310f700d31e
67f93b5a08e799af47f68e08dba299c6a6dbc88d
diff --git a/lib/llvm/compiler.cpp b/lib/llvm/compiler.cpp index 39da94d9a9ac..330e245f51c3 100644 --- a/lib/llvm/compiler.cpp +++ b/lib/llvm/compiler.cpp @@ -9,6 +9,7 @@ #include "common/spdlog.h" #include "data.h" #include "llvm.h" +#include "spdlog/spdlog.h" #include "system/allocator.h" #include <algorithm> ...
[ "lib/llvm/compiler.cpp" ]
[ { "comment": "This appears to be debug information. Remove it if it is no longer needed.", "path": "lib/llvm/compiler.cpp", "hunk": "@@ -3998,12 +4003,15 @@ class FunctionCompiler {\n }\n void compileAtomicWait(unsigned MemoryIndex, uint64_t MemoryOffset,\n LLVM::Type Target...
true
WasmEdge/WasmEdge
4,723
comment_to_fix
feat: implement per function compilation in jit
Your error message may not contain enough information to identify the issue location; please follow the same procedure to handle the log.
9d431499ab32e01ac19e61738eafa310f700d31e
67f93b5a08e799af47f68e08dba299c6a6dbc88d
diff --git a/lib/llvm/jit.cpp b/lib/llvm/jit.cpp index 4bf3cc80386a..f0afb693f598 100644 --- a/lib/llvm/jit.cpp +++ b/lib/llvm/jit.cpp @@ -2,29 +2,96 @@ // SPDX-FileCopyrightText: 2019-2024 Second State INC #include "llvm/jit.h" -#include "common/spdlog.h" #include "data.h" #include "llvm.h" +#include "spdlog/s...
[ "lib/llvm/jit.cpp" ]
[ { "comment": "Your error message may not contain enough information to identify the issue location; please follow the same procedure to handle the log.", "path": "lib/llvm/jit.cpp", "hunk": "@@ -51,43 +125,144 @@ std::vector<Symbol<void>> JITLibrary::getCodes(size_t Offset,\n std::vector<Symbol<void>>...
true
WasmEdge/WasmEdge
4,723
comment_to_fix
feat: implement per function compilation in jit
I just want to confirm if the `Exec` must be `JITLibrary`. Using `static_cast` here is really strange.
9d431499ab32e01ac19e61738eafa310f700d31e
67f93b5a08e799af47f68e08dba299c6a6dbc88d
diff --git a/lib/llvm/jit.cpp b/lib/llvm/jit.cpp index 4bf3cc80386a..f0afb693f598 100644 --- a/lib/llvm/jit.cpp +++ b/lib/llvm/jit.cpp @@ -2,29 +2,96 @@ // SPDX-FileCopyrightText: 2019-2024 Second State INC #include "llvm/jit.h" -#include "common/spdlog.h" #include "data.h" #include "llvm.h" +#include "spdlog/s...
[ "lib/llvm/jit.cpp" ]
[ { "comment": "I just want to confirm if the `Exec` must be `JITLibrary`. Using `static_cast` here is really strange.", "path": "lib/llvm/jit.cpp", "hunk": "@@ -51,43 +125,144 @@ std::vector<Symbol<void>> JITLibrary::getCodes(size_t Offset,\n std::vector<Symbol<void>> Result;\n Result.reserve(Size);\...
true
WasmEdge/WasmEdge
4,723
comment_to_fix
feat: implement per function compilation in jit
Please confirm if this is the intended usage of the same `static_cast`.
9d431499ab32e01ac19e61738eafa310f700d31e
67f93b5a08e799af47f68e08dba299c6a6dbc88d
diff --git a/lib/llvm/jit.cpp b/lib/llvm/jit.cpp index 4bf3cc80386a..f0afb693f598 100644 --- a/lib/llvm/jit.cpp +++ b/lib/llvm/jit.cpp @@ -2,29 +2,96 @@ // SPDX-FileCopyrightText: 2019-2024 Second State INC #include "llvm/jit.h" -#include "common/spdlog.h" #include "data.h" #include "llvm.h" +#include "spdlog/s...
[ "lib/llvm/jit.cpp" ]
[ { "comment": "Please confirm if this is the intended usage of the same `static_cast`.", "path": "lib/llvm/jit.cpp", "hunk": "@@ -51,43 +125,144 @@ std::vector<Symbol<void>> JITLibrary::getCodes(size_t Offset,\n std::vector<Symbol<void>> Result;\n Result.reserve(Size);\n for (size_t I = 0; I < Size...
true
WasmEdge/WasmEdge
4,723
comment_to_fix
feat: implement per function compilation in jit
Once you use `static_cast`, this check will always be true, which means it does nothing.
9d431499ab32e01ac19e61738eafa310f700d31e
67f93b5a08e799af47f68e08dba299c6a6dbc88d
diff --git a/lib/llvm/jit.cpp b/lib/llvm/jit.cpp index 4bf3cc80386a..f0afb693f598 100644 --- a/lib/llvm/jit.cpp +++ b/lib/llvm/jit.cpp @@ -2,29 +2,96 @@ // SPDX-FileCopyrightText: 2019-2024 Second State INC #include "llvm/jit.h" -#include "common/spdlog.h" #include "data.h" #include "llvm.h" +#include "spdlog/s...
[ "lib/llvm/jit.cpp" ]
[ { "comment": "Once you use `static_cast`, this check will always be true, which means it does nothing.", "path": "lib/llvm/jit.cpp", "hunk": "@@ -51,43 +125,144 @@ std::vector<Symbol<void>> JITLibrary::getCodes(size_t Offset,\n std::vector<Symbol<void>> Result;\n Result.reserve(Size);\n for (size_...
true
WasmEdge/WasmEdge
4,723
comment_to_fix
feat: implement per function compilation in jit
This branch seems to be eager JIT. What's the reason that we need the LazyMutex and update the `Pending`?
9d431499ab32e01ac19e61738eafa310f700d31e
67f93b5a08e799af47f68e08dba299c6a6dbc88d
diff --git a/lib/vm/vm.cpp b/lib/vm/vm.cpp index 680d35094656..cf594a8be374 100644 --- a/lib/vm/vm.cpp +++ b/lib/vm/vm.cpp @@ -3,7 +3,9 @@ #include "vm/vm.h" +#include "ast/instruction.h" #include "ast/module.h" +#include "common/enum_errcode.hpp" #include "common/errcode.h" #include "common/types.h" #include ...
[ "lib/vm/vm.cpp" ]
[ { "comment": "This branch seems to be eager JIT.\nWhat's the reason that we need the LazyMutex and update the `Pending`?", "path": "lib/vm/vm.cpp", "hunk": "@@ -423,59 +607,150 @@ Expect<void> VM::unsafeInstantiate() {\n spdlog::error(ErrCode::Value::WrongVMWorkflow);\n return Unexpect(ErrCode::...
true
WasmEdge/WasmEdge
4,723
comment_to_fix
feat: implement per function compilation in jit
I am thinking about this chain. Since you are trying to have it in multiple places, it would be better to extract. How about creating a private struct and the helper functions like this? ```cpp struct LazyJITArtifacts { LLVM::Data LLData; std::unique_ptr<LLVM::Compiler::CompileContext, LLVM::Comp...
9d431499ab32e01ac19e61738eafa310f700d31e
67f93b5a08e799af47f68e08dba299c6a6dbc88d
diff --git a/lib/vm/vm.cpp b/lib/vm/vm.cpp index 680d35094656..cf594a8be374 100644 --- a/lib/vm/vm.cpp +++ b/lib/vm/vm.cpp @@ -3,7 +3,9 @@ #include "vm/vm.h" +#include "ast/instruction.h" #include "ast/module.h" +#include "common/enum_errcode.hpp" #include "common/errcode.h" #include "common/types.h" #include ...
[ "lib/vm/vm.cpp" ]
[ { "comment": "I am thinking about this chain.\nSince you are trying to have it in multiple places, it would be better to extract.\nHow about creating a private struct and the helper functions like this?\n\n```cpp\nstruct LazyJITArtifacts {\n LLVM::Data LLData;\n std::unique_ptr<LLVM::Compiler::CompileContext,...
true
WasmEdge/WasmEdge
4,723
comment_to_fix
feat: implement per function compilation in jit
If we introduce the above `LazyJITArtifacts`, we no longer need a global `Pending`. We can use the `LazyJITArtifacts` as a local variable to transit these data. Like this: ```cpp LazyJITArtifacts Artifacts; bool HasLazyArtifacts = false; if (lazy mode) { EXPECTED_TRY(Artifacts, runLazyJITPipeline(M...
9d431499ab32e01ac19e61738eafa310f700d31e
67f93b5a08e799af47f68e08dba299c6a6dbc88d
diff --git a/lib/vm/vm.cpp b/lib/vm/vm.cpp index 680d35094656..cf594a8be374 100644 --- a/lib/vm/vm.cpp +++ b/lib/vm/vm.cpp @@ -3,7 +3,9 @@ #include "vm/vm.h" +#include "ast/instruction.h" #include "ast/module.h" +#include "common/enum_errcode.hpp" #include "common/errcode.h" #include "common/types.h" #include ...
[ "lib/vm/vm.cpp" ]
[ { "comment": "If we introduce the above `LazyJITArtifacts`, we no longer need a global `Pending`. We can use the `LazyJITArtifacts` as a local variable to transit these data.\n\nLike this:\n\n```cpp\n LazyJITArtifacts Artifacts;\n bool HasLazyArtifacts = false;\n\n if (lazy mode) {\n EXPECTED_TRY(...
true
WasmEdge/WasmEdge
4,723
comment_to_fix
feat: implement per function compilation in jit
Why do we need to change this part?
9d431499ab32e01ac19e61738eafa310f700d31e
67f93b5a08e799af47f68e08dba299c6a6dbc88d
diff --git a/lib/vm/vm.cpp b/lib/vm/vm.cpp index 680d35094656..cf594a8be374 100644 --- a/lib/vm/vm.cpp +++ b/lib/vm/vm.cpp @@ -3,7 +3,9 @@ #include "vm/vm.h" +#include "ast/instruction.h" #include "ast/module.h" +#include "common/enum_errcode.hpp" #include "common/errcode.h" #include "common/types.h" #include ...
[ "lib/vm/vm.cpp" ]
[ { "comment": "Why do we need to change this part?", "path": "lib/vm/vm.cpp", "hunk": "@@ -207,10 +302,99 @@ Expect<void> VM::unsafeRegisterModule(std::string_view Name,\n }\n // Validate module.\n EXPECTED_TRY(ValidatorEngine.validate(Module));\n+ spdlog::info(\"Module validated: {}\"sv, Module.g...
true
WasmEdge/WasmEdge
4,723
comment_to_fix
feat: implement per function compilation in jit
The `RegModInsts` will never be empty due to the above line.
9d431499ab32e01ac19e61738eafa310f700d31e
67f93b5a08e799af47f68e08dba299c6a6dbc88d
diff --git a/lib/vm/vm.cpp b/lib/vm/vm.cpp index 680d35094656..cf594a8be374 100644 --- a/lib/vm/vm.cpp +++ b/lib/vm/vm.cpp @@ -3,7 +3,9 @@ #include "vm/vm.h" +#include "ast/instruction.h" #include "ast/module.h" +#include "common/enum_errcode.hpp" #include "common/errcode.h" #include "common/types.h" #include ...
[ "lib/vm/vm.cpp" ]
[ { "comment": "The `RegModInsts` will never be empty due to the above line.", "path": "lib/vm/vm.cpp", "hunk": "@@ -207,10 +302,99 @@ Expect<void> VM::unsafeRegisterModule(std::string_view Name,\n }\n // Validate module.\n EXPECTED_TRY(ValidatorEngine.validate(Module));\n+ spdlog::info(\"Module va...
true
WasmEdge/WasmEdge
4,723
comment_to_fix
feat: implement per function compilation in jit
I am thinking about the cleanup because we have a class called `RAIICleanup` in the `compile()` function for the entire module. Could we handle all related cleanup together with a unified function to ensure that the cleanup actually occurs?
9d431499ab32e01ac19e61738eafa310f700d31e
67f93b5a08e799af47f68e08dba299c6a6dbc88d
diff --git a/lib/llvm/compiler.cpp b/lib/llvm/compiler.cpp index 39da94d9a9ac..330e245f51c3 100644 --- a/lib/llvm/compiler.cpp +++ b/lib/llvm/compiler.cpp @@ -9,6 +9,7 @@ #include "common/spdlog.h" #include "data.h" #include "llvm.h" +#include "spdlog/spdlog.h" #include "system/allocator.h" #include <algorithm> ...
[ "lib/llvm/compiler.cpp" ]
[ { "comment": "I am thinking about the cleanup because we have a class called `RAIICleanup` in the `compile()` function for the entire module. Could we handle all related cleanup together with a unified function to ensure that the cleanup actually occurs?", "path": "lib/llvm/compiler.cpp", "hunk": "@@ -6...
true
WasmEdge/WasmEdge
4,723
comment_to_fix
feat: implement per function compilation in jit
It seems like you don't call the `LLModule.verify()` inside `compileInfrastructure`?
9d431499ab32e01ac19e61738eafa310f700d31e
67f93b5a08e799af47f68e08dba299c6a6dbc88d
diff --git a/lib/llvm/compiler.cpp b/lib/llvm/compiler.cpp index 39da94d9a9ac..330e245f51c3 100644 --- a/lib/llvm/compiler.cpp +++ b/lib/llvm/compiler.cpp @@ -9,6 +9,7 @@ #include "common/spdlog.h" #include "data.h" #include "llvm.h" +#include "spdlog/spdlog.h" #include "system/allocator.h" #include <algorithm> ...
[ "lib/llvm/compiler.cpp" ]
[ { "comment": "It seems like you don't call the `LLModule.verify()` inside `compileInfrastructure`?", "path": "lib/llvm/compiler.cpp", "hunk": "@@ -6342,13 +6498,255 @@ Expect<void> Compiler::compile(const AST::FunctionSection &FuncSec,\n FunctionCompiler FC(*Context, F, Locals,\n ...
true
WasmEdge/WasmEdge
4,723
comment_to_fix
feat: implement per function compilation in jit
You forgot the `#ifdef WASMEDGE_USE_LLVM`.
9d431499ab32e01ac19e61738eafa310f700d31e
67f93b5a08e799af47f68e08dba299c6a6dbc88d
diff --git a/include/vm/vm.h b/include/vm/vm.h index 543a4c19712e..afa401415a0f 100644 --- a/include/vm/vm.h +++ b/include/vm/vm.h @@ -26,12 +26,20 @@ #include "runtime/instance/module.h" #include "runtime/storemgr.h" +#ifdef WASMEDGE_USE_LLVM +#include "llvm/compiler.h" +#include "llvm/data.h" +#include "llvm/jit....
[ "include/vm/vm.h" ]
[ { "comment": "You forgot the `#ifdef WASMEDGE_USE_LLVM`.", "path": "include/vm/vm.h", "hunk": "@@ -25,16 +25,25 @@\n \n #include \"runtime/instance/module.h\"\n #include \"runtime/storemgr.h\"\n+#include \"llvm/compiler.h\"\n+#include \"llvm/data.h\"\n+#include \"llvm/jit.h\"", "resolving_sha": "67f...
true
WasmEdge/WasmEdge
4,723
comment_to_fix
feat: implement per function compilation in jit
Could you please explain why we need to use `recursive_mutex` instead of `mutex`? Could you compile with `-fsanitize=thread -fno-omit-frame-pointer` and provide a test case where `mutex` must not work?
9d431499ab32e01ac19e61738eafa310f700d31e
67f93b5a08e799af47f68e08dba299c6a6dbc88d
diff --git a/include/vm/vm.h b/include/vm/vm.h index 543a4c19712e..afa401415a0f 100644 --- a/include/vm/vm.h +++ b/include/vm/vm.h @@ -26,12 +26,20 @@ #include "runtime/instance/module.h" #include "runtime/storemgr.h" +#ifdef WASMEDGE_USE_LLVM +#include "llvm/compiler.h" +#include "llvm/data.h" +#include "llvm/jit....
[ "include/vm/vm.h" ]
[ { "comment": "Could you please explain why we need to use `recursive_mutex` instead of `mutex`? \nCould you compile with `-fsanitize=thread -fno-omit-frame-pointer` and provide a test case where `mutex` must not work?", "path": "include/vm/vm.h", "hunk": "@@ -373,6 +382,7 @@ class VM {\n Statistics::...
true
WasmEdge/WasmEdge
4,723
comment_to_fix
feat: implement per function compilation in jit
You only verified the results, which means we don't know if it's lazy or eager. We should also rely on some real metrics for the verification.
9d431499ab32e01ac19e61738eafa310f700d31e
67f93b5a08e799af47f68e08dba299c6a6dbc88d
diff --git a/test/llvm/LazyJITTest.cpp b/test/llvm/LazyJITTest.cpp new file mode 100644 index 000000000000..2d36b436039c --- /dev/null +++ b/test/llvm/LazyJITTest.cpp @@ -0,0 +1,784 @@ +// SPDX-License-Identifier: Apache-2.0 +// SPDX-FileCopyrightText: 2019-2026 Second State INC + +//===-- test/llvm/LazyJITTest.cpp - L...
[ "test/llvm/LazyJITTest.cpp" ]
[ { "comment": "You only verified the results, which means we don't know if it's lazy or eager. We should also rely on some real metrics for the verification.", "path": "test/llvm/LazyJITTest.cpp", "hunk": "@@ -0,0 +1,435 @@\n+// SPDX-License-Identifier: Apache-2.0\n+// SPDX-FileCopyrightText: 2019-2024 S...
true