Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Refactor race warnings (accesses) to use global invariant #397

Merged
merged 47 commits into from
Oct 21, 2021

Conversation

sim642
Copy link
Member

@sim642 sim642 commented Oct 14, 2021

This is a continuation of #368 for race warnings, which aren't done the usual way: they don't appear during individual transfer functions.
These changes could apply to master directly, but since they're just necessary for interactive race warnings, this PR is against interactive, where there are incremental warnings at all.

Changes

  1. Extract access handling from mutex analysis to separate access analysis.
  2. Collect accesses into global invariant using sideg and deeply nested map domains instead of using a OCaml global deeply nested hashtable. Having this in the actual constraint system and its solution makes it easier to do incremental accesses/race warnings.
  3. Allow sideg during postsolving to modify the solution. This is a massive hack, but since accesses are only collected at the end, this is the only way to have them added into the solution. To make verify happy, leq of the access analysis global domain is constant true (it's only collected during postsolving anyway). The alternative would be to expose a pair of domains through all the specs, constraint systems and solvers to allow the second warning-collecting component to be handled separately.
  4. Add WarnGlobal query to emit warnings for globals at the end of solving. Since race warnings are based on the accesses collected into the global invariant during postsolving, this needs to be done per-global after postsolving.

TODO

  • This more-or-less works with incremental, but type-based accesses go under a special __NONE__ varinfo, which is initialized to G.bot (), and currently set_start overwrites with this during incremental load. Hopefully Incremental TD3: fix start variables #393 fixes this.

sim642 and others added 30 commits October 11, 2021 17:11
Fix top thread ID set issues from sv-benchmarks
@sim642 sim642 added cleanup Refactoring, clean-up feature labels Oct 14, 2021
@sim642 sim642 self-assigned this Oct 14, 2021
@sim642
Copy link
Member Author

sim642 commented Oct 21, 2021

Merging into the branch interactive for better experimentation.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
cleanup Refactoring, clean-up feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants