-
Notifications
You must be signed in to change notification settings - Fork 4
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
WASM Specification Testsuite #32
Conversation
7027baf
to
c30355d
Compare
c30355d
to
36c65b6
Compare
I've had a second shot at the spec testsuite. I've built this attempt on top of #54. As it stands, this works with the notable mention that only the I've kept thinking if I should modify the verification to "skip" functions with invalid op codes, making us able to test at least the functioning functions/op codes. However, this feature will be made pointless in the (far) future when we have all the op codes we are interested in implementing. The actual output of the reports is ugly: spec_log.txt. I will be looking for a generic tool to be able to show this off in a browser, especially with line-by-line errors being shown in files. |
369a259
to
28fefdd
Compare
Codecov ReportAttention: Patch coverage is
|
97e53d8
to
752992c
Compare
I've spend some time to refactor this so that working on it in the future won't be a nightmare. Still not perfect, but good enough imho. The magic question of how we want to integrate this into code coverage still remains. I've locked the testsuite behind a feature flag (because running it takes a bit of time) but it's not yet integrated into the coverage report procedures. @wucke13 I think we should collaborate on this issue, I'll need your help ^-^ There is still much left to be done. Part of it is we have to implement some base features (e.g. importing/exporting, the fuel mechanic for One quick observation: there is a And one more final issue: representation of output. For now, the program prints a detailed report to stdout. Here's a snippet:
If we do find a tool that can help represent this type of information somewhat more visually, I am more than happy to mold this output into something that can be understood by said tool. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There are some things that I'm not 100% sure about, but nothing that would lead me to delay this any further to be merged!
44b0096
to
e44f285
Compare
Signed-off-by: George Cosma <[email protected]>
fc23809
to
7354825
Compare
Alright, I tackled most issues. The reason why the Requirement Preview deployment fails is because it is trying to make a push from outside this repo (from my |
7354825
to
8da37f8
Compare
Signed-off-by: George Cosma <[email protected]>
8da37f8
to
3c82414
Compare
I'm gonna go ahead and resolve the last conversation. This should be ready to merge then? |
Yep, should be ready |
Pull Request Overview
This pull request adds the necessary bits of code to be able the interpret the
.wast
files present in the WASM Specification Testsuite. Core code has also been modified so that interpretation of thewast
directives is possible.Note: parsing of the
.wast
files is done by the crate with the same name.TODO or Help Wanted
This pull request is still very much work-in-progress.
One of the main issues I would like to discuss is if the code changes to the validation & execution part of our interpreter could cause an issue. To be more precise, to be able to invoke any function, the parameters and results of the function must implement the trait
InteropValueList
. However, afterwast
parsing I end up with the typeswast::WastArg
andwast::WastRet
which are the equivelent to ourValue
enum. The trait is impossible to implement for a vector of any of these two types because the wasm types are unknown at compile-time. For each variation of(Argument Types, Return Types)
a newinvoke_func
is created. However, since these arguments are read at runtime, there is no way to assign a constant value to theTYS
"paramater" of theInteropValueList
.The
TYS
constant is used ininvoke_func
to verify (at runtime) if the called wasm function takes the same parameters and emits the same results as the parameters forinvoke_func
. Switching the check for the parameters from a constant to a function was trivial for the parameters and (likely?) has the same effect. However, the verification for the result types had to be removed. Instead of removing it, an alternative would have been to pass all expected return types as an argument, but I had issues with this. This inherently makes the interpreter less safe.I've gated these changes behind a feature flag, but that brings me to the core of my problem: if i gate these changes behind a feature flag, then the binary tested with the
.wast
files is different from that which will be released. This means that a bug in the release version could be missed, as it is not checked for/it doesn't happen in the version meant for the specification test.I would like to hear your opinion on this, especially since the change I have described above is (probably) not the only one I will have to make in order to get
.wast
files working.Formatting
cargo fmt
cargo check
cargo build
nix fmt
treefmt
Github Issue
This pull request is linked to #9
Author
Signed-off-by: George Cosma [email protected]