-
Notifications
You must be signed in to change notification settings - Fork 24
Serialize side table and integrate verify
#758
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
Conversation
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.
Thanks! I think the issues come from the fact that the side-table format is not correct yet.
edd20af
to
0e701b9
Compare
Now that |
I've pushed a commit for that (called |
source.parser == target.parser | ||
&& source.result == target.result | ||
&& source.branch_table == target.branch_table | ||
&& source.stack <= target.stack, |
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.
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.
Update: we can store pop_cnt
as Option<usize>
in SideTableBranch
. WDYT?
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.
I'll need to look into this when I get time. I think the whole situation around pop_cnt feels wrong, but maybe I'm missing something. I've added some TODOs to not lose track of this. This should not block this PR.
The only test that fails in the test suite now is the huge br_table because of "index of MetadataEntry overflow" (the index is 97252). Do we want to change it to u32? I suspect the error in |
verify
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.
Thanks! That's a huge step, but I'm not convinced about the pop_cnt story yet. I'll need to look into it. Ideally we should do some differential fuzzing, I don't trust the test suite to provide good coverage.
crates/interpreter/src/module.rs
Outdated
let mut parser = unsafe { Parser::new(self.binary) }; | ||
parser.parse_side_table().unwrap(); |
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.
This is costly. I'm pushing an optimize Module::func()
commit to fix it. The idea is to have self.binary
start at the same place as module_start
in Context::check_module()
.
source.parser == target.parser | ||
&& source.result == target.result | ||
&& source.branch_table == target.branch_table | ||
&& source.stack <= target.stack, |
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.
I'll need to look into this when I get time. I think the whole situation around pop_cnt feels wrong, but maybe I'm missing something. I've added some TODOs to not lose track of this. This should not block this PR.
I'm not sure we want to support such corner-cases. For now I'm ignoring all 149 tests in If hwci is still failing, I'll take a look and work around it to merge. It might be because of the pop_cnt story which might be wrong and is not caught by the test suite. |
Yes, hwci is still failing, I'm disabling it in this branch. |
c62d1cd
to
911b5ae
Compare
// TODO(dev/fast-interp): Figure out why we can't simply source.stack - target.stack and | ||
// document it. |
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.
@ia0 I thought we shouldn't always expect source.stack
to be >= target.stack
. One example is the as-if-cond in br_if.wast
. In pop_cnt()
for Else
, we have source=SideTableBranch { parser: [65, 2, 5, 65, 3, 11, 11, 11], branch_table: 1, stack: 0, result: 0 }, target=SideTableBranch { parser: [65, 3, 11, 11, 11], branch_table: 3, stack: 1, result: 1 }
.
I had checked
|
#46