-
Notifications
You must be signed in to change notification settings - Fork 425
Add abstract serializer mode for test262 execution #2297
Add abstract serializer mode for test262 execution #2297
Conversation
I think this is to be somewhat expected, minus the You're hitting to many I'd be interested to also know what test failures from the 104 tests are because of bad output – which is the worst possible case IMO. Are those tests failing currently on master without the transform too? If they are not, we should focus our efforts on those first, as those will be blockers soon enough. |
All built-in methods basically have to be made compatible, one-by-one since they're implemented in "native Prepack". All the ones (except the invariant) you posted are that. The pure scope mode is good for any built-in method because it basically allow it to fallback to leaving the call in place (see CallExpression). You could enable only that part of the pure scope mechanism. However, it would be interesting to see what errors you get if you enable only the call expression fallback for NativeFunctionValue. That will find gaps outside built-in methods. |
I played around a bit trying to fix some of the high firing Prepack errors to get better coverage. I got to a 31% pass rate just by fixing
New output. Now with error messages! Other things I tried:
I’d like to get this merged. It’s not perfect, but I plan to keep iterating. I’m going to move on from trying to understand where failings are in the suite and try to fix as many issues as possible with this rough prioritization scheme:
I’m worried that invariants and fatal errors are hiding errors in the 1 category, so I might bounce around between these categories to uncover more issues in 1. |
…t262-abstract-serializer-mode # Conflicts: # src/methods/to.js
Please can you pull out your |
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 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.
calebmer is landing this pull request. If you are a Facebook employee, you can view this diff on Phabricator.
I extended the
--serializer
command line argument I added in #2290 to now support--serializer abstract-scalar
. What this mode does is it converts all boolean, string, number, and symbol literals into abstract values. I did not choose to extend this logic to object and array literals just yet since scalars alone showed some interesting results.What I really want here is a review of the results.
Full suite execution results are real bad. 18% pass rate. I dug a bit into why.
I was mostly interested in the runtime failures we see since that means Prepack is serializing invalid code. However, I found ~14k failures in the Prepack stage (more on this in a bit) and ~3k failures in the runtime stage. This means ~80% of tests fail to compile with this abstract transformation applied.
Why are these tests failing? I took the first 4 items of the stack traces from errors thrown in the Prepack stage, sorted, and ranked them. Here’s the result. The top 5 with thousands of hits are:
This means there may be some low hanging fruit.
Questions
Here are my questions for you.
It’s also possible that something in my methodology is wrong, but I didn’t spend much time investigating these failures as I spent investigating the failures I found in #2290.
My goal with this test suite is to build an understanding of what “correctness” for the React Compiler against all JavaScript code looks like. (Not just the few bundles we’ve selected to look at.) I don’t think these results suggest that we only safely compile 18% of the language, but it’s a data point. I’ll be looking into fixing a selection of these issues to better understand their nature or if I need to change methodologies.