← 研踪 PaperTrailarXiv:2611.11213 · v1
NumericalDiff: Numerical Program Differencing via Value-Based Trace Alignment and Intervention
首次提交 2026-11-08 16:01
版本更新 2026-11-08 16:01
雷达观测 2026-11-10 12:16
摘要
Numerical programs implementing the same computational task can exhibit different numerical behavior because of their execution stacks, program representations, or program logic. Source text and final outputs alone provide limited diagnostic information: numerical differences can propagate through corresponding computations, while distinct executions can produce equal outputs. We present NumericalDiff, an execution-based method that records assignment-level numerical events, aligns traces using a tolerance-aware longest common subsequence independent of variable names and source locations, and optionally reexecutes after replacing one intermediate value with its counterpart. Among the original and all single-intervention executions, it lexicographically maximizes matched events and minimizes unmatched events. NumericalDiff supports code comparison across language and framework front ends, currently including NumPy, PyTorch, JAX, C, C++, Fortran, and Octave. We evaluate NumericalDiff on 36 controlled cases comprising 675 pair/input instances: 36 execution-stack, 588 program-representation, and 51 program-logic instances. All 24 operator-injection instances expose trace differences, including three with tolerance-equal final outputs, while complete trace alignment is achieved for all 441 canonical cross-representation instances. Within the 51 program-logic instances, intervention improves 24 alignments and raises macro-average matching coverage from 0.4210 to 0.6513. The results show that value-based trace alignment and reexecution can delimit propagated numerical differences across heterogeneous implementations.
作者备注:The arXiv v1 version corresponds to Project version 0.0.1
观测到的版本
相邻记录可能跳过中间版本;首次发现 v2 及以上也会标为版本更新。
v1 · 2026-11-08 16:01 · 最新观测版本
NumericalDiff: Numerical Program Differencing via Value-Based Trace Alignment and Intervention
Numerical programs implementing the same computational task can exhibit different numerical behavior because of their execution stacks, program representations, or program logic. Source text and final outputs alone provide limited diagnostic information: numerical differences can propagate through corresponding computations, while distinct executions can produce equal outputs. We present NumericalDiff, an execution-based method that records assignment-level numerical events, aligns traces using a tolerance-aware longest common subsequence independent of variable names and source locations, and optionally reexecutes after replacing one intermediate value with its counterpart. Among the original and all single-intervention executions, it lexicographically maximizes matched events and minimizes unmatched events. NumericalDiff supports code comparison across language and framework front ends, currently including NumPy, PyTorch, JAX, C, C++, Fortran, and Octave. We evaluate NumericalDiff on 36 controlled cases comprising 675 pair/input instances: 36 execution-stack, 588 program-representation, and 51 program-logic instances. All 24 operator-injection instances expose trace differences, including three with tolerance-equal final outputs, while complete trace alignment is achieved for all 441 canonical cross-representation instances. Within the 51 program-logic instances, intervention improves 24 alignments and raises macro-average matching coverage from 0.4210 to 0.6513. The results show that value-based trace alignment and reexecution can delimit propagated numerical differences across heterogeneous implementations.
查看此版本解读 →查看此版本原文 ↗