Skip to content
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

DFA: two phase DFA #4967

Draft
wants to merge 78 commits into
base: main
Choose a base branch
from
Draft

DFA: two phase DFA #4967

wants to merge 78 commits into from

Conversation

fridis
Copy link
Member

@fridis fridis commented Mar 24, 2025

First phase determines possibly available and possible required effects.

Second phase performs full DFA using the intersection of available and required effects as effect environments.

fridis added 30 commits December 4, 2024 13:35
- For certain clazzes, do not create ValueSet but, in case of a set, use one
  global set for all sets.

- For cetain clazzes, do not create separate Instances depending on context, but
  create only one single instance

- Do not create ValueSets of RefValue of the same clazz, but instead create
  RefValue of ValueSet, i.e., instead of

    {boxed(v1), boxed(v2)}

  create

    boxed({v1,v2})

All these can be enabled by static fields in DFA

  static boolean ONLY_ONE_VALUE_SET = false;
  static boolean ONLY_ONE_INSTANCE  = false;
  static boolean NO_SET_OF_REFS     = false;
_universe is used only to hold fields of the universe.
First time I see HelloWorld <800ms
Many calls used to be created due to many different environments, even if
effects form those different environments were never used.

For a simle HelloWorld, this redecues the number of calls form 965 to 546. I
expect a higher reduction for larger examples.
This currently results in endless runtime of DFA due to changes to
`Sequence.concat`.
There are two possible traces at this point.
This should collapse environments that are essentially redundant for the desired call context.

One big caveat: Recursive creation and instation of effects requires special handling to avoid endless recursion .
fridis added 30 commits April 1, 2025 17:30
Then, there is no need for `call.adjustThisTypeForTaget`.
Also removed `try / catch` added for debugging.
…type

Also enable a previously commented-out test case that did not work due to this.
If a type constraint uses type parameters itself and those are defined by the
target of a call, we need to first determine the actual types of the constraints
in this call before we can check the validity of the actual type parameters
provided by the call.

Added a check that `AbstractType.genericsAssignable` does not deal with open
type parameters unless in a cotype (which should be fixed later).

Also added a reference to #5002 in the correspdonging comment.
This simplifies the DFA since now the constructor of `instate_helper` requires
all the effects of call called code, so the instance of `instate_helper`
automatically gets replicated during DFA for different effect environments.
Having this declared in `container` avoid explosion of `array_cons` instances
during DFA due to different outer clazzes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant