-
Notifications
You must be signed in to change notification settings - Fork 3.4k
Skip all validation when 'no-validation' pass is specified #15128
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
base: main
Are you sure you want to change the base?
Skip all validation when 'no-validation' pass is specified #15128
Conversation
extras = settings.BINARYEN_EXTRA_PASSES.split(',') | ||
# we support both '-'-prefixed and unprefixed pass names | ||
if '--no-validation' in extras or 'no-validation' in extras: | ||
cmd += ['--no-validation'] |
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.
Is this a the right place to put --no-validation
.. its BINARYEN_EXTRA_PASSES is, up until now, something the only effects the running of wasm-opt
.
Perhaps a new -s NO_VALIDATE
setting would make more sense?
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.
Currently, BINARYEN_EXTRA_PASSES is a single possible place to use --no-validation.
Default settings require my action:
struct PassOptions {
...
// Whether to run the validator to check for errors.
bool validate = true;
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 noticed that we already have BINARYEN_FEATURES
which is almost what we want here, except that it is an internal setting atm. If we moved that from src/settings_internal.js
to src/settings.js
then this would work.
The name is because it is used to pass around features primarily, but nothing prevents other things from being there like --no-validation
. Perhaps we should rename it though to BINARYEN_FLAGS
?
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've be OK with adding BINARYEN_FLAGS
assuming we can show this is really needed. I think in order to make it work while we would need to show a significant amount of the link time could be saved by adding --no-validation
.
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.
(My preferred option would be will be to modify BINARYEN_PASS_DEBUG
to have a mode that didn't slow things down quite as much since that is that what is specifically needed here).
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 hope to finish tests for next weekends. Then things can come clear.
Can you explain why you don't want validation ? Is the module you are creating actual invalid from a binaryen POV? |
Ah.. I just read some more of the discussion in WebAssembly/binaryen#4167, It sounds like the issue is with the way |
Will follow up on the binaryen issue. |
I just need better logging of current action to guess a cause of out of memory crash on CI. In #14174 I showed that validation is times longer than most real passes. |
imho CI has some bugs also. For example, on Windows machine I can't link:
while
works fine for current directory. |
What CI system are you refering too? What kind of windows machines / virtualization environment does it use? The error you are seeing looks like a very low level error from llvm trying to map a file into memory.
In that issue @kripken mentions that validation is only costly when |
Without |
BTW we do have tool called |
Now I use magic
Ok, I passed all tests ✔️ |
This issue has been automatically marked as stale because there has been no activity in the past year. It will be closed automatically if no further activity occurs in the next 30 days. Feel free to re-open at any time if this issue is still relevant. |
Discussion in WebAssembly/binaryen#4167
Before:
After:
Adds test
other.test_binaryen_passes_no_validation