NeurIPS 2026Coming to NeurIPS?Explore papers, orals & directions

A Partial Order Reduction Technique for Event-driven Multi-threaded Programs

Pallavi Maiya, Rahul Gupta, Aditya Kanade, Rupak MajumdararXiv 2015

Abstract: Verification of event-driven multi-threaded programs is hindered by the state space explosion problem. Standard Partial Order Reduction (POR) techniques are often ineffective in this domain because they treat event queues as shared objects, leading to redundant exploration of event orderings. This paper presents EM-DPOR, a novel algorithm that redefines dependence based on event handler interference rather than queue operations. By employing dependence-covering sets, EM-DPOR achieves significant reductions in the number of explored transitions. Experimental results on real-world Android applications demonstrate that EM-DPOR can reduce verification time from hours to seconds, exploring orders of magnitude fewer states than existing methods.

Introduction

Modern mobile and web applications rely on complex concurrency models where multiple threads communicate via asynchronous event loops. Verifying these systems requires exploring all possible interleavings of operations to ensure safety and correctness. However, the "state space explosion" problem makes exhaustive search impossible for most practical programs. Standard Dynamic Partial Order Reduction (DPOR) attempts to mitigate this by only exploring non-equivalent execution paths. Yet, in event-driven systems, DPOR often treats the order of events posted to the same queue as significant, even when the handlers for those events are independent. This leads to exploring $n!$ permutations for a queue of $n$ events, most of which result in the same final state.

The EM-DPOR Approach

The core innovation of this work is the EM-DPOR algorithm, which "lifts" the concept of dependence from the low-level queue operations to the high-level event handlers.

  1. Handler-Centric Dependence: Instead of considering all "post" operations to a single queue as dependent, the authors define dependence based on whether the code within the handlers accesses the same shared variables (data races).
  2. Dependence-Covering Sets (DCS): The authors introduce DCS as a more aggressive alternative to the traditional persistent sets used in POR. DCS allows the algorithm to prune the search space more effectively while maintaining completeness.
Comparison of Persistent Sets (PS) and Dependence-Covering Sets (DCS) in state space exploration.
  1. Recursive Reordering: When a conflict is detected between handlers, EM-DPOR backtracks to the original "post" operations and reorders them, ensuring that only functionally distinct paths are explored.

Implementation and Insights

The algorithm uses task-based vector clocks to track "happens-before" relationships across threads and handlers. A key insight is that event queues are rarely the true bottleneck in verification; rather, the interference between handlers is what matters. By focusing on data dependencies, EM-DPOR can skip massive amounts of redundant work.

Pseudo code and dependency graphs illustrating event-driven program execution paths.

Experimental Results

The researchers evaluated EM-DPOR on five real-world Android applications, including "Aard Dictionary" and "Music Player," using traces captured by DROIDRACER. The results were transformative. For the Aard Dictionary app, standard DPOR failed to terminate after 4 hours and 14 million transitions. In contrast, EM-DPOR completed the verification in just 1.4 seconds, exploring fewer than 5,000 transitions. Across all tested apps, EM-DPOR consistently terminated within minutes, whereas standard techniques frequently timed out.

Conclusion and Future Work

While EM-DPOR significantly improves verification efficiency, the current prototype is data-insensitive and does not account for complex dispatching logic like "post to front." Future work aims to integrate these techniques with optimal DPOR and incorporate "sleep sets" to further enhance pruning. Despite these limitations, EM-DPOR represents a major step toward making the formal verification of complex event-driven software a practical reality.

Summary updated

BibTeX
@misc{maiya2015partial,
  author = {Pallavi Maiya and Rahul Gupta and Aditya Kanade and Rupak Majumdar},
  title = {{A Partial Order Reduction Technique for Event-driven Multi-threaded Programs}},
  year = {2015},
  eprint = {1511.03213},
  archivePrefix = {arXiv},
  url = {https://arxiv.org/abs/1511.03213},
}
Figure