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

Incremental Statix #108

Merged
merged 10 commits into from
Feb 6, 2023
Merged

Incremental Statix #108

merged 10 commits into from
Feb 6, 2023

Conversation

AZWN
Copy link
Contributor

@AZWN AZWN commented Jan 28, 2022

This PR enables using Statix with different solver modes. The changes are as follows:

  • A statix-solver-mode = traditional | concurrent | incremental option is added to the constraint-analyzer section of the CFG language.
  • When compiling a language, its AnalyzeMulti task will have the solver mode integrated in its StatixProjectConfig context object.
  • The replicated primitives StatixSolverModePrimitive and StatixConcurrentEnabledPrimitive read this solver mode. They receive the language identifier by calling the language_components stratego primitive (implemented by spoofax2.common).

As the ConstraintAnalyzerContext already manages the state, and provides the previous result to the constraint analyzer, no additional effort needs to be undertaken to manage (serialize) previous solver states.

Items still to do:

Add generated `Spoofax2ProjectContext` to allow:
- The `current-language-relative-source-or-include-path` (used in statix runtime) to work.
- Resolution of libraries.
@AZWN AZWN requested a review from Gohla January 28, 2022 17:20
@AZWN
Copy link
Contributor Author

AZWN commented Jan 28, 2022

It is worth mentioning that there will be an innocent stacktrace in the console when there is no lib/stxlibs file. It is completely safe that these files do not exist, the (warning-level) logging is just a bit aggressive. I'd be happy to take any suggestions to solve this, but I'd rather not touch the statix runtime itself for this too much.

@MeAmAnUsername
Copy link

Does this mean that the Statix solver can be either concurrent or incremental but not both? Ideally it would be both at the simultaneously, or choose one or the other depending on which of the two is expected to be the fastest.

@AZWN
Copy link
Contributor Author

AZWN commented Feb 1, 2022

That is not in particular a concern of this PR, but the incremental solver is always concurrent at the same time.

@Gohla
Copy link
Member

Gohla commented Mar 2, 2022

For some reason I never got a notification about this. I will review and merge this next week.

Copy link
Member

@Gohla Gohla left a comment

Choose a reason for hiding this comment

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

Looks good apart from a couple of small changes!

@AZWN AZWN merged commit 0537a0f into develop Feb 6, 2023
@AZWN AZWN deleted the statix-incremental branch February 6, 2023 17:31
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.

None yet

3 participants