-
Notifications
You must be signed in to change notification settings - Fork 31
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
New Pointer Analysis #616
New Pointer Analysis #616
Conversation
dartagnan/src/main/java/com/dat3m/dartagnan/expression/integers/IntLiteral.java
Outdated
Show resolved
Hide resolved
Does the first bullet point mean the new analysis is always more precise than the old ones? |
@xeren showed me improved results on EBR with substantial speed up. Btw. I think this PR does not set the new analysis as default, so the CI still runs with the old one. |
@ThomasHaas would it make sense to add EBR to our CI? IIRC it is supposed to be buggy wrt IMM but correct under hardware models |
Inject Dependency into FieldSensitiveAndersen
c234fc9
to
6f547bb
Compare
.../src/main/java/com/dat3m/dartagnan/program/analysis/alias/InclusionBasedPointerAnalysis.java
Outdated
Show resolved
Hide resolved
.../src/main/java/com/dat3m/dartagnan/program/analysis/alias/InclusionBasedPointerAnalysis.java
Outdated
Show resolved
Hide resolved
.../src/main/java/com/dat3m/dartagnan/program/analysis/alias/InclusionBasedPointerAnalysis.java
Outdated
Show resolved
Hide resolved
I don't know how much time it takes with Yices2. With Z3, running EBR under multiple models is expensive. |
I have just tested this analysis on RCU tree and with B=1 it terminates in 2 seconds and with B=2 in 20 seconds. The old analysis took multiple hours IIRC. |
.../src/main/java/com/dat3m/dartagnan/program/analysis/alias/InclusionBasedPointerAnalysis.java
Outdated
Show resolved
Hide resolved
Signed-off-by: Hernan Ponce de Leon <[email protected]>
It seems that when I rebase the branch, I overwrote the default alias type. It should be fixed by now. BTW, as Thomas said, the new alias analysis shows to be better than the old one in the benchmarks added in #621, here are the statistics
|
I think the default you think about was not changed by @xeren. We have two defaults and the one you changed was for the UI only I think. |
It seems you are right (even if I'm pretty sure I saw We should be able to use |
I think so. Just change the initializer in |
Add missing initial communication tests when a store relationship is added and a load uses a constant memory object in an indirect manner, like ``` s = *(havoc ? x : y) *x = 1 ```
I am testing this branch in some new benchmarks and I get a bunch of warnings like this
How should I interpret this @xeren ? It sounds like this load cannot read from anywhere |
Yes, this means the are no possible targets to read from. It could be a bug in the analysis but also a correct result. |
But then this is a bug in the code being analyzed ... |
Yes, it might be if that memory access is reachable. @xeren Can you add source location information into the warning so we can more easily check what is wrong? |
@xeren any progress a out this PR? I would like to get this merged soon |
Use IntMath.gcd(int,int) Add more logging Fix SyntacticContextAnalysis where an assertion was violated when an event was start and end of a loop iteration at the same time.
.../src/main/java/com/dat3m/dartagnan/program/analysis/alias/InclusionBasedPointerAnalysis.java
Outdated
Show resolved
Hide resolved
.../src/main/java/com/dat3m/dartagnan/program/analysis/alias/InclusionBasedPointerAnalysis.java
Outdated
Show resolved
Hide resolved
Remove unification of LoadEdge and StoreEdge
I feel like your newest change has just shifted the variable vs. edge problem, no? |
I fixed a bug in the analysis, where the communication rule was not correctly implemented. The rule states that from Either
Maybe you were referring to inclusion edges being typed as |
Do you know of an instance of wrong behaviour? For example, does this affect qspinlock or ck_epoch or RCU?
Yes, that is what I was referring to. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall, I like this newer version a lot more. I will do a proper review the next week.
.../src/main/java/com/dat3m/dartagnan/program/analysis/alias/InclusionBasedPointerAnalysis.java
Outdated
Show resolved
Hide resolved
.../src/main/java/com/dat3m/dartagnan/program/analysis/alias/InclusionBasedPointerAnalysis.java
Outdated
Show resolved
Hide resolved
.../src/main/java/com/dat3m/dartagnan/program/analysis/alias/InclusionBasedPointerAnalysis.java
Outdated
Show resolved
Hide resolved
.../src/main/java/com/dat3m/dartagnan/program/analysis/alias/InclusionBasedPointerAnalysis.java
Show resolved
Hide resolved
.../src/main/java/com/dat3m/dartagnan/program/analysis/alias/InclusionBasedPointerAnalysis.java
Outdated
Show resolved
Hide resolved
EDIT: I was wrong. The code uses
|
.../src/main/java/com/dat3m/dartagnan/program/analysis/alias/InclusionBasedPointerAnalysis.java
Outdated
Show resolved
Hide resolved
.../src/main/java/com/dat3m/dartagnan/program/analysis/alias/InclusionBasedPointerAnalysis.java
Outdated
Show resolved
Hide resolved
.../src/main/java/com/dat3m/dartagnan/program/analysis/alias/InclusionBasedPointerAnalysis.java
Outdated
Show resolved
Hide resolved
.../src/main/java/com/dat3m/dartagnan/program/analysis/alias/InclusionBasedPointerAnalysis.java
Outdated
Show resolved
Hide resolved
.../src/main/java/com/dat3m/dartagnan/program/analysis/alias/InclusionBasedPointerAnalysis.java
Show resolved
Hide resolved
.../src/main/java/com/dat3m/dartagnan/program/analysis/alias/InclusionBasedPointerAnalysis.java
Outdated
Show resolved
Hide resolved
.../src/main/java/com/dat3m/dartagnan/program/analysis/alias/InclusionBasedPointerAnalysis.java
Show resolved
Hide resolved
.../src/main/java/com/dat3m/dartagnan/program/analysis/alias/InclusionBasedPointerAnalysis.java
Outdated
Show resolved
Hide resolved
.../src/main/java/com/dat3m/dartagnan/program/analysis/alias/InclusionBasedPointerAnalysis.java
Outdated
Show resolved
Hide resolved
.../src/main/java/com/dat3m/dartagnan/program/analysis/alias/InclusionBasedPointerAnalysis.java
Outdated
Show resolved
Hide resolved
Did you intentionally revert your recent changes? If so, you also reverted the changes to the handling of unary expressions, so they are still wrong. |
.../src/main/java/com/dat3m/dartagnan/program/analysis/alias/InclusionBasedPointerAnalysis.java
Show resolved
Hide resolved
I tested this on the libvsync benchmarks and all results look good. Unless there are further comments, I will merge. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Signed-off-by: Hernan Ponce de Leon <[email protected]> Co-authored-by: Hernan Ponce de Leon <[email protected]> Co-authored-by: Thomas Haas <[email protected]> Co-authored-by: Thomas Haas <[email protected]>
This PR started as a rework for
FieldSensitiveAlias
. It now features a third implementationInclusionBasedPointerAnalysis
.int
static offset‘,List<Integer>
dynamic offsets). This should make its precision robust against optimizations of the following form. (FieldSensitiveAndersen
uses (int
,int
) and thus looses precision there)Dependency
Analysis.mustAlias
queries.c != 0
, thenc
is promoted to a dynamic offset. Such cycles propagate at most once in total, instead of at most once per allocated byte. This should also allow the algorithm to terminate even if the program has arrays of unknown/nondeterministic size (if such a feature is ever added in the future).