We introduce and study the problem of detecting short races in an observed trace. Specifically, for a race type $R$, given a trace $σ$ and window size $w$, the task is to determine whether there exists an $R$-race $(e_1, e_2)$ in $σ$ such that the subtrace starting with $e_1$ and ending with $e_2$ contains at most $w$ events. We present a monitoring framework for short-race prediction and instantiate the framework for happens-before and sync-preserving races, yielding efficient detection algorithms. Our happens-before algorithm runs in the same time as FastTrack but uses space that scales with $\log w$ as opposed to $\log |σ|$. For sync-preserving races, our algorithm runs faster and consumes significantly less space than SyncP. Our experiments validate the effectiveness of these short-race detection algorithms: they run more efficiently, use less memory, and detect significantly more races under the same budget, offering a reasonable balance between resource usage and predictive power.
翻译:我们提出并研究了在观测轨迹中检测短竞态的问题。具体而言,对于竞态类型 $R$,给定轨迹 $σ$ 和窗口大小 $w$,任务是判断 $σ$ 中是否存在一个 $R$-竞态 $(e_1, e_2)$,使得从 $e_1$ 开始到 $e_2$ 结束的子轨迹最多包含 $w$ 个事件。我们提出了一个用于短竞态预测的监控框架,并针对 happens-before 竞态和 sync-preserving 竞态实例化了该框架,从而得到了高效的检测算法。我们的 happens-before 算法运行时间与 FastTrack 相同,但空间使用量随 $\log w$ 缩放,而非 $\log |σ|$。对于 sync-preserving 竞态,我们的算法运行速度更快,且比 SyncP 消耗的空间显著减少。实验验证了这些短竞态检测算法的有效性:它们运行效率更高,内存占用更少,在相同资源预算下能检测到显著更多的竞态,在资源使用和预测能力之间提供了合理的平衡。