Skip to content
This repository has been archived by the owner on Feb 12, 2022. It is now read-only.

Clean up implication logic and do more caching #2530

Closed
wants to merge 2 commits into from
Closed

Conversation

hermanventer
Copy link
Contributor

@hermanventer hermanventer commented Sep 5, 2018

Release note: none

This attempts to reduce exponential blowup in the simplifier by doing more caching while computing implications and by imposing a depth limit on the number of simplify and implies calls.

It also tries to make implies and impliesNot more symmetrical, so that things are less ad-hoc.

@hermanventer hermanventer added the WIP This pull request is a work in progress and not ready for merging. label Sep 5, 2018
@trueadm
Copy link
Contributor

trueadm commented Sep 5, 2018

Looking good so far! The internal React www bundle passes and we actually inline 25% more nodes, which is very impressive (at the cost of 25% more code). However, the internal React Native bundle still seems to hang with this PR.

As you probably already see, the serializer tests seem to time out on CI with conditions2.js test. Locally, LoopBailout18.js also takes forever, except Node runs out of system memory before the test completes.

@hermanventer hermanventer changed the title Limit depth of simplifier attempts and clean up implication logic. Clean up implication logic and do more caching Sep 5, 2018
Copy link

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hermanventer has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

Copy link

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hermanventer has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

Copy link

@facebook-github-bot facebook-github-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hermanventer has imported this pull request. If you are a Facebook employee, you can view this diff on Phabricator.

@@ -103,30 +175,31 @@ export class PathConditionsImplementation extends PathConditions {
this._baseConditions = undefined;
for (let assumedCondition of savedBaseConditions._assumedConditions) {
if (assumedCondition.kind === "||") {
if (++total > 4) break;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How about making these things configurable?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Eventually.

@@ -1,6 +1,6 @@
function fn(x) {
for (
var _iterator = x.items,
var _iterator = x.entries(),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this change in an existing test?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just noticed that the test is actually broken and the intent is very clearly x.entries().

Copy link
Contributor

@NTillmann NTillmann left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@hermanventer hermanventer removed the WIP This pull request is a work in progress and not ready for merging. label Sep 6, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants