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

Remove dependence of the incremental analysis on Git #358

Merged
merged 11 commits into from
Sep 28, 2021

Conversation

jerhard
Copy link
Member

@jerhard jerhard commented Sep 27, 2021

Removes the dependence of the incremental analysis on Git, and thus closes #350. Now:

  • Git commits are no longer used to identify program versions. The analyzed software does thus no longer have to be in a committed state, which simplifies playing around with it quite a bit.
  • Analysis results are no longer stored in a hidden directory within the analyzed Git-directory, but instead within the current working directory of Goblint, in a subdirectory incremental_data.
  • Only the analysis result of the last run is retained.

The last bullet point also implies that the feature that would allow to base an incremental analysis on the most-recent ancestor of the current commit that needs to be analyzed, is no longer supported. (E.g. Imagine that you had three commits a -> b -> c , and that you already have analysis results for a and c. Previously the incremental analysis of commit b would be based on the analysis of commit a. This is no longer the case. Instead it will base the incremental analysis on whichever version one analyzed last).

This PR also move the storing of the solver from TD3 to Control, where the handling for the (unrelated) serialization of load_run, save_run is done. The idea is that passing the solver state back will make it easier to perform an incremental run in a server mode scenario, because it should make it easier to feed the solver the old results back.

The previous implementation with List.assoc_opt used the polymorphic compare, which might lead to out of memory exceptions when used with unmarshalled objects
Add the possibility for solver to now additionally return their
state for serialization (as an Obj.t option), that later might be reused
for incremental analysis. Currently TD3 is the only solver making use of this.

The idea is to move the serialization and deserialization logic out of TD3,
so that it later can more easily be adapted, in particular for the following
two purposes:
1. making the serialization no longer dependent on Git-Commit-IDs
2. allowing to keep the data needed for incremental runs in memory, i.e.
so that data does not need to be stored to disk and read from there.
…sults.

No longer require that the current version of the incrementally analyzed
software is a committed version. Analysis results are no longer stored
in a directory named after the commit, but in some temporary results dir.
After the analysis completed, the temporary results are renamed so
they will be reused in the next incremental analysis run.
…Goblint.

Incremental analysis results are now stored inside the current working directory, and not within the git-directory of the analyzed source files. This also removes the dependenceof the incremental analysis on git.
Move exp.incremental.* options to incremental.* and
introduce options incremental.load, incremental.save instead of exp.incremental.mode
to configure whether data necessary for incremental analysis is loaded
and stored.
src/framework/control.ml Outdated Show resolved Hide resolved
src/incremental/serialize.ml Show resolved Hide resolved
src/incremental/serialize.ml Outdated Show resolved Hide resolved
src/framework/analyses.ml Outdated Show resolved Hide resolved
Solver now return, besides the solution, an object for serialization.
For now, this object is a dummy object for all solvers besides TD3.
@sim642 sim642 self-requested a review September 27, 2021 18:36
Copy link
Member

@sim642 sim642 left a comment

Choose a reason for hiding this comment

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

I think this can be merged now, so we can try integrating this with Magpie and see how interactive it feels.

I'm guessing this should be run with incremental.save first and incremental.load the second time and that's all, or is there anything else that needs to be done to use it now?
And the loading run may also specify saving for subsequent incremental runs, I suppose.

The incremental analysis does currently not work for now with the
hashconsing. The one known problem is that the check, whether start states
of queried functions changed does not work with hashconsing, because
different objects (one from the previous and current run) have the same tag.
Thus hashconsing is disabled when incremental.load or incremental.save
is enabled.

The incremental config is changed accordingly.
@jerhard jerhard merged commit f4803ad into master Sep 28, 2021
@jerhard jerhard deleted the incremental/no-git branch September 28, 2021 19:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Remove Git dependency from incremental analysis
3 participants