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

Granular dependency relation #22

Merged
merged 1 commit into from
Nov 16, 2023
Merged

Granular dependency relation #22

merged 1 commit into from
Nov 16, 2023

Conversation

bartoszmodelski
Copy link
Contributor

@bartoszmodelski bartoszmodelski commented Apr 21, 2023

DPOR algorithms schedule race reversals based on depedency relation, which is a binary relation on transitions indicating whether two operations are racing or not. Currently, we treat any two accesses on the same variable (by two different domains) as a race but this is simplistic. In many cases such accesses do commute, e.g.: two reads, two incrs, two failed cases, two writes writing the same value.

This PR implements the first part: commutative reads (get, failed CAS). There are two main changes in this PR:

  • Happens-before is made more abstract to dpor.
    • This includes a change to be more mindful about detecting reversible races. In particular, we don't want to recognize two transitively-dependent operations as a race.
  • Happens-before is refined to exclude pairs of read-only operations.
    • This requires some extra processing as happens-before now forms a graph rather than list.
    • This includes a change to capture effect of CASes. I did a lot of testing with the test generator and some manually crafted cas tests vs nidhugg targeting this in particular.

Furthermore, I've slid in a 2-line optimization I've noticed in nidhugg. Currently, we schedule one of the initials is none of them is present in the backtrack (i.e. an initial is not scheduled). I've noticed an optimization in nidhugg, which goes one step further - also checks whether sleep set contains any of the initials (i.e. an initials is ignored, thus its been processed before).

Results

Lockfree

Lockfree tests ws_deque_dscheck, mpsc_queue_dscheck, michael_scott_queue_dscheck, Spsc_queue_dscheck, treiber_stack_dscheck vs source sets branch.

PR#18:
$ time dune test
dune test  4,10s user 0,07s system 114% cpu 3,630 total

granular-dependency-relation:
$ time dune test
dune test  0,19s user 0,03s system 124% cpu 0,179 total

Eio

Eio tests make dscheck vs optims branch.

PR#3: 
$ time make dscheck
make dscheck  1128,60s user 1,39s system 99% cpu 18:50,23 total

granular-dependency-relation
$ time make dscheck
make dscheck  228,93s user 0,45s system 99% cpu 3:49,43 total

@bartoszmodelski bartoszmodelski force-pushed the granular-dependency-relation branch 2 times, most recently from a6465c4 to 7de4a16 Compare April 26, 2023 11:38
@bartoszmodelski bartoszmodelski mentioned this pull request May 17, 2023
@bartoszmodelski bartoszmodelski marked this pull request as ready for review May 24, 2023 19:06
@bartoszmodelski bartoszmodelski force-pushed the granular-dependency-relation branch 3 times, most recently from 8a6d75b to ebe968d Compare June 2, 2023 13:11
@lyrm lyrm mentioned this pull request Jul 5, 2023
Sudha247 added a commit that referenced this pull request Jul 17, 2023
@lyrm lyrm force-pushed the granular-dependency-relation branch from ebe968d to 7becf31 Compare November 14, 2023 17:09
@lyrm
Copy link
Collaborator

lyrm commented Nov 14, 2023

The merged conflicts should be resolved. It everything is green, this can be merged.

@lyrm lyrm merged commit b662216 into main Nov 16, 2023
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants