bridgingthegapbetweenprogramminglanguagesand...

74
Bridging the Gap between Programming Languages and Hardware Weak Memory Models Anton Podkopaev Ori Lahav Viktor Vafeiadis 0

Upload: others

Post on 28-Jul-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: BridgingtheGapbetweenProgrammingLanguagesand ...plv.mpi-sws.org/imm/Podkopaev-al-POPL19-presentation.pdf · 1 BridgingtheGapbetweenPLandHardwareWeakMMs Programming Language Hardware

Bridging the Gap between Programming Languages andHardware Weak Memory Models

Anton Podkopaev Ori Lahav Viktor Vafeiadis

0

Page 2: BridgingtheGapbetweenProgrammingLanguagesand ...plv.mpi-sws.org/imm/Podkopaev-al-POPL19-presentation.pdf · 1 BridgingtheGapbetweenPLandHardwareWeakMMs Programming Language Hardware

1

Bridging the Gap between PL and Hardware Weak MMs

ProgrammingLanguage HardwareCompiler

CorrectCompiler

∀P ∈ Syntax(PL).

JPKPLJcompile(P)KHWJ−K{PL,HW} is Memory Model

Page 3: BridgingtheGapbetweenProgrammingLanguagesand ...plv.mpi-sws.org/imm/Podkopaev-al-POPL19-presentation.pdf · 1 BridgingtheGapbetweenPLandHardwareWeakMMs Programming Language Hardware

1

Bridging the Gap between PL and Hardware Weak MMs

ProgrammingLanguage Hardware

CompilerCorrectCompiler

∀P ∈ Syntax(PL).

JPKPLJcompile(P)KHWJ−K{PL,HW} is Memory Model

Page 4: BridgingtheGapbetweenProgrammingLanguagesand ...plv.mpi-sws.org/imm/Podkopaev-al-POPL19-presentation.pdf · 1 BridgingtheGapbetweenPLandHardwareWeakMMs Programming Language Hardware

1

Bridging the Gap between PL and Hardware Weak MMs

ProgrammingLanguage HardwareCompiler

CorrectCompiler

∀P ∈ Syntax(PL).

JPKPLJcompile(P)KHWJ−K{PL,HW} is Memory Model

Page 5: BridgingtheGapbetweenProgrammingLanguagesand ...plv.mpi-sws.org/imm/Podkopaev-al-POPL19-presentation.pdf · 1 BridgingtheGapbetweenPLandHardwareWeakMMs Programming Language Hardware

1

Bridging the Gap between PL and Hardware Weak MMs

ProgrammingLanguage Hardware

Compiler

CorrectCompiler

∀P ∈ Syntax(PL).

JPKPLJcompile(P)KHWJ−K{PL,HW} is Memory Model

Page 6: BridgingtheGapbetweenProgrammingLanguagesand ...plv.mpi-sws.org/imm/Podkopaev-al-POPL19-presentation.pdf · 1 BridgingtheGapbetweenPLandHardwareWeakMMs Programming Language Hardware

1

Bridging the Gap between PL and Hardware Weak MMs

ProgrammingLanguage Hardware

Compiler

CorrectCompiler

∀P ∈ Syntax(PL).

JPKPLJcompile(P)KHW

J−K{PL,HW} is Memory Model

Page 7: BridgingtheGapbetweenProgrammingLanguagesand ...plv.mpi-sws.org/imm/Podkopaev-al-POPL19-presentation.pdf · 1 BridgingtheGapbetweenPLandHardwareWeakMMs Programming Language Hardware

1

Bridging the Gap between PL and Hardware Weak MMs

ProgrammingLanguage Hardware

Compiler

CorrectCompiler

∀P ∈ Syntax(PL).

JPKPLJcompile(P)KHWJ−K{PL,HW} is Memory Model

Page 8: BridgingtheGapbetweenProgrammingLanguagesand ...plv.mpi-sws.org/imm/Podkopaev-al-POPL19-presentation.pdf · 1 BridgingtheGapbetweenPLandHardwareWeakMMs Programming Language Hardware

1

Bridging the Gap between PL and Hardware Weak MMs

ProgrammingLanguage Hardware

Compiler

CorrectCompiler

∀P ∈ Syntax(PL).

JPKPLJcompile(P)KHWJ−K{PL,HW} is Memory Model

Page 9: BridgingtheGapbetweenProgrammingLanguagesand ...plv.mpi-sws.org/imm/Podkopaev-al-POPL19-presentation.pdf · 1 BridgingtheGapbetweenPLandHardwareWeakMMs Programming Language Hardware

2

Strong (SC) MM disallows a = b = 1

Memory;[x]← 0 [y]← 0

Values;a = ⊥ b = ⊥

a := [x];[y] := 1;

b := [y];[x] := b;

ARM and POWER weak MMs allow a = b = 1!

Page 10: BridgingtheGapbetweenProgrammingLanguagesand ...plv.mpi-sws.org/imm/Podkopaev-al-POPL19-presentation.pdf · 1 BridgingtheGapbetweenPLandHardwareWeakMMs Programming Language Hardware

2

Strong (SC) MM disallows a = b = 1

Memory;[x]← 0 [y]← 0

Values;a = ⊥ b = ⊥

a := [x];[y] := 1;

b := [y];[x] := b;

ARM and POWER weak MMs allow a = b = 1!

Page 11: BridgingtheGapbetweenProgrammingLanguagesand ...plv.mpi-sws.org/imm/Podkopaev-al-POPL19-presentation.pdf · 1 BridgingtheGapbetweenPLandHardwareWeakMMs Programming Language Hardware

2

Strong (SC) MM disallows a = b = 1

Memory;[x]← 0 [y]← 0

Values;a = 0 b = ⊥

a := [x];[y] := 1;

b := [y];[x] := b;

ARM and POWER weak MMs allow a = b = 1!

Page 12: BridgingtheGapbetweenProgrammingLanguagesand ...plv.mpi-sws.org/imm/Podkopaev-al-POPL19-presentation.pdf · 1 BridgingtheGapbetweenPLandHardwareWeakMMs Programming Language Hardware

2

Strong (SC) MM disallows a = b = 1

Memory;[x]← 0 [y]← 1

Values;a = 0 b = ⊥

a := [x];[y] := 1;

b := [y];[x] := b;

ARM and POWER weak MMs allow a = b = 1!

Page 13: BridgingtheGapbetweenProgrammingLanguagesand ...plv.mpi-sws.org/imm/Podkopaev-al-POPL19-presentation.pdf · 1 BridgingtheGapbetweenPLandHardwareWeakMMs Programming Language Hardware

2

Strong (SC) MM disallows a = b = 1

Memory;[x]← 0 [y]← 1

Values;a = 0 b = 1

a := [x];[y] := 1;

b := [y];[x] := b;

ARM and POWER weak MMs allow a = b = 1!

Page 14: BridgingtheGapbetweenProgrammingLanguagesand ...plv.mpi-sws.org/imm/Podkopaev-al-POPL19-presentation.pdf · 1 BridgingtheGapbetweenPLandHardwareWeakMMs Programming Language Hardware

2

Strong (SC) MM disallows a = b = 1

Memory;[x]← 1 [y]← 1

Values;a = 0 b = 1

a := [x];[y] := 1;

b := [y];[x] := b;

ARM and POWER weak MMs allow a = b = 1!

Page 15: BridgingtheGapbetweenProgrammingLanguagesand ...plv.mpi-sws.org/imm/Podkopaev-al-POPL19-presentation.pdf · 1 BridgingtheGapbetweenPLandHardwareWeakMMs Programming Language Hardware

2

Strong (SC) MM

disallows a = b = 1

Memory;[x]← 1 [y]← 1

Values;a = 0 b = 1

a := [x];[y] := 1;

b := [y];[x] := b;

ARM and POWER weak MMs allow a = b = 1!

Page 16: BridgingtheGapbetweenProgrammingLanguagesand ...plv.mpi-sws.org/imm/Podkopaev-al-POPL19-presentation.pdf · 1 BridgingtheGapbetweenPLandHardwareWeakMMs Programming Language Hardware

2

Strong (SC) MM disallows a = b = 1

Memory;[x]← 1 [y]← 1

Values;a = 0 b = 1

a := [x];[y] := 1;

b := [y];[x] := b;

ARM and POWER weak MMs allow a = b = 1!

Page 17: BridgingtheGapbetweenProgrammingLanguagesand ...plv.mpi-sws.org/imm/Podkopaev-al-POPL19-presentation.pdf · 1 BridgingtheGapbetweenPLandHardwareWeakMMs Programming Language Hardware

2

Strong (SC) MM disallows a = b = 1

Memory;[x]← 1 [y]← 1

Values;a = 0 b = 1

a := [x];[y] := 1;

b := [y];[x] := b;

ARM and POWER weak MMs allow a = b = 1!

Page 18: BridgingtheGapbetweenProgrammingLanguagesand ...plv.mpi-sws.org/imm/Podkopaev-al-POPL19-presentation.pdf · 1 BridgingtheGapbetweenPLandHardwareWeakMMs Programming Language Hardware

3

Bridging the Gap between PL and Hardware Weak MMs

Promise

(R)C11

WeakestMO[Chakraborty and Vafeiadis, 2019]

IMM

x86-TSO

ARMv7

ARMv8.3

RISC-V

POWER

CompCert Weak MMs1. Declarative1. Declarative2. Preserves syntactic dependencies

(deps ∪ rf is acyclic)

1. Declarative2. Preserves syntactic dependencies

(deps ∪ rf is acyclic)3. Uses C11-style coherence

(hb; eco? is irreflexive)

1. Declarative2. Preserves syntactic dependencies

(deps ∪ rf is acyclic)3. Uses C11-style coherence

(hb; eco? is irreflexive)4. Non-multicopy-atomic

w/o mutually recursive relations

plv.mpi-sws.org/imm/ Thank you!

Page 19: BridgingtheGapbetweenProgrammingLanguagesand ...plv.mpi-sws.org/imm/Podkopaev-al-POPL19-presentation.pdf · 1 BridgingtheGapbetweenPLandHardwareWeakMMs Programming Language Hardware

3

Bridging the Gap between PL and Hardware Weak MMs

Promise

(R)C11

WeakestMO[Chakraborty and Vafeiadis, 2019]

IMM

x86-TSO

ARMv7

ARMv8.3

RISC-V

POWER

CompCert Weak MMs1. Declarative1. Declarative2. Preserves syntactic dependencies

(deps ∪ rf is acyclic)

1. Declarative2. Preserves syntactic dependencies

(deps ∪ rf is acyclic)3. Uses C11-style coherence

(hb; eco? is irreflexive)

1. Declarative2. Preserves syntactic dependencies

(deps ∪ rf is acyclic)3. Uses C11-style coherence

(hb; eco? is irreflexive)4. Non-multicopy-atomic

w/o mutually recursive relations

plv.mpi-sws.org/imm/ Thank you!

Page 20: BridgingtheGapbetweenProgrammingLanguagesand ...plv.mpi-sws.org/imm/Podkopaev-al-POPL19-presentation.pdf · 1 BridgingtheGapbetweenPLandHardwareWeakMMs Programming Language Hardware

3

Bridging the Gap between PL and Hardware Weak MMs

Promise

(R)C11

WeakestMO[Chakraborty and Vafeiadis, 2019]

IMM

x86-TSO

ARMv7

ARMv8.3

RISC-V

POWER

CompCert Weak MMs1. Declarative1. Declarative2. Preserves syntactic dependencies

(deps ∪ rf is acyclic)

1. Declarative2. Preserves syntactic dependencies

(deps ∪ rf is acyclic)3. Uses C11-style coherence

(hb; eco? is irreflexive)

1. Declarative2. Preserves syntactic dependencies

(deps ∪ rf is acyclic)3. Uses C11-style coherence

(hb; eco? is irreflexive)4. Non-multicopy-atomic

w/o mutually recursive relations

plv.mpi-sws.org/imm/ Thank you!

Page 21: BridgingtheGapbetweenProgrammingLanguagesand ...plv.mpi-sws.org/imm/Podkopaev-al-POPL19-presentation.pdf · 1 BridgingtheGapbetweenPLandHardwareWeakMMs Programming Language Hardware

3

Bridging the Gap between PL and Hardware Weak MMs

Promise

(R)C11

WeakestMO[Chakraborty and Vafeiadis, 2019]

IMM

x86-TSO

ARMv7

ARMv8.3

RISC-V

POWER

CompCert Weak MMs1. Declarative1. Declarative2. Preserves syntactic dependencies

(deps ∪ rf is acyclic)

1. Declarative2. Preserves syntactic dependencies

(deps ∪ rf is acyclic)3. Uses C11-style coherence

(hb; eco? is irreflexive)

1. Declarative2. Preserves syntactic dependencies

(deps ∪ rf is acyclic)3. Uses C11-style coherence

(hb; eco? is irreflexive)4. Non-multicopy-atomic

w/o mutually recursive relations

plv.mpi-sws.org/imm/ Thank you!

Page 22: BridgingtheGapbetweenProgrammingLanguagesand ...plv.mpi-sws.org/imm/Podkopaev-al-POPL19-presentation.pdf · 1 BridgingtheGapbetweenPLandHardwareWeakMMs Programming Language Hardware

3

Bridging the Gap between PL and Hardware Weak MMs

Promise

(R)C11

WeakestMO[Chakraborty and Vafeiadis, 2019]

IMM

x86-TSO

ARMv7

ARMv8.3

RISC-V

POWER

CompCert Weak MMs1. Declarative1. Declarative2. Preserves syntactic dependencies

(deps ∪ rf is acyclic)

1. Declarative2. Preserves syntactic dependencies

(deps ∪ rf is acyclic)3. Uses C11-style coherence

(hb; eco? is irreflexive)

1. Declarative2. Preserves syntactic dependencies

(deps ∪ rf is acyclic)3. Uses C11-style coherence

(hb; eco? is irreflexive)4. Non-multicopy-atomic

w/o mutually recursive relations

plv.mpi-sws.org/imm/ Thank you!

Page 23: BridgingtheGapbetweenProgrammingLanguagesand ...plv.mpi-sws.org/imm/Podkopaev-al-POPL19-presentation.pdf · 1 BridgingtheGapbetweenPLandHardwareWeakMMs Programming Language Hardware

3

Bridging the Gap between PL and Hardware Weak MMs

Promise

(R)C11

WeakestMO[Chakraborty and Vafeiadis, 2019]

IMM

x86-TSO

ARMv7

ARMv8.3

RISC-V

POWER

CompCert Weak MMs1. Declarative1. Declarative2. Preserves syntactic dependencies

(deps ∪ rf is acyclic)

1. Declarative2. Preserves syntactic dependencies

(deps ∪ rf is acyclic)3. Uses C11-style coherence

(hb; eco? is irreflexive)

1. Declarative2. Preserves syntactic dependencies

(deps ∪ rf is acyclic)3. Uses C11-style coherence

(hb; eco? is irreflexive)4. Non-multicopy-atomic

w/o mutually recursive relations

plv.mpi-sws.org/imm/ Thank you!

Page 24: BridgingtheGapbetweenProgrammingLanguagesand ...plv.mpi-sws.org/imm/Podkopaev-al-POPL19-presentation.pdf · 1 BridgingtheGapbetweenPLandHardwareWeakMMs Programming Language Hardware

3

Bridging the Gap between PL and Hardware Weak MMs

Promise

(R)C11

WeakestMO[Chakraborty and Vafeiadis, 2019]

IMM

x86-TSO

ARMv7

ARMv8.3

RISC-V

POWER

CompCert Weak MMs1. Declarative1. Declarative2. Preserves syntactic dependencies

(deps ∪ rf is acyclic)

1. Declarative2. Preserves syntactic dependencies

(deps ∪ rf is acyclic)3. Uses C11-style coherence

(hb; eco? is irreflexive)

1. Declarative2. Preserves syntactic dependencies

(deps ∪ rf is acyclic)3. Uses C11-style coherence

(hb; eco? is irreflexive)4. Non-multicopy-atomic

w/o mutually recursive relations

plv.mpi-sws.org/imm/ Thank you!

Page 25: BridgingtheGapbetweenProgrammingLanguagesand ...plv.mpi-sws.org/imm/Podkopaev-al-POPL19-presentation.pdf · 1 BridgingtheGapbetweenPLandHardwareWeakMMs Programming Language Hardware

3

Bridging the Gap between PL and Hardware Weak MMs

Promise

(R)C11

WeakestMO[Chakraborty and Vafeiadis, 2019]

IMM

x86-TSO

ARMv7

ARMv8.3

RISC-V

POWER

CompCert Weak MMs1. Declarative1. Declarative2. Preserves syntactic dependencies

(deps ∪ rf is acyclic)

1. Declarative2. Preserves syntactic dependencies

(deps ∪ rf is acyclic)3. Uses C11-style coherence

(hb; eco? is irreflexive)

1. Declarative2. Preserves syntactic dependencies

(deps ∪ rf is acyclic)3. Uses C11-style coherence

(hb; eco? is irreflexive)4. Non-multicopy-atomic

w/o mutually recursive relations

plv.mpi-sws.org/imm/ Thank you!

Page 26: BridgingtheGapbetweenProgrammingLanguagesand ...plv.mpi-sws.org/imm/Podkopaev-al-POPL19-presentation.pdf · 1 BridgingtheGapbetweenPLandHardwareWeakMMs Programming Language Hardware

3

Bridging the Gap between PL and Hardware Weak MMs

Promise

(R)C11

WeakestMO[Chakraborty and Vafeiadis, 2019]

IMM

x86-TSO

ARMv7

ARMv8.3

RISC-V

POWER

CompCert Weak MMs

1. Declarative

1. Declarative2. Preserves syntactic dependencies

(deps ∪ rf is acyclic)

1. Declarative2. Preserves syntactic dependencies

(deps ∪ rf is acyclic)3. Uses C11-style coherence

(hb; eco? is irreflexive)

1. Declarative2. Preserves syntactic dependencies

(deps ∪ rf is acyclic)3. Uses C11-style coherence

(hb; eco? is irreflexive)4. Non-multicopy-atomic

w/o mutually recursive relations

plv.mpi-sws.org/imm/ Thank you!

Page 27: BridgingtheGapbetweenProgrammingLanguagesand ...plv.mpi-sws.org/imm/Podkopaev-al-POPL19-presentation.pdf · 1 BridgingtheGapbetweenPLandHardwareWeakMMs Programming Language Hardware

4

(Declarative) Executions in IMMa := [x];[y] := 1;

b := [y];[x] := b;

Rx0

Wy1

Ry0

Wx0fr ,Rx0

Wy1

Ry1

Wx1data

frrf ,

Rx1

Wy1

Ry1

Wx1data

rf

Rx1

Wy1

Ry1

Wx1po data

rf

Axioms:1. data ∪ rf is acyclic…

Page 28: BridgingtheGapbetweenProgrammingLanguagesand ...plv.mpi-sws.org/imm/Podkopaev-al-POPL19-presentation.pdf · 1 BridgingtheGapbetweenPLandHardwareWeakMMs Programming Language Hardware

4

(Declarative) Executions in IMMa := [x];[y] := 1;

b := [y];[x] := b;

Rx0

Wy1

Ry0

Wx0fr ,Rx0

Wy1

Ry1

Wx1data

frrf ,

Rx1

Wy1

Ry1

Wx1data

rf

Rx1

Wy1

Ry1

Wx1po data

rf

Axioms:1. data ∪ rf is acyclic…

Page 29: BridgingtheGapbetweenProgrammingLanguagesand ...plv.mpi-sws.org/imm/Podkopaev-al-POPL19-presentation.pdf · 1 BridgingtheGapbetweenPLandHardwareWeakMMs Programming Language Hardware

4

(Declarative) Executions in IMMa := [x];[y] := 1;

b := [y];[x] := b;

Rx0

Wy1

Ry0

Wx0fr ,Rx0

Wy1

Ry1

Wx1data

frrf ,

Rx1

Wy1

Ry1

Wx1data

rf

Rx1

Wy1

Ry1

Wx1po data

rf

Axioms:1. data ∪ rf is acyclic…

Page 30: BridgingtheGapbetweenProgrammingLanguagesand ...plv.mpi-sws.org/imm/Podkopaev-al-POPL19-presentation.pdf · 1 BridgingtheGapbetweenPLandHardwareWeakMMs Programming Language Hardware

4

(Declarative) Executions in IMMa := [x];[y] := 1;

b := [y];[x] := b;

Rx0

Wy1

Ry0

Wx0fr ,Rx0

Wy1

Ry1

Wx1data

frrf ,

Rx1

Wy1

Ry1

Wx1data

rf

Rx1

Wy1

Ry1

Wx1po data

rf

Axioms:1. data ∪ rf is acyclic…

Page 31: BridgingtheGapbetweenProgrammingLanguagesand ...plv.mpi-sws.org/imm/Podkopaev-al-POPL19-presentation.pdf · 1 BridgingtheGapbetweenPLandHardwareWeakMMs Programming Language Hardware

5

Bridging the Gap between PL and Hardware Weak MMs

Promise

(R)C11

WeakestMO[Chakraborty and Vafeiadis, 2019]

IMM

x86-TSO

ARMv7

ARMv8.3

RISC-V

POWER

CompCert Weak MMs

1. Declarative

1. Declarative2. Preserves syntactic dependencies

(deps ∪ rf is acyclic)

1. Declarative2. Preserves syntactic dependencies

(deps ∪ rf is acyclic)3. Uses C11-style coherence

(hb; eco? is irreflexive)

1. Declarative2. Preserves syntactic dependencies

(deps ∪ rf is acyclic)3. Uses C11-style coherence

(hb; eco? is irreflexive)4. Non-multicopy-atomic

w/o mutually recursive relations

plv.mpi-sws.org/imm/ Thank you!

Page 32: BridgingtheGapbetweenProgrammingLanguagesand ...plv.mpi-sws.org/imm/Podkopaev-al-POPL19-presentation.pdf · 1 BridgingtheGapbetweenPLandHardwareWeakMMs Programming Language Hardware

5

Bridging the Gap between PL and Hardware Weak MMs

Promise

(R)C11

WeakestMO[Chakraborty and Vafeiadis, 2019]

IMM

x86-TSO

ARMv7

ARMv8.3

RISC-V

POWER

CompCert Weak MMs1. Declarative

1. Declarative2. Preserves syntactic dependencies(deps ∪ rf is acyclic)

1. Declarative2. Preserves syntactic dependencies

(deps ∪ rf is acyclic)3. Uses C11-style coherence

(hb; eco? is irreflexive)

1. Declarative2. Preserves syntactic dependencies

(deps ∪ rf is acyclic)3. Uses C11-style coherence

(hb; eco? is irreflexive)4. Non-multicopy-atomic

w/o mutually recursive relations

plv.mpi-sws.org/imm/ Thank you!

Page 33: BridgingtheGapbetweenProgrammingLanguagesand ...plv.mpi-sws.org/imm/Podkopaev-al-POPL19-presentation.pdf · 1 BridgingtheGapbetweenPLandHardwareWeakMMs Programming Language Hardware

5

Bridging the Gap between PL and Hardware Weak MMs

Promise

(R)C11

WeakestMO[Chakraborty and Vafeiadis, 2019]

IMM

x86-TSO

ARMv7

ARMv8.3

RISC-V

POWER

CompCert Weak MMs1. Declarative1. Declarative2. Preserves syntactic dependencies

(deps ∪ rf is acyclic)

1. Declarative2. Preserves syntactic dependencies(deps ∪ rf is acyclic)

3. Uses C11-style coherence(hb; eco? is irreflexive)

1. Declarative2. Preserves syntactic dependencies

(deps ∪ rf is acyclic)3. Uses C11-style coherence

(hb; eco? is irreflexive)4. Non-multicopy-atomic

w/o mutually recursive relations

plv.mpi-sws.org/imm/ Thank you!

Page 34: BridgingtheGapbetweenProgrammingLanguagesand ...plv.mpi-sws.org/imm/Podkopaev-al-POPL19-presentation.pdf · 1 BridgingtheGapbetweenPLandHardwareWeakMMs Programming Language Hardware

5

Bridging the Gap between PL and Hardware Weak MMs

Promise

(R)C11

WeakestMO[Chakraborty and Vafeiadis, 2019]

IMM

x86-TSO

ARMv7

ARMv8.3

RISC-V

POWER

CompCert Weak MMs1. Declarative1. Declarative2. Preserves syntactic dependencies

(deps ∪ rf is acyclic)

1. Declarative2. Preserves syntactic dependencies

(deps ∪ rf is acyclic)3. Uses C11-style coherence

(hb; eco? is irreflexive)

1. Declarative2. Preserves syntactic dependencies(deps ∪ rf is acyclic)

3. Uses C11-style coherence(hb; eco? is irreflexive)

4. Non-multicopy-atomicw/o mutually recursive relations

plv.mpi-sws.org/imm/ Thank you!

Page 35: BridgingtheGapbetweenProgrammingLanguagesand ...plv.mpi-sws.org/imm/Podkopaev-al-POPL19-presentation.pdf · 1 BridgingtheGapbetweenPLandHardwareWeakMMs Programming Language Hardware

5

Bridging the Gap between PL and Hardware Weak MMs

Promise

(R)C11

WeakestMO[Chakraborty and Vafeiadis, 2019]

IMM

x86-TSO

ARMv7

ARMv8.3

RISC-V

POWER

CompCert Weak MMs1. Declarative1. Declarative2. Preserves syntactic dependencies

(deps ∪ rf is acyclic)

1. Declarative2. Preserves syntactic dependencies

(deps ∪ rf is acyclic)3. Uses C11-style coherence

(hb; eco? is irreflexive)

1. Declarative2. Preserves syntactic dependencies

(deps ∪ rf is acyclic)3. Uses C11-style coherence

(hb; eco? is irreflexive)4. Non-multicopy-atomic

w/o mutually recursive relations

plv.mpi-sws.org/imm/ Thank you!

Page 36: BridgingtheGapbetweenProgrammingLanguagesand ...plv.mpi-sws.org/imm/Podkopaev-al-POPL19-presentation.pdf · 1 BridgingtheGapbetweenPLandHardwareWeakMMs Programming Language Hardware

5

Bridging the Gap between PL and Hardware Weak MMs

Promise

(R)C11

WeakestMO[Chakraborty and Vafeiadis, 2019]

IMM

x86-TSO

ARMv7

ARMv8.3

RISC-V

POWER

CompCert Weak MMs1. Declarative1. Declarative2. Preserves syntactic dependencies

(deps ∪ rf is acyclic)

1. Declarative2. Preserves syntactic dependencies

(deps ∪ rf is acyclic)3. Uses C11-style coherence

(hb; eco? is irreflexive)

1. Declarative2. Preserves syntactic dependencies

(deps ∪ rf is acyclic)3. Uses C11-style coherence

(hb; eco? is irreflexive)4. Non-multicopy-atomic

w/o mutually recursive relations

plv.mpi-sws.org/imm/ Thank you!

Page 37: BridgingtheGapbetweenProgrammingLanguagesand ...plv.mpi-sws.org/imm/Podkopaev-al-POPL19-presentation.pdf · 1 BridgingtheGapbetweenPLandHardwareWeakMMs Programming Language Hardware

5

Bridging the Gap between PL and Hardware Weak MMs

Promise

(R)C11

WeakestMO[Chakraborty and Vafeiadis, 2019]

IMM

x86-TSO

ARMv7

ARMv8.3

RISC-V

POWER

CompCert Weak MMs1. Declarative1. Declarative2. Preserves syntactic dependencies

(deps ∪ rf is acyclic)

1. Declarative2. Preserves syntactic dependencies

(deps ∪ rf is acyclic)3. Uses C11-style coherence

(hb; eco? is irreflexive)

1. Declarative2. Preserves syntactic dependencies

(deps ∪ rf is acyclic)3. Uses C11-style coherence

(hb; eco? is irreflexive)4. Non-multicopy-atomic

w/o mutually recursive relations

plv.mpi-sws.org/imm/ Thank you!

Page 38: BridgingtheGapbetweenProgrammingLanguagesand ...plv.mpi-sws.org/imm/Podkopaev-al-POPL19-presentation.pdf · 1 BridgingtheGapbetweenPLandHardwareWeakMMs Programming Language Hardware

6

(Operational) Execution in Promise

Promised

a := [x];[y] := 1;

b := [y];[x] := b;

Requires certification

Values;a = ⊥ b = ⊥

Page 39: BridgingtheGapbetweenProgrammingLanguagesand ...plv.mpi-sws.org/imm/Podkopaev-al-POPL19-presentation.pdf · 1 BridgingtheGapbetweenPLandHardwareWeakMMs Programming Language Hardware

6

(Operational) Execution in Promise

Promised

a := [x];[y] := 1;

b := [y];[x] := b;

Requires certification

Values;a = ⊥ b = ⊥

Page 40: BridgingtheGapbetweenProgrammingLanguagesand ...plv.mpi-sws.org/imm/Podkopaev-al-POPL19-presentation.pdf · 1 BridgingtheGapbetweenPLandHardwareWeakMMs Programming Language Hardware

6

(Operational) Execution in Promise

Promised

a := [x];[y] := 1;

b := [y];[x] := b;

Requires certification

Values;a = ⊥ b = ⊥

Page 41: BridgingtheGapbetweenProgrammingLanguagesand ...plv.mpi-sws.org/imm/Podkopaev-al-POPL19-presentation.pdf · 1 BridgingtheGapbetweenPLandHardwareWeakMMs Programming Language Hardware

6

(Operational) Execution in Promise

Promised

a := [x];[y] := 1;

b := [y];[x] := b;Requires certification

Values;a = ⊥ b = ⊥

Page 42: BridgingtheGapbetweenProgrammingLanguagesand ...plv.mpi-sws.org/imm/Podkopaev-al-POPL19-presentation.pdf · 1 BridgingtheGapbetweenPLandHardwareWeakMMs Programming Language Hardware

6

(Operational) Execution in Promise

Promised

a := [x];[y] := 1;

b := [y];[x] := b;

Requires certification

Values;a = ⊥ b = 1

Page 43: BridgingtheGapbetweenProgrammingLanguagesand ...plv.mpi-sws.org/imm/Podkopaev-al-POPL19-presentation.pdf · 1 BridgingtheGapbetweenPLandHardwareWeakMMs Programming Language Hardware

6

(Operational) Execution in Promise

Promised

a := [x];[y] := 1;

b := [y];[x] := b;

Requires certification

Values;a = ⊥ b = 1

Page 44: BridgingtheGapbetweenProgrammingLanguagesand ...plv.mpi-sws.org/imm/Podkopaev-al-POPL19-presentation.pdf · 1 BridgingtheGapbetweenPLandHardwareWeakMMs Programming Language Hardware

6

(Operational) Execution in Promise

Promised

a := [x];[y] := 1;

b := [y];[x] := b;

Requires certification

Values;a = 1 b = 1

Page 45: BridgingtheGapbetweenProgrammingLanguagesand ...plv.mpi-sws.org/imm/Podkopaev-al-POPL19-presentation.pdf · 1 BridgingtheGapbetweenPLandHardwareWeakMMs Programming Language Hardware

6

(Operational) Execution in Promise

Promised

a := [x];[y] := 1;

b := [y];[x] := b;

Requires certification

Values;a = 1 b = 1

Page 46: BridgingtheGapbetweenProgrammingLanguagesand ...plv.mpi-sws.org/imm/Podkopaev-al-POPL19-presentation.pdf · 1 BridgingtheGapbetweenPLandHardwareWeakMMs Programming Language Hardware

7

Bridging the Gap between PL and Hardware Weak MMs

Promise

(R)C11

WeakestMO[Chakraborty and Vafeiadis, 2019]

IMM

x86-TSO

ARMv7

ARMv8.3

RISC-V

POWER

CompCert Weak MMs1. Declarative1. Declarative2. Preserves syntactic dependencies

(deps ∪ rf is acyclic)

1. Declarative2. Preserves syntactic dependencies

(deps ∪ rf is acyclic)3. Uses C11-style coherence

(hb; eco? is irreflexive)

1. Declarative2. Preserves syntactic dependencies

(deps ∪ rf is acyclic)3. Uses C11-style coherence

(hb; eco? is irreflexive)4. Non-multicopy-atomic

w/o mutually recursive relations

plv.mpi-sws.org/imm/ Thank you!

Page 47: BridgingtheGapbetweenProgrammingLanguagesand ...plv.mpi-sws.org/imm/Podkopaev-al-POPL19-presentation.pdf · 1 BridgingtheGapbetweenPLandHardwareWeakMMs Programming Language Hardware

8

How to prove correctness ofcompilation?

Simulation

How to simulate graphs?

Traverse in proper order!

Page 48: BridgingtheGapbetweenProgrammingLanguagesand ...plv.mpi-sws.org/imm/Podkopaev-al-POPL19-presentation.pdf · 1 BridgingtheGapbetweenPLandHardwareWeakMMs Programming Language Hardware

8

How to prove correctness ofcompilation? Simulation

How to simulate graphs?

Traverse in proper order!

Page 49: BridgingtheGapbetweenProgrammingLanguagesand ...plv.mpi-sws.org/imm/Podkopaev-al-POPL19-presentation.pdf · 1 BridgingtheGapbetweenPLandHardwareWeakMMs Programming Language Hardware

8

How to prove correctness ofcompilation? Simulation

How to simulate graphs?

Traverse in proper order!

Page 50: BridgingtheGapbetweenProgrammingLanguagesand ...plv.mpi-sws.org/imm/Podkopaev-al-POPL19-presentation.pdf · 1 BridgingtheGapbetweenPLandHardwareWeakMMs Programming Language Hardware

8

How to prove correctness ofcompilation? Simulation

How to simulate graphs?

Traverse in proper order!

Page 51: BridgingtheGapbetweenProgrammingLanguagesand ...plv.mpi-sws.org/imm/Podkopaev-al-POPL19-presentation.pdf · 1 BridgingtheGapbetweenPLandHardwareWeakMMs Programming Language Hardware

9

Traversal of IMM executiona := [x];[y] := 1;

b := [y];[x] := b;

Promised

Promised

Rx1

Wy1

Ry1

Wx1

Covered

Issued

Page 52: BridgingtheGapbetweenProgrammingLanguagesand ...plv.mpi-sws.org/imm/Podkopaev-al-POPL19-presentation.pdf · 1 BridgingtheGapbetweenPLandHardwareWeakMMs Programming Language Hardware

10

Promise → IMM compilation correctness proof1. Operational semantics of IMM’s traversal:

G ⊢ ⟨C, I⟩ → ⟨C ′, I ′⟩

2. Completeness of traversal:

∀G ∈ JPKIMM. G ⊢ initTraverse →∗ ⟨G.Events,G.Writes⟩3. Simulation theorems:

initTraverse initPromisesimulated by traverse

traverse′

promise

∃ promise′

simulated by

simulated by

Promise’s certificationPromise’s certificationvia traversal ofcertification graph

Page 53: BridgingtheGapbetweenProgrammingLanguagesand ...plv.mpi-sws.org/imm/Podkopaev-al-POPL19-presentation.pdf · 1 BridgingtheGapbetweenPLandHardwareWeakMMs Programming Language Hardware

10

Promise → IMM compilation correctness proof1. Operational semantics of IMM’s traversal:

G ⊢ ⟨C, I⟩ → ⟨C ′, I ′⟩2. Completeness of traversal:

∀G ∈ JPKIMM. G ⊢ initTraverse →∗ ⟨G.Events,G.Writes⟩

3. Simulation theorems:

initTraverse initPromisesimulated by traverse

traverse′

promise

∃ promise′

simulated by

simulated by

Promise’s certificationPromise’s certificationvia traversal ofcertification graph

Page 54: BridgingtheGapbetweenProgrammingLanguagesand ...plv.mpi-sws.org/imm/Podkopaev-al-POPL19-presentation.pdf · 1 BridgingtheGapbetweenPLandHardwareWeakMMs Programming Language Hardware

10

Promise → IMM compilation correctness proof1. Operational semantics of IMM’s traversal:

G ⊢ ⟨C, I⟩ → ⟨C ′, I ′⟩2. Completeness of traversal:

∀G ∈ JPKIMM. G ⊢ initTraverse →∗ ⟨G.Events,G.Writes⟩3. Simulation theorems:

initTraverse initPromisesimulated by traverse

traverse′

promise

∃ promise′

simulated by

simulated by

Promise’s certificationPromise’s certificationvia traversal ofcertification graph

Page 55: BridgingtheGapbetweenProgrammingLanguagesand ...plv.mpi-sws.org/imm/Podkopaev-al-POPL19-presentation.pdf · 1 BridgingtheGapbetweenPLandHardwareWeakMMs Programming Language Hardware

10

Promise → IMM compilation correctness proof1. Operational semantics of IMM’s traversal:

G ⊢ ⟨C, I⟩ → ⟨C ′, I ′⟩2. Completeness of traversal:

∀G ∈ JPKIMM. G ⊢ initTraverse →∗ ⟨G.Events,G.Writes⟩3. Simulation theorems:

initTraverse initPromisesimulated by traverse

traverse′

promise

∃ promise′

simulated by

simulated by

Promise’s certificationPromise’s certificationvia traversal ofcertification graph

Page 56: BridgingtheGapbetweenProgrammingLanguagesand ...plv.mpi-sws.org/imm/Podkopaev-al-POPL19-presentation.pdf · 1 BridgingtheGapbetweenPLandHardwareWeakMMs Programming Language Hardware

10

Promise → IMM compilation correctness proof1. Operational semantics of IMM’s traversal:

G ⊢ ⟨C, I⟩ → ⟨C ′, I ′⟩2. Completeness of traversal:

∀G ∈ JPKIMM. G ⊢ initTraverse →∗ ⟨G.Events,G.Writes⟩3. Simulation theorems:

initTraverse initPromisesimulated by traverse

traverse′

promise

∃ promise′

simulated by

simulated by

Promise’s certification

Promise’s certificationvia traversal ofcertification graph

Page 57: BridgingtheGapbetweenProgrammingLanguagesand ...plv.mpi-sws.org/imm/Podkopaev-al-POPL19-presentation.pdf · 1 BridgingtheGapbetweenPLandHardwareWeakMMs Programming Language Hardware

10

Promise → IMM compilation correctness proof1. Operational semantics of IMM’s traversal:

G ⊢ ⟨C, I⟩ → ⟨C ′, I ′⟩2. Completeness of traversal:

∀G ∈ JPKIMM. G ⊢ initTraverse →∗ ⟨G.Events,G.Writes⟩3. Simulation theorems:

initTraverse initPromisesimulated by traverse

traverse′

promise

∃ promise′

simulated by

simulated by

Promise’s certification

Promise’s certificationvia traversal ofcertification graph

Page 58: BridgingtheGapbetweenProgrammingLanguagesand ...plv.mpi-sws.org/imm/Podkopaev-al-POPL19-presentation.pdf · 1 BridgingtheGapbetweenPLandHardwareWeakMMs Programming Language Hardware

11

Traversal of IMM executiona := [x];[y] := 1;

b := [y];[x] := b;

Promised Promised

Rx1

Wy1

Ry1

Wx1

Covered

Issued

Page 59: BridgingtheGapbetweenProgrammingLanguagesand ...plv.mpi-sws.org/imm/Podkopaev-al-POPL19-presentation.pdf · 1 BridgingtheGapbetweenPLandHardwareWeakMMs Programming Language Hardware

11

Traversal of IMM executiona := [x];[y] := 1;

b := [y];[x] := b;

Promised

Promised

Rx1

Wy1

Ry1

Wx1

Covered

Issued

Page 60: BridgingtheGapbetweenProgrammingLanguagesand ...plv.mpi-sws.org/imm/Podkopaev-al-POPL19-presentation.pdf · 1 BridgingtheGapbetweenPLandHardwareWeakMMs Programming Language Hardware

11

Traversal of IMM executiona := [x];[y] := 1;

b := [y];[x] := b;

Promised

Promised

Rx1

Wy1

Ry1

Wx1

Covered

Issued

Page 61: BridgingtheGapbetweenProgrammingLanguagesand ...plv.mpi-sws.org/imm/Podkopaev-al-POPL19-presentation.pdf · 1 BridgingtheGapbetweenPLandHardwareWeakMMs Programming Language Hardware

11

Traversal of IMM executiona := [x];[y] := 1;

b := [y];[x] := b;

Promised Promised

Rx1

Wy1

Ry1

Wx1

Covered

Issued

Page 62: BridgingtheGapbetweenProgrammingLanguagesand ...plv.mpi-sws.org/imm/Podkopaev-al-POPL19-presentation.pdf · 1 BridgingtheGapbetweenPLandHardwareWeakMMs Programming Language Hardware

11

Traversal of IMM executiona := [x];[y] := 1;

b := [y];[x] := b;

Promised

Promised

Rx1

Wy1

Ry1

Wx1

Covered

Issued

Page 63: BridgingtheGapbetweenProgrammingLanguagesand ...plv.mpi-sws.org/imm/Podkopaev-al-POPL19-presentation.pdf · 1 BridgingtheGapbetweenPLandHardwareWeakMMs Programming Language Hardware

11

Traversal of IMM executiona := [x];[y] := 1;

b := [y];[x] := b;

Promised

Promised

Rx1

Wy1

Ry1

Wx1

Covered

Issued

Page 64: BridgingtheGapbetweenProgrammingLanguagesand ...plv.mpi-sws.org/imm/Podkopaev-al-POPL19-presentation.pdf · 1 BridgingtheGapbetweenPLandHardwareWeakMMs Programming Language Hardware

11

Traversal of IMM executiona := [x];[y] := 1;

b := [y];[x] := b;

Promised Promised

Rx1

Wy1

Ry1

Wx1

Covered

Issued

Page 65: BridgingtheGapbetweenProgrammingLanguagesand ...plv.mpi-sws.org/imm/Podkopaev-al-POPL19-presentation.pdf · 1 BridgingtheGapbetweenPLandHardwareWeakMMs Programming Language Hardware

12

Bridging the Gap between PL and Hardware Weak MMs

Promise

(R)C11

WeakestMO[Chakraborty and Vafeiadis, 2019]

IMM

x86-TSO

ARMv7

ARMv8.3

RISC-V

POWER

CompCert Weak MMs1. Declarative1. Declarative2. Preserves syntactic dependencies

(deps ∪ rf is acyclic)

1. Declarative2. Preserves syntactic dependencies

(deps ∪ rf is acyclic)3. Uses C11-style coherence

(hb; eco? is irreflexive)

1. Declarative2. Preserves syntactic dependencies

(deps ∪ rf is acyclic)3. Uses C11-style coherence

(hb; eco? is irreflexive)4. Non-multicopy-atomic

w/o mutually recursive relations

plv.mpi-sws.org/imm/ Thank you!

Page 66: BridgingtheGapbetweenProgrammingLanguagesand ...plv.mpi-sws.org/imm/Podkopaev-al-POPL19-presentation.pdf · 1 BridgingtheGapbetweenPLandHardwareWeakMMs Programming Language Hardware

12

Bridging the Gap between PL and Hardware Weak MMs

Promise

(R)C11

WeakestMO[Chakraborty and Vafeiadis, 2019]

IMM

x86-TSO

ARMv7

ARMv8.3

RISC-V

POWER

CompCert Weak MMs1. Declarative1. Declarative2. Preserves syntactic dependencies

(deps ∪ rf is acyclic)

1. Declarative2. Preserves syntactic dependencies

(deps ∪ rf is acyclic)3. Uses C11-style coherence

(hb; eco? is irreflexive)

1. Declarative2. Preserves syntactic dependencies

(deps ∪ rf is acyclic)3. Uses C11-style coherence

(hb; eco? is irreflexive)4. Non-multicopy-atomic

w/o mutually recursive relations

plv.mpi-sws.org/imm/ Thank you!

Page 67: BridgingtheGapbetweenProgrammingLanguagesand ...plv.mpi-sws.org/imm/Podkopaev-al-POPL19-presentation.pdf · 1 BridgingtheGapbetweenPLandHardwareWeakMMs Programming Language Hardware

12

Bridging the Gap between PL and Hardware Weak MMs

Promise

(R)C11

WeakestMO[Chakraborty and Vafeiadis, 2019]

IMM

x86-TSO

ARMv7

ARMv8.3

RISC-V

POWER

CompCert Weak MMs

1. Declarative1. Declarative2. Preserves syntactic dependencies

(deps ∪ rf is acyclic)

1. Declarative2. Preserves syntactic dependencies

(deps ∪ rf is acyclic)3. Uses C11-style coherence

(hb; eco? is irreflexive)

1. Declarative2. Preserves syntactic dependencies

(deps ∪ rf is acyclic)3. Uses C11-style coherence

(hb; eco? is irreflexive)4. Non-multicopy-atomic

w/o mutually recursive relations

plv.mpi-sws.org/imm/ Thank you!

Page 68: BridgingtheGapbetweenProgrammingLanguagesand ...plv.mpi-sws.org/imm/Podkopaev-al-POPL19-presentation.pdf · 1 BridgingtheGapbetweenPLandHardwareWeakMMs Programming Language Hardware

12

Bridging the Gap between PL and Hardware Weak MMs

Promise

(R)C11

WeakestMO[Chakraborty and Vafeiadis, 2019]

IMM

x86-TSO

ARMv7

ARMv8.3

RISC-V

POWER

CompCert Weak MMs

1. Declarative1. Declarative2. Preserves syntactic dependencies

(deps ∪ rf is acyclic)

1. Declarative2. Preserves syntactic dependencies

(deps ∪ rf is acyclic)3. Uses C11-style coherence

(hb; eco? is irreflexive)

1. Declarative2. Preserves syntactic dependencies

(deps ∪ rf is acyclic)3. Uses C11-style coherence

(hb; eco? is irreflexive)4. Non-multicopy-atomic

w/o mutually recursive relations

plv.mpi-sws.org/imm/ Thank you!

Page 69: BridgingtheGapbetweenProgrammingLanguagesand ...plv.mpi-sws.org/imm/Podkopaev-al-POPL19-presentation.pdf · 1 BridgingtheGapbetweenPLandHardwareWeakMMs Programming Language Hardware

13

Links I

Chakraborty, S. and Vafeiadis, V. (2019).Grounding thin-air reads with event structures.In POPL 2019. ACM.Kang, J., Hur, C.-K., Lahav, O., Vafeiadis, V., and Dreyer, D. (2017).A promising semantics for relaxed-memory concurrency.In POPL 2017. ACM.

Page 70: BridgingtheGapbetweenProgrammingLanguagesand ...plv.mpi-sws.org/imm/Podkopaev-al-POPL19-presentation.pdf · 1 BridgingtheGapbetweenPLandHardwareWeakMMs Programming Language Hardware

14

Backup slides

Page 71: BridgingtheGapbetweenProgrammingLanguagesand ...plv.mpi-sws.org/imm/Podkopaev-al-POPL19-presentation.pdf · 1 BridgingtheGapbetweenPLandHardwareWeakMMs Programming Language Hardware

15

IMM definition

Def. G is called IMM-consistent if the following hold:• codom(G.rf) = G.R.• For every location ℓ ∈ Loc, G.co totally orders G.Wℓ.• G.rmw ∩ (G.fre ; G.coe) = ∅.• G.hb ; G.eco? is irreflexive.• G.ar is acyclic.

ar ≜ rfe ∪ bob ∪ ppo ∪ detour ∪ psc ∪ [Wstrong] ; po ; [W]bob ≜ po ; [Wrel] ∪ [Racq] ; po ∪ po ; [F] ∪ [F] ; po ∪ [Wrel] ; po|loc ; [W]ppo ≜ [R] ; (deps ∪ rfi)+ ; [W]deps ≜ data ∪ ctrl ∪ addr ; po? ∪ casdep ∪ [Rex] ; po

Page 72: BridgingtheGapbetweenProgrammingLanguagesand ...plv.mpi-sws.org/imm/Podkopaev-al-POPL19-presentation.pdf · 1 BridgingtheGapbetweenPLandHardwareWeakMMs Programming Language Hardware

16

Traversal definition

a ∈ Next(G,C) ∩ Coverable(G,C, I)G ⊢ ⟨C, I⟩ → ⟨C ∪ {a}, I⟩

w ∈ Issuable(G,C, I) \ IG ⊢ ⟨C, I⟩ → ⟨C, I ∪ {w}⟩

Def. w ∈ Issuable(G,C, I) iff w ∈ G.W and the following hold:• dom(([G.Wrel] ; G.po|G.loc ∪ [G.F] ; G.po) ; [w]) ⊆ C• dom((G.detour ∪ G.rfe) ; G.ppo ; [w]) ⊆ I• dom((G.detour ∪ G.rfe) ; [G.Racq] ; G.po ; [w]) ⊆ I• dom([G.Wstrong] ; G.po ; [w]) ⊆ I

Def. e ∈ Coverable(G,C, I) iff e ∈ G.E, dom(G.po ; [e]) ⊆ C and either(i) e ∈ G.W ∩ I; (ii) e ∈ G.R and dom(G.rf ; [e]) ⊆ I;(iii) e ∈ G.F<sc; or (iv) e ∈ G.Fsc and dom(G.sc ; [e]) ⊆ C.

Page 73: BridgingtheGapbetweenProgrammingLanguagesand ...plv.mpi-sws.org/imm/Podkopaev-al-POPL19-presentation.pdf · 1 BridgingtheGapbetweenPLandHardwareWeakMMs Programming Language Hardware

17

Mistake in Kang et al.17’s compilation to POWER correctness proof

Rrlxz1

Fsc

Wrlxx1

Wrlxx2

Fsc

Wrlxy1

Rrlxy1

Wrlxz1

rf

corf

Consistent in Strong-POWER.Not consistent in the promise-free declarative model of[Kang et al., 2017].

Page 74: BridgingtheGapbetweenProgrammingLanguagesand ...plv.mpi-sws.org/imm/Podkopaev-al-POPL19-presentation.pdf · 1 BridgingtheGapbetweenPLandHardwareWeakMMs Programming Language Hardware

18

Promise → IMM compilation of RMWs

a := [y]rlx // 1[z]rlx := a

b := [z]rlx // 1c := FADDrlx,rel

strong (x, 1) // 0[y]rlx := c+ 1

Rrlxy1

Wrlxz1

Rrlxz1

Rrlxx0

Wrelstrongx1

Wrlxy1

data rmwdata

bobrfe