Safety verification of phaser programs

Zeinab Ganjei, Ahmed Rezine, Petru Eles, Zebo Peng

TL;DR

This paper introduces a novel symbolic verification technique for "phaser" programs, a complex synchronization construct found in modern parallel programming languages. The authors present an exact method for checking control-state reachability (like assertion violations and race conditions) that guarantees termination for programs with a bounded number of tasks and phasers, while also proving that deadlock freedom checking is undecidable in general.

What Problem Does This Paper Address?

Modern parallel programming languages often feature sophisticated synchronization primitives to manage concurrent tasks efficiently. "Phasers" are one such construct, allowing for dynamic registration and deregistration of tasks and supporting both collective and point-to-point synchronizations. While offering flexibility and performance benefits, phasers also introduce new avenues for programming errors, including race conditions, assertion violations, and deadlocks. Existing verification techniques struggle with the dynamic nature and unbounded phase values that phaser programs can exhibit. This paper addresses the challenge of formally verifying the safety of such programs, specifically focusing on control-state reachability and deadlock freedom.

Methods

The authors propose a gap-order based symbolic verification procedure. For control-state reachability, they develop an exact procedure that leverages a symbolic representation of program states using gap-order constraints. This procedure is proven to terminate when the number of tasks and phasers is bounded. For plain reachability (including deadlock freedom), they demonstrate its undecidability in general. However, they also present a sound over-approximation of their procedure that can be used to check for deadlocks, with precision adjustable on demand. The core of their approach involves transforming program states into symbolic constraints and then systematically exploring these constraints to detect undesirable program behaviors.

Datasets

Not discussed in the paper. The paper focuses on a theoretical framework and an open-source tool (hjVerify) for verification, rather than training on specific datasets.

Key Insights and Ideas

  • Phasers are powerful but complex: The paper highlights the dual nature of phasers – enabling dynamic parallelism and load balancing while simultaneously introducing significant verification challenges.
  • Undecidability of Deadlock Freedom: A key theoretical result is the proof that checking for deadlocks in phaser programs is undecidable, even for programs with a small, fixed number of tasks and phasers. This sets fundamental limits on what can be automatically verified.
  • Exact Control-State Reachability: The development of a terminating, exact procedure for control-state reachability (for bounded task/phaser counts) is a significant contribution, offering a precise way to detect assertion violations and race conditions.
  • Gap-Order Constraints as a Symbolic Representation: The paper effectively uses gap-order constraints to represent program states, allowing for symbolic manipulation and analysis of phase values without concrete execution.
  • Sound Over-Approximation for Deadlocks: While exact deadlock checking is undecidable, the paper provides a practical solution by offering a sound over-approximation that can still detect deadlocks, albeit potentially with false positives.

Key Results

  • An exact, terminating symbolic verification procedure for control-state reachability in phaser programs with bounded numbers of tasks and phasers.
  • Proof of undecidability for checking deadlock freedom in phaser programs, even with a fixed, small number of tasks and phasers.
  • A sound over-approximation for checking deadlock freedom, which can be made more precise.
  • Preliminary experimental results with their open-source tool, hjVerify, demonstrating its application to various phaser programs.

Limitations and Future Work

  • Parameterized Case: The exact procedure for control-state reachability is limited to programs with a bounded number of tasks and phasers. The paper mentions ongoing work on tackling the parameterized case (arbitrary numbers of tasks) using view abstraction, with preliminary encouraging results.
  • Deadlock Undecidability: The inherent undecidability of deadlock checking means that any automated solution will either be incomplete or an over-approximation.
  • Scalability: While the tool is a proof of concept, the paper notes that performance can be an issue for complex examples, suggesting that partial order reduction techniques and other heuristics could improve scalability.
  • Predicate Abstraction and Abstract Interpretation: The authors suggest integrating these techniques to enhance the analysis of actual source code.
  • Verification of Similar Constructs: Investigating the applicability of their techniques to other synchronization constructs is also mentioned as future work.

Summary updated

BibTeX
@inproceedings{ganjei2017safety,
  author = {Zeinab Ganjei and Ahmed Rezine and Petru Eles and Zebo Peng},
  title = {{Safety verification of phaser programs}},
  booktitle = {FMCAD},
  year = {2017},
  doi = {10.23919/fmcad.2017.8102243},
}

Loading related content...

Figure