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

Data Race Satisfiability on Array Elements

Junhyung Shim, Quazi Ishtiaque Mahmud, Ali Jannesari · DOI

Abstract

Static analysis for data race detection in parallel programs often suffers from high false positive rates due to a lack of control-flow awareness, leading tools to flag races on execution paths that are mathematically impossible. This paper introduces DRS-oNE (Data Race Satisfiability on aNy Element), a static analysis tool designed to detect data races in OpenMP programs with high precision. By leveraging the Z3 SMT (Satisfiability Modulo Theories) solver, DRS-oNE evaluates "augmented" race constraints that incorporate path conditions and static integer variable analysis. Our evaluation on a subset of the DataRaceBench 1.4.0 suite demonstrates that DRS-oNE achieves a precision of 1.000, effectively eliminating false positives caused by infeasible execution paths that trip up existing state-of-the-art tools.

1. Introduction

Data races occur when multiple threads access the same memory location simultaneously, with at least one access being a write. These bugs are notoriously difficult to debug due to their non-deterministic nature. Current detection methods generally fall into two categories: dynamic analysis and static analysis. While dynamic tools like ThreadSanitizer are accurate, they are computationally expensive and limited to the specific interleavings observed during execution. Static tools, such as LLOV and OpenRace, analyze source code without execution; however, they frequently suffer from high false positive rates because they fail to account for "infeasible paths"—logical branches in the code that can never be taken during actual execution.

DRS-oNE aims to bridge this gap by providing a control-flow-aware static analysis tool that mathematically proves whether a data race is possible on any given array element.

2. Methodology

DRS-oNE is built upon the OMPDart framework and utilizes a multi-stage workflow to analyze OpenMP loops. The core innovation lies in its ability to generate and solve augmented race constraints.

2.1 AST-CFG Construction

The tool begins by combining an Abstract Syntax Tree (AST) with a Control Flow Graph (CFG). This allows the analyzer to map the flow of data through the program's logic and identify the specific conditions required to reach memory access points.

2.2 Augmented Race Constraints

To determine if a race is possible, DRS-oNE generates a set of mathematical conditions that must simultaneously be true. These conditions include:

  • Parallel Condition: Verification that two distinct iterations or threads are executing concurrently.
  • Path Condition: The logical requirements (e.g., if statements) leading to the memory access must be satisfiable.
  • Array Index Condition: Two different iterations must calculate the same array index.
  • Integer Variable Condition: This "augmented" component tracks variables declared outside the loop. If their values can be determined statically, they are integrated into the constraints to refine the search space.

2.3 SMT Solving

These constraints are fed into the Z3 SMT solver. If the solver determines the constraints are "unsatisfiable," the tool concludes that no race can occur on that path, thereby pruning a potential false positive. This approach allows DRS-oNE to handle complex, non-linear integer arithmetic in array indexing that often baffles tools relying on simpler polyhedral models.

3. Evaluation

The authors evaluated DRS-oNE using two primary datasets:

  1. DataRaceBench 1.4.0: A standard benchmark for OpenMP race detection. The evaluation focused on a subset of 55 files, excluding features not yet supported by the tool (such as nested parallelism or GPU-specific code).
  2. Handwritten Test Cases: Seven specialized cases designed to trigger false positives in traditional static analyzers by utilizing complex control flow and infeasible execution paths.

4. Results and Discussion

DRS-oNE demonstrated superior precision compared to existing tools. In the DataRaceBench subset, the tool achieved a precision of 1.000, meaning every reported race was a genuine bug. In contrast, the state-of-the-art tool LLOV achieved a precision of 0.935.

In the handwritten test cases, DRS-oNE correctly identified 6 out of 7 cases as race-free. Competitive tools like OpenRace and LLOV failed significantly on these tests, reporting races where none existed due to their inability to recognize infeasible paths.

However, there is a trade-off in recall. DRS-oNE’s recall (0.867) was lower than OpenRace (1.000). This is primarily because the current implementation of DRS-oNE focuses strictly on direct array access and ignores races involving scalar variables or pointers.

5. Limitations and Future Work

While DRS-oNE provides a significant advancement in precision, several limitations remain:

  • Manual Intervention: Users must currently mark target loops using a custom #pragma drs.
  • Scope: The tool does not yet support pointer-based memory access, function calls within loops, or scalar variables.
  • Infrastructure: Analyzing at the AST level presents challenges for complex branching. Future iterations of the tool are expected to move analysis to the LLVM Intermediate Representation (LLVM-IR) for better scalability.
  • Dynamic Integration: To handle variables dependent on runtime input, the authors suggest integrating dynamic invariant detection tools like Daikon to provide heuristic "hints" to the static solver.

6. Conclusion

DRS-oNE demonstrates that integrating SMT solvers with static integer variable tracking can significantly reduce the false positive rate in data race detection. By focusing on the mathematical satisfiability of race conditions on array elements, the tool provides a high-precision alternative for developers working with parallel OpenMP applications.

Summary updated

BibTeX
@inproceedings{shim2025data,
  author = {Junhyung Shim and Quazi Ishtiaque Mahmud and Ali Jannesari},
  title = {{Data Race Satisfiability on Array Elements}},
  booktitle = {IWOMP},
  year = {2025},
  doi = {10.1007/978-3-032-06343-4\_8},
}
Figure