Hitting Families of Schedules for Asynchronous Programs Dmitry - - PowerPoint PPT Presentation

hitting families of schedules for asynchronous programs
SMART_READER_LITE
LIVE PREVIEW

Hitting Families of Schedules for Asynchronous Programs Dmitry - - PowerPoint PPT Presentation

Hitting Families of Schedules for Asynchronous Programs Dmitry Chistikov 1,2 , Rupak Majumdar 1 , Filip Niksic 1 1 Max Planck Institute for Software Systems (MPI-SWS), Germany 2 University of Oxford, UK Ninjas at a conference banquet 1 2 n


slide-1
SLIDE 1

Hitting Families of Schedules for Asynchronous Programs

Dmitry Chistikov1,2, Rupak Majumdar1, Filip Niksic1

1 Max Planck Institute for Software Systems (MPI-SWS), Germany 2 University of Oxford, UK

slide-2
SLIDE 2

Ninjas at a conference banquet

Icons made by Freepik at www.flaticon.com

… 1 2 n A banquet is complete if for every pair of ninjas (i, j), there’s a course served to ninja i before ninja j. How many courses make a banquet complete?

slide-3
SLIDE 3

Ninjas at a conference banquet

Icons made by Freepik at www.flaticon.com

… 1 2 n Two courses suffice: … n n-1 1

slide-4
SLIDE 4

Ninjas at a conference banquet

Icons made by Freepik at www.flaticon.com

1 2 3 4 5 6 7 What if ninjas form a hierarchy? A master is always served before their student.

slide-5
SLIDE 5

Ninjas at a conference banquet

Icons made by Freepik at www.flaticon.com

Again, two courses suffice: 4 2 1 5 3 6 7 7 3 1 6 2 5 4 ldfs rdfs

slide-6
SLIDE 6

Ninjas at a conference banquet

What if instead of pairs we consider triplets of ninjas? A banquet is 3-complete if for every triplet of ninjas (i, j, k), there’s a course served to ninja i before j, and j before k.

slide-7
SLIDE 7

Ninjas at a conference banquet

What if instead of pairs we consider triplets of ninjas? A banquet is 3-complete if for every triplet of ninjas (i, j, k), there’s a course served to ninja i before j, and j before k. a d m i s s i b l e

slide-8
SLIDE 8

Ninjas at a conference banquet

What if instead of pairs we consider triplets of ninjas? A banquet is 3-complete if for every triplet of ninjas (i, j, k), there’s a course served to ninja i before j, and j before k. Naive approach with 2n courses: for each i@{1,…,n}: serve ancestry line to i; ldfs the rest serve ancestry line to i; rdfs the rest a d m i s s i b l e

slide-9
SLIDE 9

Ninjas at a conference banquet

What if instead of pairs we consider triplets of ninjas? A banquet is 3-complete if for every triplet of ninjas (i, j, k), there’s a course served to ninja i before j, and j before k. Can be done with O(log n) courses! Naive approach with 2n courses: for each i@{1,…,n}: serve ancestry line to i; ldfs the rest serve ancestry line to i; rdfs the rest a d m i s s i b l e

slide-10
SLIDE 10

From ninjas to concurrent systems

ninjas hierarchy courses d-complete banquet events partial order schedules d-hitting family of schedules

Icons made by Freepik at www.flaticon.com

slide-11
SLIDE 11

d-hitting families of schedules

Given a poset of events, a family of schedules F is d-hitting if for every admissible d-tuple of events there is a schedule in F that hits it. Given a poset of events, a schedule hits a d-tuple of events (e1,…,ed) if it executes the events in the order e1<…<ed.

slide-12
SLIDE 12

Why d?

Empirically: Many bugs involve small number of events—bug depth d

[Lu et al. ASPLOS ’08] [Burckhardt et al. ASPLOS ’10] [Jensen et al. OOPSLA ’15] [Qadeer et al. TACAS ’05]

  • d = 2: order violation
  • d = 3: atomicity violation

A d-hitting family of schedules provides a notion of coverage: it hits any bug of depth d. Moreover, for certain kinds of partial orders we can explicitly construct small d-hitting families.

slide-13
SLIDE 13

Contributions

  • 1. The notion of d-hitting families of schedules
  • 2. For anti-chains with n elements, existence of hitting

families of size O(exp(d)·log n)

  • 3. For trees of height h:
  • d = 3: explicit construction of hitting families of size 4h (optimal)
  • d > 3: explicit construction of hitting families of size O(exp(d)·hd-1)
slide-14
SLIDE 14

Contributions

  • 1. The notion of d-hitting families of schedules
  • 2. For anti-chains with n elements, existence of hitting

families of size O(exp(d)·log n)

  • 3. For trees of height h:
  • d = 3: explicit construction of hitting families of size 4h (optimal)
  • d > 3: explicit construction of hitting families of size O(exp(d)·hd-1)
slide-15
SLIDE 15

Why trees?

AsyncTask1 AsyncTask2 AsyncTask3

  • Trees arise from a simple fire-and-forget model of

asynchronous programs.

  • Trees are a stepping stone to more complicated partial
  • rders.
slide-16
SLIDE 16

3-hitting families for trees

admissible (a,b,c) a c b height h

slide-17
SLIDE 17

3-hitting families for trees

admissible (a,b,c) a c height h

slide-18
SLIDE 18

3-hitting families for trees

admissible (a,b,c) a c d d = lca(a,c) (could be a itself) height h

slide-19
SLIDE 19

3-hitting families for trees

admissible (a,b,c) a c d d = lca(a,c) (could be a itself) height h level i

slide-20
SLIDE 20

3-hitting families for trees

admissible (a,b,c) a c d d = lca(a,c) (could be a itself) height h level i

slide-21
SLIDE 21

3-hitting families for trees

admissible (a,b,c) a c d d = lca(a,c) (could be a itself) height h level i dfs blocking right@i; dfs the rest

slide-22
SLIDE 22

3-hitting families for trees

admissible (a,b,c) a c d d = lca(a,c) (could be a itself) height h level i dfs blocking right@i; dfs the rest dfs blocking left@i; dfs the rest

slide-23
SLIDE 23

3-hitting families for trees

admissible (a,b,c) a c b d d = lca(a,c) (could be a itself) height h level i dfs blocking right@i; dfs the rest dfs blocking left@i; dfs the rest

slide-24
SLIDE 24

3-hitting families for trees

admissible (a,b,c) a c b d d = lca(a,c) (could be a itself) height h level i ldfs blocking right@i; ldfs the rest ldfs blocking left@i; ldfs the rest rdfs blocking right@i; rdfs the rest rdfs blocking left@i; rdfs the rest

slide-25
SLIDE 25

3-hitting families for trees

admissible (a,b,c) a c b d d = lca(a,c) (could be a itself) height h level i ldfs blocking right@i; ldfs the rest ldfs blocking left@i; ldfs the rest rdfs blocking right@i; rdfs the rest rdfs blocking left@i; rdfs the rest for each i@{0,…,h-1}:

slide-26
SLIDE 26

3-hitting families for trees

admissible (a,b,c) a c b d d = lca(a,c) (could be a itself) height h level i ldfs blocking right@i; ldfs the rest ldfs blocking left@i; ldfs the rest rdfs blocking right@i; rdfs the rest rdfs blocking left@i; rdfs the rest for each i@{0,…,h-1}:

Total: 4h schedules (4·log n for a balanced tree)

slide-27
SLIDE 27

d-hitting families for d≥ 4

admissible (x1,…,xd) height h

slide-28
SLIDE 28

d-hitting families for d≥ 4

admissible (x1,…,xd) D = lca-closure(x1,…,xd) (an ordered tree) height h

slide-29
SLIDE 29

d-hitting families for d≥ 4

admissible (x1,…,xd) D = lca-closure(x1,…,xd) (an ordered tree) height h i1,…,ik — levels of D’s internal nodes

slide-30
SLIDE 30

d-hitting families for d≥ 4

admissible (x1,…,xd) D = lca-closure(x1,…,xd) (an ordered tree) height h i1,…,ik — levels of D’s internal nodes

slide-31
SLIDE 31

d-hitting families for d≥ 4

admissible (x1,…,xd) D = lca-closure(x1,…,xd) (an ordered tree) height h i1,…,ik — levels of D’s internal nodes π — schedule of D that hits (x1,…,xd) (D, i1,…,ik, π) is a pattern:

  • determines a partition of the tree
  • by scheduling parts according to π,

determines a schedule that hits (x1,…,xd)

slide-32
SLIDE 32

d-hitting families for d≥ 4

admissible (x1,…,xd) D = lca-closure(x1,…,xd) (an ordered tree) height h i1,…,ik — levels of D’s internal nodes π — schedule of D that hits (x1,…,xd) (D, i1,…,ik, π) is a pattern:

  • determines a partition of the tree
  • by scheduling parts according to π,

determines a schedule that hits (x1,…,xd) for each pattern: schedule according to pattern

slide-33
SLIDE 33

d-hitting families for d≥ 4

  • Claim. For any nodes x1,…,xd, |D| ≤ 2d-1. Moreover, D

has at most d-1 internal nodes. Accounting:

  • at most exp(d) ordered trees with 2d-1 nodes
  • at most hd-1 choices for levels i1,…,id-1
  • at most d! schedules π

Total: at most exp(d)·d!·hd-1 patterns

slide-34
SLIDE 34

d-hitting families for d≥ 4

  • Claim. For any nodes x1,…,xd, |D| ≤ 2d-1. Moreover, D

has at most d-1 internal nodes. Accounting:

  • at most exp(d) ordered trees with 2d-1 nodes
  • at most hd-1 choices for levels i1,…,id-1
  • at most d! schedules π

Total: at most exp(d)·d!·hd-1 patterns Note: For d=3, this is O(h2) instead of O(h) schedules

slide-35
SLIDE 35

From hitting families to systematic testing

Posets of event need not be static

  • Use on-the-fly constructions as a heuristic

Beyond trees

  • Our results extend to series-parallel graphs
  • In general, even the case of d=2 is difficult

(order dimension [Dushnik & Miller, ’41])

Unbalanced trees

  • Height h can be close to number of nodes n
  • Use domain-specific properties to first reduce the poset
slide-36
SLIDE 36

Summary

  • 1. The notion of d-hitting families of schedules
  • 2. For anti-chains with n elements, existence of hitting

families of size O(exp(d)·log n)

  • 3. For trees of height h:
  • d = 3: explicit construction of hitting families of size 4h (optimal)
  • d > 3: explicit construction of hitting families of size O(exp(d)·hd-1)

http://www.mpi-sws.org/~fniksic/