paperbot · PL 论文追踪

全部论文 待读 收藏

P2 Pyriscope: Precise and Low-Overhead Python Control Flow Tracing via Sparse Hardware-Based Events

Pyriscope:基于稀疏硬件事件的精确低开销 Python 控制流追踪
OOPSLA 10(OOPSLA2)2026匹配度 2/10 · 该论文聚焦于用硬件追踪模块实现 Python 动态控制流追踪,属于运行时/动态分析系统,与用户核心方向(面向 ML/Agentic 程序的静态分析、LLM 辅助静态分析与形式化验证、浮点程序分析、贝叶斯程序分析)几乎没有交集。仅“程序分析/覆盖分析”这一大标签与用户有极弱的字面关联。引用 0 inbox
Xinchen Yao, Wu Daiyou, Zhiqiang Zuo
crossref: 2026-10-02

AI 速览

一句话:在 CPython 上借助硬件追踪模块与迹剪枝实现精确低开销的控制流追踪,平均开销仅 2.99%。

采集 Python 代码的控制流与覆盖率剖面在程序测试/fuzzing、调试、理解与优化等任务中需求迫切,但现有追踪手段要么开销高得难以实用,要么只能收集近似信息。本文提出利用现代硬件追踪模块(hardware tracing modules)为 Python 程序实现精确且低开销的控制流追踪,并在 CPython 运行时之上构建了原型系统 Pyriscope,其核心是有效的 trace pruning(迹剪枝)与高效的离线分析技术:通过剪除冗余硬件事件、将原始硬件迹映射回 Python 层的控制流信息,从而在保持信息完整性的同时压低运行时与存储代价。评估表明该系统能够提供信息丰富的控制流追踪,平均开销仅为 2.99%,比当前最先进方法低数个数量级,验证了硬件辅助追踪在托管语言运行时中的可行性。

问题
Python 生态中测试/fuzzing、调试、程序理解与优化都依赖控制流与覆盖率剖面,但已有追踪方法要么开销高到无法实用,要么只能给出近似信息。
方法
在 CPython 运行时之上构建 Pyriscope,利用现代硬件追踪模块采集稀疏事件,并配合迹剪枝与高效分析技术,将硬件事件还原为精确的 Python 层控制流信息。
评估
在真实 Python 程序上测量追踪开销与信息完整性,结果显示系统平均开销仅 2.99%,较现有最先进方法低数个数量级。
原文摘要(Abstract)

Capturing the control-flow and/or coverage profiles of Python code becomes a pressing need for Python development community, which is commonly used in a wide spectrum of tasks including program testing/fuzzing, debugging, understanding, and optimizations. Existing tracing approaches either suffer from prohibitively high overhead or only collect approximate information, which cannot satisfy the practical requirements. In this paper, we propose to leverage modern hardware tracing modules to achieve precise and low-overhead control-flow tracing for Python programs. To this goal, we develop Pyriscope on top of CPython runtime by integrating the effective trace pruning and efficient analysis techniques. Evaluation results demonstrate the efficacy of our system. It incurs an average overhead of only 2.99% for rich-informative control-flow tracing, which is orders of magnitude smaller than that of the state of the arts.

链接与引用

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

BibTeX
@article{paperbot12131,
  title = {Pyriscope: Precise and Low-Overhead Python Control Flow Tracing via Sparse Hardware-Based Events},
  author = {Xinchen Yao and Wu Daiyou and Zhiqiang Zuo},
  journal = {Proceedings of the ACM on Programming Languages},
  volume = {10},
  number = {OOPSLA2},
  year = {2026},
  doi = {10.1145/3839479}
}