Dynamic Partial Order Reduction Based on Interference Solution

Xu Yang, Chen YeResearch Square 2023

TL;DR

Verifying concurrent software is notoriously difficult due to the "state-space explosion" problem, where the number of possible execution orders grows exponentially. This paper introduces IntSo (Interference Solution), a new algorithm that achieves linear memory consumption and reduces memory overhead by over 30% compared to state-of-the-art tools, making the verification of complex multi-threaded programs significantly more scalable.

What Problem Does This Paper Address?

When multiple threads interact, the number of ways their instructions can interleave is astronomical. To ensure a program is bug-free, researchers use Stateless Model Checking (SMC) to explore these interleavings. To avoid redundant work, they use Dynamic Partial Order Reduction (DPOR), which groups "equivalent" execution traces together so only one representative from each group needs to be checked.

However, even with DPOR, existing algorithms often hit a "memory wall." As programs grow, the metadata required to track explored paths and "backtrack" points can lead to exponential memory consumption and system crashes. The challenge is to maintain optimality (exploring each unique behavior exactly once) while keeping memory usage under control—ideally linear relative to the program's size.

Methods

The authors propose the Interference Solution (IntSo) algorithm. Its core innovation lies in how it manages the relationships between conflicting events (e.g., when two threads access the same memory location and at least one is a "write").

Key components include:

  • Causally-Happened-Before (CHB) Relationships: Instead of just tracking simple dependencies, IntSo uses CHB to identify which events must happen before others to produce a specific result.
  • Conflict Reversal (The "Flip"): When a conflict is detected, the algorithm uses a "flipping" method to reverse the order of accesses, systematically generating the next unique execution trace.
  • Recursive Depth-First Search (DFS): By structuring the exploration as a recursive DFS where the depth is limited by the program length, the algorithm ensures that memory usage remains linear.
  • Data Petri Nets (DPNs): The researchers used DPNs to formally model program executions as directed graphs, providing a rigorous mathematical foundation for the algorithm.

Datasets

The authors evaluated IntSo by integrating it into GenMC, a well-known LLVM-based model checker. They tested it against several standard concurrent verification benchmarks:

  • lastzero (n): A classic benchmark used to test the trade-off between memory and time in DPOR algorithms.
  • exp-mem / exp-m: Benchmarks specifically designed to trigger state-space explosions and test the limits of memory consumption.
  • Comparison Tools: IntSo was benchmarked against GenMC and TruSt, two state-of-the-art verification frameworks.

Key Insights and Ideas

  • Linearity is King: The most significant "aha" moment is that by avoiding the storage of previously visited global states and relying on a specific recursive structure, the memory footprint stays proportional to the program size ($O(n)$) rather than the number of interleavings.
  • Independence Equals Speed: The algorithm identifies "data-independent" scenarios—where threads operate on different variables—and processes them with high parallelism. This allows the tool to scale effectively on multi-core servers.
  • Sleep Sets and Backtracks: IntSo refines the use of "sleep sets" (sets of transitions that don't need to be explored yet) to ensure that no redundant paths are ever taken, fulfilling the "optimality" requirement.

Key Results

The empirical results demonstrate that IntSo is a heavyweight contender in the verification space:

  • Memory Efficiency: IntSo reduced memory consumption by more than 30% compared to GenMC. In extreme cases like exp-m(6), where other tools timed out or ran out of memory, IntSo completed the task using only 90MB.
  • Time Complexity: The algorithm achieved linear time complexity in data-independent scenarios, significantly outperforming traditional DPOR methods.
  • Scalability: Testing on a 32-core system showed that IntSo’s parallel implementation provides a nearly linear speedup as more threads are added, particularly for the lastzero benchmarks.

Limitations and Future Work

While IntSo excels under the Sequential Consistency (SC) memory model (where operations appear to happen in a strict global order), modern hardware often uses "relaxed" memory models (like TSO or ARM) that allow for even more complex behaviors.

The authors acknowledge that:

  • Memory Model Expansion: Future work will focus on relaxing the "acyclic assumption" in program order to support these weaker hardware memory models.
  • Messaging Overhead: To scale to even larger benchmarks, the researchers plan to design a more sophisticated messaging scheme for the parallel implementation to reduce coordination overhead between cores.

Reference: Yang, X., & Ye, C. (2023). Dynamic Partial Order Reduction Based on Interference Solution. Research Square (Preprint). DOI: 10.21203/rs.3.rs-3257081/v1

Summary updated

Abstract

<title>Abstract</title> In verifying the process of concurrent programs, dynamic partial order reduction (DPOR) exhaustively explores all the interactions of the equivalent execution traces in the concurrent system through dynamic judgment. Existing DPOR algorithms strive for optimal exploration (i.e., exploring only one interleaving per equivalence class), leading to exponential redundancy in the interleaving, state-space explosion, and memory overflow. In this study, the Interference Solution (IntSo) algorithm is proposed to achieve linear memory consumption by exploring only one interleaving per equivalence class through the exchange of causally-happened-before (CHB) conflicting relationships. In the sequential consistency memory model, the IntSo algorithm realizes parallelism while curtailing time and memory consumption in data-independent scenarios, as well as maximum path lengths. Empirical validation using GenMC demonstrates that the IntSo algorithm compares favorably with state-of-the-art techniques in terms of time and memory, fulfills linear time complexity, and reduces memory consumption by more than 30%.
BibTeX
@inproceedings{yang2023dynamic,
  author = {Xu Yang and Chen Ye},
  title = {{Dynamic Partial Order Reduction Based on Interference Solution}},
  booktitle = {Research Square},
  year = {2023},
  doi = {10.21203/rs.3.rs-3257081/v1},
}
Figure