-
Notifications
You must be signed in to change notification settings - Fork 286
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Resumable Function Calls #598
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This initial commit introduces the initial API surface and design of the resumable calls API for the new `wasmi` engine. The implementation of the underlying resumable calls has not yet been done but should be fairly straight forward with the existing design.
BENCHMARKS
|
Codecov Report
@@ Coverage Diff @@
## master #598 +/- ##
==========================================
+ Coverage 80.73% 81.00% +0.26%
==========================================
Files 80 82 +2
Lines 6448 6628 +180
==========================================
+ Hits 5206 5369 +163
- Misses 1242 1259 +17
📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more |
The host_func API is more powerful, yet decreases the size of the ResumableInvocation type.
This naive implementation introduces a lot of duplicated code in the engine that needs to be resolved before we merge this PR.
This is important to allow to resume the execution by simply popping the pushed frame again.
I forgot this API already existed ... well ...
Robbepop
added a commit
that referenced
this pull request
Jan 3, 2023
refactor FuncType verification Carved out from PR #598.
EngineResources is a field in EngineExecutor and therefore does no longer need to be passed.
This experimental commit deduplicates logic between resumable and non-resumable calls in the Engine implementation. This is experimental as this might regress performance of non-resumable calls which would be pretty bad.
Using new led to panics at runtime since new constructor checks its inputs which we do not want or need in this particular instance.
The bug was that host function inputs were not properly dropped from the stack before feeding in the arguments that were supposed to replace the missing host results due to host trapping instead. Therefore the stack was getting bigger and bigger with every resumption.
We simply use the provided ctx parameter with which it is also possible to query the engine.
This name fits better since on the surface it has nothing to do with resumable functions. However, tagging the origin of the trap is important for resumable calls.
It is incorrect since host functions are technically able to return Wasm trap codes.
Notifying users that this API is non standard and might not be available in other Wasm engines.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #537.
ToDo
EngineExecutor::resume_func
.