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

Relational MM: Cluster LMust #1643

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open

Relational MM: Cluster LMust #1643

wants to merge 3 commits into from

Conversation

michael-schwarz
Copy link
Member

Re-creates #1555 but targeting master this time.

Currently, LMust is unclustered even when clusters are employed. This leads to precision loss compared to the unclustered variant when:

  • Values are published to a mutex a for some clusters only
  • a is added to LMust
  • Upon lock(a), V.mutex_inits is not consulted for any cluster, as a is in LMust

However, V.mutex_inits should still be consulted for clusters that have not been published yet.

This also clusters LMust and adds a regression test for this behavior.

c.f. #1551

@michael-schwarz michael-schwarz added precision relational Relational analyses (Apron, affeq, lin2var) labels Dec 17, 2024
@sim642 sim642 self-requested a review December 18, 2024 12:02
@sim642
Copy link
Member

sim642 commented Jan 6, 2025

However, V.mutex_inits should still be consulted for clusters that have not been published yet.

This PR is marked as a precision improvement, but why isn't this a soundness matter?

Comment on lines +764 to +766
module Cluster: sig
include Printable.S
end
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
module Cluster: sig
include Printable.S
end
module Cluster: Printable.S

val unlock: W.t -> RD.t -> LRD.t
val unlock: W.t -> RD.t -> LRD.t * (Cluster.t list)

val filter_clusters: LRD.t -> (Cluster.t -> bool) -> LRD.t
Copy link
Member

Choose a reason for hiding this comment

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

I think the more conventional way is having the predicate first.

Comment on lines 269 to +271
(** Mutexes / globals to which values have been published, i.e. for which the initializers need not be read **)
module LMust = struct
include SetDomain.Reverse (SetDomain.ToppedSet (LLock) (struct let topname = "All locks" end))
include SetDomain.Reverse (SetDomain.ToppedSet (Printable.Prod(LLock)(Cluster)) (struct let topname = "All locks" end))
Copy link
Member

Choose a reason for hiding this comment

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

This comment should also mention clusters now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
precision relational Relational analyses (Apron, affeq, lin2var)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants