mirror of
https://github.com/facebookarchive/prepack.git
synced 2024-09-11 14:46:37 +03:00
108dea533b
Summary:
I want to better understand the bugs we have in abstract evaluation. One of my ideas to do this is to replace all the literals in test262 tests with abstract values and see what our test coverage is. The first step to do this is to serialize the test262 sources after running them in Prepack and checking if their generated JavaScript runs correctly. This PR does that by adding a `--serializer` flag.
With my methodology, all test262 harnesses are serialized every time since they are in the global scope. This unfortunately seems to be unavoidable since doing otherwise would change program semantics and break the tests.
Running `time yarn test-test262` takes about 2 minutes and has a 98% pass rate. Running `time yarn test-test262 --serializer` takes about 5 minutes and has a 95% pass rate. [Here’s a diff of the two results.](https://gist.github.com/calebmer/1c9fe396b63ba055458c599c2be18a58)
[Here is a selection of some of the bugs](https://gist.github.com/calebmer/1ac381096a4aa7be1fc7dc2163276ab4) in the serializer caught by running test262 with the Prepack serializer. I might open issues for these, but they can be a bit pedantic. I might fix some of them depending on how important they are to the React code we want to compile.
Notably we have:
- Lots of invariants being triggered. I particularly saw [a lot of this invariant](
|
||
---|---|---|
.. | ||
debug-fb-www.js | ||
detect_bad_deps.js | ||
generate-sourcemaps-test.js | ||
instrumentor.js | ||
lint-config.js | ||
multi-runner.js | ||
prettier.js | ||
publish-gh-pages.sh | ||
test262-filters.yml | ||
test262-runner.js | ||
test262.js | ||
test-error-handler.js | ||
test-internal-react.js | ||
test-internal.js | ||
test-residual.js | ||
test-runner.js | ||
test-sourcemaps.sh | ||
test-std-in.sh |