arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2605.01560cs.PLcs.HC
收藏

FlowBook:在计算笔记本中强制可重现性

FlowBook: Enforcing Reproducibility in Computational Notebooks

Williams College(威廉姆斯学院);University of Massachusetts Amherst(马萨诸塞大学阿默斯特分校);Amazon Web Services(亚马逊云服务);University of California, Santa Cruz(加州大学圣克鲁兹分校);University of California, Los Angeles(加州大学洛杉矶分校)

Stephen N. Freund, Emery D. Berger, Cormac Flanagan, Eunice Jun

AI总结:

FlowBook通过动态分析强制计算笔记本的可重现性,通过跟踪单元边界处的读写集来检测过时单元并防止违反可重现性操作,具有极低的延迟开销。

摘要:

计算笔记本因允许非顺序单元执行而容易出现可重现性失败。先前方法在可表达性、精度和性能之间存在根本性权衡。本文提出FlowBook,通过动态分析强制可重现性:笔记本可重现当且仅当从空存储按从上到下顺序执行其单元产生当前记录的输出。FlowBook通过跟踪单元边界处的读写集来实现这一概念,并检测可能不再反映当前笔记本状态的过时单元,防止违反可重现性的操作。FlowBook的延迟开销几乎不可察觉(中位数:70 ms)

英文摘要:

Computational notebooks interleave code cells with their outputs and let users edit and execute cells in arbitrary order. This flexibility supports interactive exploration, but it also allows outputs to become inconsistent with the notebook's current code and data. Such inconsistencies can lead users to draw invalid scientific conclusions. We argue that notebooks should always be output consistent: every output should match what a top-to-bottom execution of the current code would produce. Forcing a top-to-bottom execution after each edit would guarantee this, but at prohibitive cost: such an execution can take minutes to hours. We present FlowBook, a dynamic analysis for Python notebooks that enforces output consistency without giving up out-of-order execution. FlowBook does this by enforcing a stronger property, rerun consistency: no location read by a cell may be written by any cell below it. Rerun consistency guarantees that rerunning a cell later, in any order, reproduces its current output. FlowBook tracks each cell's read and write sets at cell boundaries, blocks updates that would violate rerun consistency, and marks as stale any cell whose inputs may have changed. We prove that a notebook with no stale cells is both rerun and output consistent. Users remain free to execute cells in arbitrary order; the only restriction is that recorded outputs may not silently depend on the order in which cells were executed. Across 61 real-world notebooks, FlowBook flagged 203 rerun-inconsistent cells. Rerunning 62% led to output inconsistencies. A further 21% change notebook state with no visible output, which can affect the results of later edits and reruns; only 5% are false positives of FlowBook's conservative analysis. FlowBook's AI repair agent repaired all 203 cells with local edits and no human intervention. FlowBook's median overhead is only 26 ms per cell execution.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑