Table of Contents
Fetching ...

CSSTs: A Dynamic Data Structure for Partial Orders in Concurrent Execution Analysis

Hünkar Can Tunç, Ameya Prashant Deshmukh, Berk Çirisci, Constantin Enea, Andreas Pavlogiannis

TL;DR

This work tackles dynamic analyses of concurrent programs by maintaining the underlying partial order of events with a new data structure, CSSTs. CSSTs exploit small width $k$ relative to the trace domain size $n$, achieving update and query times that scale as $O\big(\max(\log \delta, \min(\log n, d))\big)$ and $O(k^3 \min(\log n, d))$ respectively, where $\delta$ is the maximum degree and $d$ the cross-chain density; an incremental variant reduces these costs further. The approach reduces dynamic reachability on chain DAGs to dynamic suffix minima, implemented via Sparse Segment Trees with minima indexing, and extends to $k>2$ chains through aggregated suffix-minima arrays $A_{t_1}^{t_2}$. Empirical results across data races, deadlocks, memory bugs, consistency checks, and root-cause analyses show CSSTs generally outperform Vector Clocks, STs, and plain graphs, often by large factors, highlighting their practical impact for scalable concurrency verification and testing.

Abstract

Dynamic analyses are a standard approach to analyzing and testing concurrent programs. Such techniques observe program traces and analyze them to infer the presence or absence of bugs. At its core, each analysis maintains a partial order $P$ that represents order dependencies between events of the analyzed trace $σ$. Naturally, the scalability of the analysis largely depends on how efficiently it maintains $P$. The standard data structure for this task has thus far been vector clocks. These, however, are slow for analyses that follow a non-streaming style, costing $O(n)$ for inserting (and propagating) each new ordering in $P$, where $n$ is the size of $σ$, while they cannot handle the deletion of existing orderings. In this paper we develop collective sparse segment trees (CSSTs), a simple but elegant data structure for generically maintaining a partial order $P$. CSSTs thrive when the width $k$ of $P$ is much smaller than the size $n$ of its domain, allowing inserting, deleting, and querying for orderings in $P$ to run in $O(logn)$ time. For a concurrent trace, $k$ is bounded by the number of its threads, and is normally orders of magnitude smaller than its size $n$, making CSSTs fitting for this setting. Our experimental results confirm that CSSTs are the best data structure currently to handle a range of dynamic analyses from existing literature.

CSSTs: A Dynamic Data Structure for Partial Orders in Concurrent Execution Analysis

TL;DR

This work tackles dynamic analyses of concurrent programs by maintaining the underlying partial order of events with a new data structure, CSSTs. CSSTs exploit small width relative to the trace domain size , achieving update and query times that scale as and respectively, where is the maximum degree and the cross-chain density; an incremental variant reduces these costs further. The approach reduces dynamic reachability on chain DAGs to dynamic suffix minima, implemented via Sparse Segment Trees with minima indexing, and extends to chains through aggregated suffix-minima arrays . Empirical results across data races, deadlocks, memory bugs, consistency checks, and root-cause analyses show CSSTs generally outperform Vector Clocks, STs, and plain graphs, often by large factors, highlighting their practical impact for scalable concurrency verification and testing.

Abstract

Dynamic analyses are a standard approach to analyzing and testing concurrent programs. Such techniques observe program traces and analyze them to infer the presence or absence of bugs. At its core, each analysis maintains a partial order that represents order dependencies between events of the analyzed trace . Naturally, the scalability of the analysis largely depends on how efficiently it maintains . The standard data structure for this task has thus far been vector clocks. These, however, are slow for analyses that follow a non-streaming style, costing for inserting (and propagating) each new ordering in , where is the size of , while they cannot handle the deletion of existing orderings. In this paper we develop collective sparse segment trees (CSSTs), a simple but elegant data structure for generically maintaining a partial order . CSSTs thrive when the width of is much smaller than the size of its domain, allowing inserting, deleting, and querying for orderings in to run in time. For a concurrent trace, is bounded by the number of its threads, and is normally orders of magnitude smaller than its size , making CSSTs fitting for this setting. Our experimental results confirm that CSSTs are the best data structure currently to handle a range of dynamic analyses from existing literature.
Paper Structure (15 sections, 9 theorems, 3 equations, 11 figures, 7 tables, 2 algorithms)

This paper contains 15 sections, 9 theorems, 3 equations, 11 figures, 7 tables, 2 algorithms.

Key Result

Theorem 1

Consider a chain DAG $G$ of $n$ nodes, $k$ chains, maximum out-degree $\delta$ and cross-chain density $d$. $\mathtt{CSSTs}$ maintain $G$ under dynamic updates, costing $O(\max(\log \delta,\min(\log n,d)))$ time per update and $O(k^3 \min(\log n, d))$ time per query.

Figures (11)

  • Figure 1: A consistency analysis. Blue edges represent reads-from information. Numbered edges represent new orderings inserted by the analysis.
  • Figure 2: Three subgraphs of the chain DAG $G$ formed from the execution in \ref{['fig:motivating-1']}. The cross-chain density of $G$ is $2$, as chain $1$ (i.e., thread 1 in \ref{['fig:motivating-1']}) has two outgoing edges to chain $2$ (from events $e_3$ and $e_4$).
  • Figure 3: A Segment Tree representation of $A=[6, 9, 8, 10]$.
  • Figure 4: Representation of the partial order in \ref{['fig:motivating-1']}.
  • Figure 5: $\mathtt{ST}$ representation with minima indexing. The entries $A[4\colon6]$ are $> 59$. The notation $\mathtt{nd}_{i, j}\colon (x, y)$ denotes $\mathtt{nd}_{i, j}.\mathtt{min} = x$, $\mathtt{nd}_{i, j}.\mathtt{pos} = y$.
  • ...and 6 more figures

Theorems & Definitions (16)

  • Theorem 1
  • Example 1
  • Example 2
  • Example 3
  • Example 4
  • Example 5
  • Lemma 1
  • Example 6
  • Lemma 2: Sparsity
  • Lemma 3: Invariant
  • ...and 6 more