paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Efficient Timestamping for Sampling-Based Race Detection

面向基于采样的数据竞争检测的高效时间戳
PLDI 9(PLDI)2025匹配度 2/10 · 该论文属于动态程序分析与并发数据竞争检测,核心是采样式 happens-before 时间戳优化,与用户关注的静态分析、LLM/Agent 与程序分析交叉、浮点程序分析或贝叶斯程序分析均无明显关联;仅在程序分析、形式化证明和工程实现偏好上有微弱交集。引用 1 inbox
Minjian Zhang, Daniel Wee Soong Lim, Mosaad Al Thokair, Umang Mathur, Mahesh Viswanathan
crossref: 2026-09-10

AI 速览

一句话:提出新 freshness 时间戳、专用数据结构与算法,降低采样式 HB 数据竞争检测的时间戳开销,并证明其实例最优。

基于 happens-before 偏序的动态数据竞争检测已成为发现多线程程序数据竞争的主流方法。这类实现通常用时间戳推断事件因果关系,并在每个事件更新 vector clock,导致严重开销。随机采样可望降低开销,但现有时间戳算法未针对采样优化,当采样事件远少于总事件时仍有大量无用工作。本文研究低开销采样式竞争检测中的时间戳任务,提出 freshness 时间戳概念、新的时间戳存储数据结构,以及结合两者的算法。作者证明该算法的 vector clock 遍历次数受采样事件数与线程数约束,并在给定动态执行上接近任何时间戳算法必须完成的工作量,即实例最优。在真实基准上的评估表明,其效果优于此前与采样无关的时间戳算法。

问题
在基于 happens-before 的动态数据竞争检测中,vector clock 时间戳更新是主要开销;随机采样虽能降低检测开销,但现有时间戳算法对采样不敏感,在采样事件稀疏时仍做大量冗余工作。
方法
提出 freshness 时间戳、新的时间戳存储数据结构,以及结合二者的时间戳算法,以减少采样式竞争检测中的 vector clock 遍历与更新成本;并给出遍历次数上界和实例最优性证明。
评估
在真实世界基准上与采样无关的先前时间戳算法对比,验证所提算法能有效降低时间戳开销。
原文摘要(Abstract)

Dynamic race detection based on the happens before (HB) partial order has now become the de facto approach to quickly identify data races in multi-threaded software. Most practical implementations for detecting these races use timestamps to infer causality between events and detect races based on these timestamps. Such an algorithm updates timestamps (stored in vector clocks) at every event in the execution, and is known to induce excessive overhead. Random sampling has emerged as a promising algorithmic paradigm to offset this overhead. It offers the promise of making sound race detection scalable. In this work we consider the task of designing an efficient sampling based race detector with low overhead for timestamping when the number of sampled events is much smaller than the total events in an execution. To solve this problem, we propose (1) a new notion of freshness timestamp , (2) a new data structure to store timestamps, and (3) an algorithm that uses a combination of them to reduce the cost of timestamping in sampling based race detection. Further, we prove that our algorithm is close to optimal — the number of vector clock traversals is bounded by the number of sampled events and number of threads, and further, on any given dynamic execution, the cost of timestamping due to our algorithm is close to the amount of work any timestamping-based algorithm must perform on that execution, that is it is instance optimal. Our evaluation on real world benchmarks demonstrates the effectiveness of our proposed algorithm over prior timestamping algorithms that are agnostic to sampling.

链接与引用

DOI 原文 · PDF(开放获取) ·

BibTeX
@article{paperbot3071,
  title = {Efficient Timestamping for Sampling-Based Race Detection},
  author = {Minjian Zhang and Daniel Wee Soong Lim and Mosaad Al Thokair and Umang Mathur and Mahesh Viswanathan},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {9},
  number = {PLDI},
  year = {2025},
  doi = {10.1145/3729252}
}