SlideShare a Scribd company logo
Round-Up:
Runtime Checking Quasi Linearizability
of Concurrent Data Structures
Lu Zhang (Virginia Tech)
Arijit Chattopadhyay (Virginia Tech)
Chao Wang (Virginia Tech)
1
Concurrent Data Structures
2
Queues, stacks,… can be parallelized, but should
behave like their sequential counterparts.
Now a de facto
correctness standard
Linearizability: The Definition
3
Linearizability: The Idea
Each method call should “take effect” instantaneously at
some moment between its invocation and its response.
4
4
q.enq(x)
time
q.enq(y)
Linearization Point
Case I: Is this linearizable?
q.enq(x)
q.enq(y)
q.deq(y)
time
q.deq(x)
Yes!
5
q.enq(x) q.enq(y) q.deq(x) q.deq(y)
6
6
q.enq(x) q.deq(y)
time
q.enq(y)
q.deq(x)
Case II: Is this linearizable? No!
Example: Linearizability Violation
temp=count+1;
count=temp;
count = 0;
count =2;
Thread 1: inc()
temp=count+1=1;
count=temp=1;
Thread 2: inc()
temp=count+1=2;
count=temp=2;
A correct execution
Thread 2: inc()
temp=count+1=1;
count=temp=1;
Thread 1: inc()
temp=count+1=1;
count=temp=1;
count = 0;
count =1;
A buggy execution
7
Outline
• Motivation
• What is (quasi) linearizability
• How to check it
• Experiments
• Conclusions
8
Problem: Linearizability can be expensive
• Imposes undue synchronization …
– Performance issues
– Scalability issues
• … that often can be relaxed in many applications
– Scheduler in a task pool
• strict FIFO queue is not required
– Data caching in web
• stale data is acceptable if delay is bounded
– ID generator in distributed systems
• may be out-of-order occasionally
– Shared counter
• Not necessary to be strictly ordered
9
Quasi Linearizability
10
Bounded out-of-order
behaviors
Significant performance
increase
Our Contribution
• First method for checking quasi linearizability in the C/C++
code of concurrent data structure implementations
• Implementation based on
• Clang/LLVM -- for code instrumentation
• Inspect -- a systematic concurrency testing tool
• Detected previously unknown bug
– Scal benchmarks
11
Some Related Work
12
• Theorem Proving
– [V. Vafeiadis VMCAI 2009 ]
… requires significant manual effort
• Model Checking
– [Liu et al FM 2009]
… works only on models, not on the actual source code
implementation
• Runtime Verification
– [S. Burckhardt et al PLDI 2010]
… checks standard linearizability only
Outline
• Motivation
• What is quasi linearizability
• How to check it
• Experiments
• Conclusions
13
Example: Quasi Queue
1. Conceptual Model:
2. Implementation:
14
Quasi Factor=4
Example: Legal Histories
15
Quasi Factor=1
Linearizable
Quasi
Linearizable
Concurrent
Histories
Onion Ring Relationship
16
Linearizable
Histories
Quasi Linearizable
Histories
Our Method
Buggy
Histories
Existing Methods
Outline
• Motivation
• What is quasi linearizability
• How to check it
– Phase 1: generate sequential histories
– Phase 2: generate concurrent histories
• Experiments
• Conclusions
17
3 Verification Levels
In this work, we focus on L1 and L2.
18
Input and Output
• Input
– C/C++ code of the concurrent data structure
– C/C++ code of the test program
– Quasi factor
• Output
– Whether there is a (quasi) linearizability violation
• Debugging info to help understand the violation
19
Overall Workflow
20
Linearizing A Concurrent History
• We compute the linearizations (sequential permutation) by
repeatly untangling the overlapping events
• Overlapping Pattern: … [inv1] … [inv2] … [resp1] …
21
Computing Quasi Permutations
Quasi Queue , k=1
22
Computing Quasi Permutations (alg.)
• Use a doubly linked list to represent the state stack
• Each method call moves object from one state to another
• Use a backtrack exploration to find all quasi permutations
…
deq(3)
deq(1)
23
Quasi Queue , k=1
Newly Enabled Set
• How earlier each method call can occur
24
k=0
k=1
k=2
Restriction 1 Guaranteed!
Lateness Of Method Calls
• How later each method call can occur
• Assign Lateness when enabled
25
Lateness < 0
Lateness = 0
Lateness > 0
k=1
New Enabled:
deq(1), L= 0
deq(2), L= -1
New Enabled:
deq(3), L= -1
New Enabled:
Lateness +1 when not selected
Lateness should always <= quasi factor
Lateness is unique in each state
Backtrack Exploration, K=1
26
Enabled:
deq(1), L=0
deq(2), L= -1
Enabled:
deq(3), L= -1
deq(2), L= -1+1=0
Enabled:
deq(3), L=0
s1 s2 s3
Last backtrack point
Enabled:
deq(1), L=0
deq(2), L= -1
s1 s2
Enabled:
deq(3), L= -1
deq(2), L= -1+1=0
Original
history
s3'
Enabled:
deq(2), L=0+1=1
Last backtrack point
…
…
History: deq(1) deq(2) deq(3)
Must-Select Event
• Lateness should always <= k(quasi factor)
• If the lateness of a method call reaches k, then we
must select it at that state.
• Backtrack Exploration Done!
27
Enabled:
deq(1), L=0
deq(2), L= -1
s1 s2''
Enabled:
deq(3), L= -1
deq(1), L= 0+1=1
L = 1 = k, we must select it !
Restriction 2 Guaranteed!
s3''
Enabled:
deq(3), L= -1+1=0
…
No more backtrack points
Check Quasi Linearizability
28
Outline
• Motivation
• What is quasi linearizability
• How to check it
– Phase 1: generate sequential histories
– Phase 2: generate concurrent histories
• Experiments
• Conclusions
29
Experiments
• The Round-Up tool
– LLVM
– Inspect
• Evaluated on two sets of benchmarks
– Textbook examples
– The Scal benchmarks
30
Results (1)
31
Results (2)
• Results on the Scal benchmark examples
32
The k-stack bug
2
Thread 1:
push(2)
Thread 2:
pop()
2
Empty
Segment!
Push the item
in
Try to remove
Segment
Double check
push: Fail !
Double check
remove: Fail !
Need to retry,
push again
Normal push
…
Normal pop
…
To be removed
2
2
2
33
Outline
• Motivation
• What is quasi linearizability
• How to check it
– Phase 1: generate sequential histories
– Phase 2: generate concurrent histories
• Experiments
• Conclusions
34
Conclusions
• First method for checking quasi
linearizability of C/C++ code of concurrent
data structures
– Fully automated
– Sound, no false positives
• Future work
– Scalability remains a bottleneck
• Add new symmetry reduction techniques and
improve the existing partial order reduction
• Avoid generating redundant quasi permutations
35
Questions?
36
Some Related Work
37
• Theorem Proving
– [V. Vafeiadis VMCAI 2009 ]
– [V. Vafeiadis et al PPOPP 2006]
… requires manual effort
• Model Checking
– [Liu et al FM 2009]
– [M. T. Vechev et al SPIN 2009]
– [P. Cern′y et al CAV 2010]
– [K. Adhikari et al SPIN 2013]
… works on models, not on the actual source code
implementation
• Runtime Verification
– [S. Burckhardt et al PLDI 2010]
– [M. Pradel et al PLDI 2012]
… checks standard linearizability

More Related Content

What's hot

Bubble Sort algorithm in Assembly Language
Bubble Sort algorithm in Assembly LanguageBubble Sort algorithm in Assembly Language
Bubble Sort algorithm in Assembly Language
Ariel Tonatiuh Espindola
 
Algorithms - Aaron Bloomfield
Algorithms - Aaron BloomfieldAlgorithms - Aaron Bloomfield
Algorithms - Aaron Bloomfield
Reggie Niccolo Santos
 
Parametrized Model Checking of Fault Tolerant Distributed Algorithms by Abstr...
Parametrized Model Checking of Fault Tolerant Distributed Algorithms by Abstr...Parametrized Model Checking of Fault Tolerant Distributed Algorithms by Abstr...
Parametrized Model Checking of Fault Tolerant Distributed Algorithms by Abstr...
Iosif Itkin
 
BEC-26 control-systems_unit-III_pdf
BEC-26 control-systems_unit-III_pdfBEC-26 control-systems_unit-III_pdf
BEC-26 control-systems_unit-III_pdf
Shadab Siddiqui
 
Sienna 1 intro
Sienna 1 introSienna 1 intro
Sienna 1 introchidabdu
 
#6 formal methods – loop proof using induction method
#6 formal methods – loop proof using induction method#6 formal methods – loop proof using induction method
#6 formal methods – loop proof using induction method
Sharif Omar Salem
 
#7 formal methods – loop proof examples
#7 formal methods – loop proof   examples#7 formal methods – loop proof   examples
#7 formal methods – loop proof examples
Sharif Omar Salem
 
Temporal logic-model-checking
Temporal logic-model-checkingTemporal logic-model-checking
Temporal logic-model-checking
Dr. Jayaraj Poroor
 
Algorithm Analysis
Algorithm AnalysisAlgorithm Analysis
Algorithm Analysis
Megha V
 
Model Checking Tutorial
Model Checking TutorialModel Checking Tutorial
Model Checking Tutorial
Anit Thapaliya
 
Classic Model Checking Algorithms
Classic Model Checking AlgorithmsClassic Model Checking Algorithms
Classic Model Checking Algorithmstyramisu
 
Sensor Fusion Study - Ch15. The Particle Filter [Seoyeon Stella Yang]
Sensor Fusion Study - Ch15. The Particle Filter [Seoyeon Stella Yang]Sensor Fusion Study - Ch15. The Particle Filter [Seoyeon Stella Yang]
Sensor Fusion Study - Ch15. The Particle Filter [Seoyeon Stella Yang]
AI Robotics KR
 
Data Structures - Searching & sorting
Data Structures - Searching & sortingData Structures - Searching & sorting
Data Structures - Searching & sorting
Kaushal Shah
 
Algorithms Lecture 1: Introduction to Algorithms
Algorithms Lecture 1: Introduction to AlgorithmsAlgorithms Lecture 1: Introduction to Algorithms
Algorithms Lecture 1: Introduction to Algorithms
Mohamed Loey
 
Sequential and Parallel Searching Algorithms
Sequential and Parallel Searching AlgorithmsSequential and Parallel Searching Algorithms
Sequential and Parallel Searching Algorithms
Suresh Pokharel
 

What's hot (17)

Sorting algorithms
Sorting algorithmsSorting algorithms
Sorting algorithms
 
Bubble Sort algorithm in Assembly Language
Bubble Sort algorithm in Assembly LanguageBubble Sort algorithm in Assembly Language
Bubble Sort algorithm in Assembly Language
 
Algorithms - Aaron Bloomfield
Algorithms - Aaron BloomfieldAlgorithms - Aaron Bloomfield
Algorithms - Aaron Bloomfield
 
Parametrized Model Checking of Fault Tolerant Distributed Algorithms by Abstr...
Parametrized Model Checking of Fault Tolerant Distributed Algorithms by Abstr...Parametrized Model Checking of Fault Tolerant Distributed Algorithms by Abstr...
Parametrized Model Checking of Fault Tolerant Distributed Algorithms by Abstr...
 
BEC-26 control-systems_unit-III_pdf
BEC-26 control-systems_unit-III_pdfBEC-26 control-systems_unit-III_pdf
BEC-26 control-systems_unit-III_pdf
 
Sorting
SortingSorting
Sorting
 
Sienna 1 intro
Sienna 1 introSienna 1 intro
Sienna 1 intro
 
#6 formal methods – loop proof using induction method
#6 formal methods – loop proof using induction method#6 formal methods – loop proof using induction method
#6 formal methods – loop proof using induction method
 
#7 formal methods – loop proof examples
#7 formal methods – loop proof   examples#7 formal methods – loop proof   examples
#7 formal methods – loop proof examples
 
Temporal logic-model-checking
Temporal logic-model-checkingTemporal logic-model-checking
Temporal logic-model-checking
 
Algorithm Analysis
Algorithm AnalysisAlgorithm Analysis
Algorithm Analysis
 
Model Checking Tutorial
Model Checking TutorialModel Checking Tutorial
Model Checking Tutorial
 
Classic Model Checking Algorithms
Classic Model Checking AlgorithmsClassic Model Checking Algorithms
Classic Model Checking Algorithms
 
Sensor Fusion Study - Ch15. The Particle Filter [Seoyeon Stella Yang]
Sensor Fusion Study - Ch15. The Particle Filter [Seoyeon Stella Yang]Sensor Fusion Study - Ch15. The Particle Filter [Seoyeon Stella Yang]
Sensor Fusion Study - Ch15. The Particle Filter [Seoyeon Stella Yang]
 
Data Structures - Searching & sorting
Data Structures - Searching & sortingData Structures - Searching & sorting
Data Structures - Searching & sorting
 
Algorithms Lecture 1: Introduction to Algorithms
Algorithms Lecture 1: Introduction to AlgorithmsAlgorithms Lecture 1: Introduction to Algorithms
Algorithms Lecture 1: Introduction to Algorithms
 
Sequential and Parallel Searching Algorithms
Sequential and Parallel Searching AlgorithmsSequential and Parallel Searching Algorithms
Sequential and Parallel Searching Algorithms
 

Viewers also liked

Caligaris discalculia-05-05-2010-101116025852-phpapp01
Caligaris discalculia-05-05-2010-101116025852-phpapp01Caligaris discalculia-05-05-2010-101116025852-phpapp01
Caligaris discalculia-05-05-2010-101116025852-phpapp01giovtrione
 
Bad Credit Loans Nova Scotia - Worth Subsequent Terms For Subsidize
Bad Credit Loans Nova Scotia - Worth Subsequent Terms For SubsidizeBad Credit Loans Nova Scotia - Worth Subsequent Terms For Subsidize
Bad Credit Loans Nova Scotia - Worth Subsequent Terms For SubsidizeOwen Avery
 
membuat aplikasi quiz android dengan intel xdk
membuat aplikasi quiz android dengan intel xdkmembuat aplikasi quiz android dengan intel xdk
membuat aplikasi quiz android dengan intel xdk
fetdi sudarto
 
Storms
StormsStorms
Storms
nies1960
 
Lean startup - Agicalkväll #58
Lean startup -  Agicalkväll #58Lean startup -  Agicalkväll #58
Lean startup - Agicalkväll #58
Bengt Nyman
 

Viewers also liked (7)

Caligaris discalculia-05-05-2010-101116025852-phpapp01
Caligaris discalculia-05-05-2010-101116025852-phpapp01Caligaris discalculia-05-05-2010-101116025852-phpapp01
Caligaris discalculia-05-05-2010-101116025852-phpapp01
 
Bad Credit Loans Nova Scotia - Worth Subsequent Terms For Subsidize
Bad Credit Loans Nova Scotia - Worth Subsequent Terms For SubsidizeBad Credit Loans Nova Scotia - Worth Subsequent Terms For Subsidize
Bad Credit Loans Nova Scotia - Worth Subsequent Terms For Subsidize
 
Ultrasound
UltrasoundUltrasound
Ultrasound
 
membuat aplikasi quiz android dengan intel xdk
membuat aplikasi quiz android dengan intel xdkmembuat aplikasi quiz android dengan intel xdk
membuat aplikasi quiz android dengan intel xdk
 
Storms
StormsStorms
Storms
 
Perkataan bm 4
Perkataan bm 4Perkataan bm 4
Perkataan bm 4
 
Lean startup - Agicalkväll #58
Lean startup -  Agicalkväll #58Lean startup -  Agicalkväll #58
Lean startup - Agicalkväll #58
 

Similar to Round-Up: Runtime Checking Quasi Linearizability of Concurrent Data Structures

QX Simulator and quantum programming - 2020-04-28
QX Simulator and quantum programming - 2020-04-28QX Simulator and quantum programming - 2020-04-28
QX Simulator and quantum programming - 2020-04-28
Aritra Sarkar
 
Financial Networks III. Centrality and Systemic Importance
Financial Networks III. Centrality and Systemic ImportanceFinancial Networks III. Centrality and Systemic Importance
Financial Networks III. Centrality and Systemic Importance
Kimmo Soramaki
 
Concurrency in Distributed Systems : Leslie Lamport papers
Concurrency in Distributed Systems : Leslie Lamport papersConcurrency in Distributed Systems : Leslie Lamport papers
Concurrency in Distributed Systems : Leslie Lamport papers
Subhajit Sahu
 
20100522 software verification_sharygina_lecture01
20100522 software verification_sharygina_lecture0120100522 software verification_sharygina_lecture01
20100522 software verification_sharygina_lecture01Computer Science Club
 
Spacey random walks and higher order Markov chains
Spacey random walks and higher order Markov chainsSpacey random walks and higher order Markov chains
Spacey random walks and higher order Markov chains
David Gleich
 
Quarks zk study-club
Quarks zk study-clubQuarks zk study-club
Quarks zk study-club
Alex Pruden
 
Quasi-Linearizability: relaxed consistency for improved concurrency.
Quasi-Linearizability: relaxed consistency for improved concurrency.Quasi-Linearizability: relaxed consistency for improved concurrency.
Quasi-Linearizability: relaxed consistency for improved concurrency.Guy Korland
 
Dealing with the Three Horrible Problems in Verification
Dealing with the Three Horrible Problems in VerificationDealing with the Three Horrible Problems in Verification
Dealing with the Three Horrible Problems in VerificationDVClub
 
Lightweight Neighborhood Cardinality Estimation in Dynamic Wireless Networks ...
Lightweight Neighborhood Cardinality Estimation in Dynamic Wireless Networks ...Lightweight Neighborhood Cardinality Estimation in Dynamic Wireless Networks ...
Lightweight Neighborhood Cardinality Estimation in Dynamic Wireless Networks ...
Marco Cattani
 
An Introduction to Quantum Programming Languages
An Introduction to Quantum Programming LanguagesAn Introduction to Quantum Programming Languages
An Introduction to Quantum Programming Languages
David Yonge-Mallo
 
ARIMA
ARIMA ARIMA
Authentication protocols based on zero knowledge proof (Part 2 - Brief talk)
Authentication protocols based on zero knowledge proof (Part 2 - Brief talk)Authentication protocols based on zero knowledge proof (Part 2 - Brief talk)
Authentication protocols based on zero knowledge proof (Part 2 - Brief talk)
Israel Buitron
 
Functional Programming and Composing Actors
Functional Programming and Composing ActorsFunctional Programming and Composing Actors
Functional Programming and Composing Actors
legendofklang
 
Machine Learning in q/kdb+ - Teaching KDB to Read Japanese
Machine Learning in q/kdb+ - Teaching KDB to Read JapaneseMachine Learning in q/kdb+ - Teaching KDB to Read Japanese
Machine Learning in q/kdb+ - Teaching KDB to Read Japanese
Mark Lefevre, CQF
 
forecasting model
forecasting modelforecasting model
forecasting model
FEG
 
2017 10 17_quantum_program_v2
2017 10 17_quantum_program_v22017 10 17_quantum_program_v2
2017 10 17_quantum_program_v2
Francisco J. Gálvez Ramírez
 
Search and optimization on quantum accelerators - 2019-05-23
Search and optimization on quantum accelerators - 2019-05-23Search and optimization on quantum accelerators - 2019-05-23
Search and optimization on quantum accelerators - 2019-05-23
Aritra Sarkar
 
Realtime Analytics
Realtime AnalyticsRealtime Analytics
Realtime Analytics
eXascale Infolab
 

Similar to Round-Up: Runtime Checking Quasi Linearizability of Concurrent Data Structures (20)

QX Simulator and quantum programming - 2020-04-28
QX Simulator and quantum programming - 2020-04-28QX Simulator and quantum programming - 2020-04-28
QX Simulator and quantum programming - 2020-04-28
 
Financial Networks III. Centrality and Systemic Importance
Financial Networks III. Centrality and Systemic ImportanceFinancial Networks III. Centrality and Systemic Importance
Financial Networks III. Centrality and Systemic Importance
 
Concurrency in Distributed Systems : Leslie Lamport papers
Concurrency in Distributed Systems : Leslie Lamport papersConcurrency in Distributed Systems : Leslie Lamport papers
Concurrency in Distributed Systems : Leslie Lamport papers
 
20100522 software verification_sharygina_lecture01
20100522 software verification_sharygina_lecture0120100522 software verification_sharygina_lecture01
20100522 software verification_sharygina_lecture01
 
Spacey random walks and higher order Markov chains
Spacey random walks and higher order Markov chainsSpacey random walks and higher order Markov chains
Spacey random walks and higher order Markov chains
 
Quarks zk study-club
Quarks zk study-clubQuarks zk study-club
Quarks zk study-club
 
Quasi-Linearizability: relaxed consistency for improved concurrency.
Quasi-Linearizability: relaxed consistency for improved concurrency.Quasi-Linearizability: relaxed consistency for improved concurrency.
Quasi-Linearizability: relaxed consistency for improved concurrency.
 
Dealing with the Three Horrible Problems in Verification
Dealing with the Three Horrible Problems in VerificationDealing with the Three Horrible Problems in Verification
Dealing with the Three Horrible Problems in Verification
 
Lightweight Neighborhood Cardinality Estimation in Dynamic Wireless Networks ...
Lightweight Neighborhood Cardinality Estimation in Dynamic Wireless Networks ...Lightweight Neighborhood Cardinality Estimation in Dynamic Wireless Networks ...
Lightweight Neighborhood Cardinality Estimation in Dynamic Wireless Networks ...
 
An Introduction to Quantum Programming Languages
An Introduction to Quantum Programming LanguagesAn Introduction to Quantum Programming Languages
An Introduction to Quantum Programming Languages
 
02 analysis
02 analysis02 analysis
02 analysis
 
ARIMA
ARIMA ARIMA
ARIMA
 
Authentication protocols based on zero knowledge proof (Part 2 - Brief talk)
Authentication protocols based on zero knowledge proof (Part 2 - Brief talk)Authentication protocols based on zero knowledge proof (Part 2 - Brief talk)
Authentication protocols based on zero knowledge proof (Part 2 - Brief talk)
 
Functional Programming and Composing Actors
Functional Programming and Composing ActorsFunctional Programming and Composing Actors
Functional Programming and Composing Actors
 
Machine Learning in q/kdb+ - Teaching KDB to Read Japanese
Machine Learning in q/kdb+ - Teaching KDB to Read JapaneseMachine Learning in q/kdb+ - Teaching KDB to Read Japanese
Machine Learning in q/kdb+ - Teaching KDB to Read Japanese
 
forecasting model
forecasting modelforecasting model
forecasting model
 
2017 10 17_quantum_program_v2
2017 10 17_quantum_program_v22017 10 17_quantum_program_v2
2017 10 17_quantum_program_v2
 
Analysis
AnalysisAnalysis
Analysis
 
Search and optimization on quantum accelerators - 2019-05-23
Search and optimization on quantum accelerators - 2019-05-23Search and optimization on quantum accelerators - 2019-05-23
Search and optimization on quantum accelerators - 2019-05-23
 
Realtime Analytics
Realtime AnalyticsRealtime Analytics
Realtime Analytics
 

Recently uploaded

Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
Globus
 
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptxText-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
ShamsuddeenMuhammadA
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
Juraj Vysvader
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
Globus
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
Aftab Hussain
 
How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good Practices
Globus
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Crescat
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
Safe Software
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
Fermin Galan
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Globus
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Globus
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Globus
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
abdulrafaychaudhry
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
Google
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
AMB-Review
 
APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)
Boni García
 
How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
wottaspaceseo
 

Recently uploaded (20)

Vitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume MontevideoVitthal Shirke Microservices Resume Montevideo
Vitthal Shirke Microservices Resume Montevideo
 
Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024Globus Compute wth IRI Workflows - GlobusWorld 2024
Globus Compute wth IRI Workflows - GlobusWorld 2024
 
First Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User EndpointsFirst Steps with Globus Compute Multi-User Endpoints
First Steps with Globus Compute Multi-User Endpoints
 
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptxText-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
Text-Summarization-of-Breaking-News-Using-Fine-tuning-BART-Model.pptx
 
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
In 2015, I used to write extensions for Joomla, WordPress, phpBB3, etc and I ...
 
Understanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSageUnderstanding Globus Data Transfers with NetSage
Understanding Globus Data Transfers with NetSage
 
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of CodeA Study of Variable-Role-based Feature Enrichment in Neural Models of Code
A Study of Variable-Role-based Feature Enrichment in Neural Models of Code
 
How to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good PracticesHow to Position Your Globus Data Portal for Success Ten Good Practices
How to Position Your Globus Data Portal for Success Ten Good Practices
 
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
Introducing Crescat - Event Management Software for Venues, Festivals and Eve...
 
Essentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FMEEssentials of Automations: The Art of Triggers and Actions in FME
Essentials of Automations: The Art of Triggers and Actions in FME
 
Vitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdfVitthal Shirke Java Microservices Resume.pdf
Vitthal Shirke Java Microservices Resume.pdf
 
Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604Orion Context Broker introduction 20240604
Orion Context Broker introduction 20240604
 
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...
 
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisProviding Globus Services to Users of JASMIN for Environmental Data Analysis
Providing Globus Services to Users of JASMIN for Environmental Data Analysis
 
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
Innovating Inference - Remote Triggering of Large Language Models on HPC Clus...
 
Lecture 1 Introduction to games development
Lecture 1 Introduction to games developmentLecture 1 Introduction to games development
Lecture 1 Introduction to games development
 
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI AppAI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
AI Fusion Buddy Review: Brand New, Groundbreaking Gemini-Powered AI App
 
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdfDominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
Dominate Social Media with TubeTrivia AI’s Addictive Quiz Videos.pdf
 
APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)APIs for Browser Automation (MoT Meetup 2024)
APIs for Browser Automation (MoT Meetup 2024)
 
How Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptxHow Recreation Management Software Can Streamline Your Operations.pptx
How Recreation Management Software Can Streamline Your Operations.pptx
 

Round-Up: Runtime Checking Quasi Linearizability of Concurrent Data Structures

  • 1. Round-Up: Runtime Checking Quasi Linearizability of Concurrent Data Structures Lu Zhang (Virginia Tech) Arijit Chattopadhyay (Virginia Tech) Chao Wang (Virginia Tech) 1
  • 2. Concurrent Data Structures 2 Queues, stacks,… can be parallelized, but should behave like their sequential counterparts. Now a de facto correctness standard
  • 4. Linearizability: The Idea Each method call should “take effect” instantaneously at some moment between its invocation and its response. 4 4 q.enq(x) time q.enq(y) Linearization Point
  • 5. Case I: Is this linearizable? q.enq(x) q.enq(y) q.deq(y) time q.deq(x) Yes! 5 q.enq(x) q.enq(y) q.deq(x) q.deq(y)
  • 7. Example: Linearizability Violation temp=count+1; count=temp; count = 0; count =2; Thread 1: inc() temp=count+1=1; count=temp=1; Thread 2: inc() temp=count+1=2; count=temp=2; A correct execution Thread 2: inc() temp=count+1=1; count=temp=1; Thread 1: inc() temp=count+1=1; count=temp=1; count = 0; count =1; A buggy execution 7
  • 8. Outline • Motivation • What is (quasi) linearizability • How to check it • Experiments • Conclusions 8
  • 9. Problem: Linearizability can be expensive • Imposes undue synchronization … – Performance issues – Scalability issues • … that often can be relaxed in many applications – Scheduler in a task pool • strict FIFO queue is not required – Data caching in web • stale data is acceptable if delay is bounded – ID generator in distributed systems • may be out-of-order occasionally – Shared counter • Not necessary to be strictly ordered 9
  • 11. Our Contribution • First method for checking quasi linearizability in the C/C++ code of concurrent data structure implementations • Implementation based on • Clang/LLVM -- for code instrumentation • Inspect -- a systematic concurrency testing tool • Detected previously unknown bug – Scal benchmarks 11
  • 12. Some Related Work 12 • Theorem Proving – [V. Vafeiadis VMCAI 2009 ] … requires significant manual effort • Model Checking – [Liu et al FM 2009] … works only on models, not on the actual source code implementation • Runtime Verification – [S. Burckhardt et al PLDI 2010] … checks standard linearizability only
  • 13. Outline • Motivation • What is quasi linearizability • How to check it • Experiments • Conclusions 13
  • 14. Example: Quasi Queue 1. Conceptual Model: 2. Implementation: 14 Quasi Factor=4
  • 15. Example: Legal Histories 15 Quasi Factor=1 Linearizable Quasi Linearizable
  • 16. Concurrent Histories Onion Ring Relationship 16 Linearizable Histories Quasi Linearizable Histories Our Method Buggy Histories Existing Methods
  • 17. Outline • Motivation • What is quasi linearizability • How to check it – Phase 1: generate sequential histories – Phase 2: generate concurrent histories • Experiments • Conclusions 17
  • 18. 3 Verification Levels In this work, we focus on L1 and L2. 18
  • 19. Input and Output • Input – C/C++ code of the concurrent data structure – C/C++ code of the test program – Quasi factor • Output – Whether there is a (quasi) linearizability violation • Debugging info to help understand the violation 19
  • 21. Linearizing A Concurrent History • We compute the linearizations (sequential permutation) by repeatly untangling the overlapping events • Overlapping Pattern: … [inv1] … [inv2] … [resp1] … 21
  • 23. Computing Quasi Permutations (alg.) • Use a doubly linked list to represent the state stack • Each method call moves object from one state to another • Use a backtrack exploration to find all quasi permutations … deq(3) deq(1) 23 Quasi Queue , k=1
  • 24. Newly Enabled Set • How earlier each method call can occur 24 k=0 k=1 k=2 Restriction 1 Guaranteed!
  • 25. Lateness Of Method Calls • How later each method call can occur • Assign Lateness when enabled 25 Lateness < 0 Lateness = 0 Lateness > 0 k=1 New Enabled: deq(1), L= 0 deq(2), L= -1 New Enabled: deq(3), L= -1 New Enabled: Lateness +1 when not selected Lateness should always <= quasi factor Lateness is unique in each state
  • 26. Backtrack Exploration, K=1 26 Enabled: deq(1), L=0 deq(2), L= -1 Enabled: deq(3), L= -1 deq(2), L= -1+1=0 Enabled: deq(3), L=0 s1 s2 s3 Last backtrack point Enabled: deq(1), L=0 deq(2), L= -1 s1 s2 Enabled: deq(3), L= -1 deq(2), L= -1+1=0 Original history s3' Enabled: deq(2), L=0+1=1 Last backtrack point … … History: deq(1) deq(2) deq(3)
  • 27. Must-Select Event • Lateness should always <= k(quasi factor) • If the lateness of a method call reaches k, then we must select it at that state. • Backtrack Exploration Done! 27 Enabled: deq(1), L=0 deq(2), L= -1 s1 s2'' Enabled: deq(3), L= -1 deq(1), L= 0+1=1 L = 1 = k, we must select it ! Restriction 2 Guaranteed! s3'' Enabled: deq(3), L= -1+1=0 … No more backtrack points
  • 29. Outline • Motivation • What is quasi linearizability • How to check it – Phase 1: generate sequential histories – Phase 2: generate concurrent histories • Experiments • Conclusions 29
  • 30. Experiments • The Round-Up tool – LLVM – Inspect • Evaluated on two sets of benchmarks – Textbook examples – The Scal benchmarks 30
  • 32. Results (2) • Results on the Scal benchmark examples 32
  • 33. The k-stack bug 2 Thread 1: push(2) Thread 2: pop() 2 Empty Segment! Push the item in Try to remove Segment Double check push: Fail ! Double check remove: Fail ! Need to retry, push again Normal push … Normal pop … To be removed 2 2 2 33
  • 34. Outline • Motivation • What is quasi linearizability • How to check it – Phase 1: generate sequential histories – Phase 2: generate concurrent histories • Experiments • Conclusions 34
  • 35. Conclusions • First method for checking quasi linearizability of C/C++ code of concurrent data structures – Fully automated – Sound, no false positives • Future work – Scalability remains a bottleneck • Add new symmetry reduction techniques and improve the existing partial order reduction • Avoid generating redundant quasi permutations 35
  • 37. Some Related Work 37 • Theorem Proving – [V. Vafeiadis VMCAI 2009 ] – [V. Vafeiadis et al PPOPP 2006] … requires manual effort • Model Checking – [Liu et al FM 2009] – [M. T. Vechev et al SPIN 2009] – [P. Cern′y et al CAV 2010] – [K. Adhikari et al SPIN 2013] … works on models, not on the actual source code implementation • Runtime Verification – [S. Burckhardt et al PLDI 2010] – [M. Pradel et al PLDI 2012] … checks standard linearizability