Avoid spurious writes for invariants in base mutex-meet-tid#1653
Avoid spurious writes for invariants in base mutex-meet-tid#1653
Conversation
|
I'm not sure it is strictly an optimization unfortunately. I think the reason it is not done some of the times is code such as lock(a);
g = ?;
while(g < 20) { };
unlock(a);which occurs quite a few times in SV-COMP snippets as However, it should still be sound, so maybe we should just try to add it everywhere and then benchmark again? |
|
Looks like mutex-meet-tid is the only privatization where |
|
Addings thing to |
|
What invariant about If the current version is sound and the version in this PR is sound, then their meet should be as well. Since almost everything is shared between the two, it should be possible to merge the two together, e.g. having the different |
While describing the special
invariantwrites to globals for my thesis, I looked through all of thewrite_globalimplementations and noticed that some mutex-meet variants do not use the optimization:I have quickly added a test for base mutex-meet-tid which reveals precision loss from such spurious side effects. The PR also includes a quick fix for it by analogy, but I haven't thought about it much nor properly tested it.
If this is sound, then we should probably have this since it can improve both precision and performance.