AGENT PULSESJCPal Special EditionAI 行业证据与趋势
2026年9月10日 · PyTorch Dynamo

viable/strict/1789014646: [Dynamo] Port CPython 3.13 test_copy to Dynamo test suite (#196456)

发生了什么

PyTorch 仓库的 viable/strict 与 trunk 两个发布标签记录了同一 PR(#196456):把 CPython 3.13.5 的 test_copy 移植到 Dynamo 测试套件 test/cpython/v3_13/,按标准移植流程加入 Dynamo patch header、将三个测试类重绑定到 CPythonTestCase 并加 run_tests() footer。结果 81 个测试中 37 通过、44 个记为 expected failure,无上游 skip;eager 对照运行 81 个全部通过。44 个失败被分为三类:graph break 36、wrong answer 6、internal crash 2。

EVENT STORY

发展脉络

  1. 首次出现viable/strict/1789014646: [Dynamo] Port CPython 3.13 test_copy to Dynamo test suite (#196456)PyTorch Core
  2. 行业反馈trunk/2671203b4082c3c24d38b10cc44c8f7c9b98833b: [Dynamo] Port CPython 3.13 test_copy to Dynamo test suite (#196456)PyTorch Core
  3. 行业反馈viable/strict/1789030332: [Dynamo] Port CPython 3.13 test_grammar to Dynamo test suite (#196482)PyTorch Core
  4. 行业反馈viable/strict/1789098676: [dynamo] Port CPython 3.13 test_unary to Dynamo test suite (#196240)PyTorch Core
  5. 当前判断这类移植工作反映编译器项目在扩大 Python 语义覆盖时的常见路径:先以 expected failure 记录缺口,再按失败类型分诊。它本身不改变产品能力,但会逐步影响 Dynamo 在真实代码上的可编译比例与结果可信度。Agent Pulse · 分析
改变了什么

该 PR 的价值在于把 Dynamo 对 copy 模块的失败按类型拆分,而不是笼统记为 expected failure。36 个 graph break 中,gb0091 有 15 个,原因是「Attempted to read a cell variable that has not been populated yet」;gb0007 有 5 个,涉及不可追踪的 C builtins(dict.copy、list.copy、set.copy、gc.collect 等);gb0059 有 4 个,涉及 builtin 相关构造。另有 6 个 wrong answer 表示 Dynamo 能完成追踪但结果与 eager 不同,2 个 internal crash 表示 Dynamo 自身 tracer 的 Python 栈溢出。MiscTestCase 全部通过,TestReplace 有 1 个失败,其余 43 个集中在 TestCopy。eager 对照全通过,说明失败并非移植适配引入。

能力边界怎么变了

把 expected failure 细分为 graph break / wrong answer / internal crash 三类,比单一失败计数更有诊断价值:graph break 是覆盖缺口,wrong answer 是正确性风险,internal crash 是编译器自身健壮性问题,三者的修复优先级与回归风险不同。可验证的下一信号是 gb0091 对应的 cell variable 未填充问题是否在后续 PR 中被单独修复,以及 wrong answer 类是否被提升为必须修复而非 expected failure。

为什么重要

这类移植工作反映编译器项目在扩大 Python 语义覆盖时的常见路径:先以 expected failure 记录缺口,再按失败类型分诊。它本身不改变产品能力,但会逐步影响 Dynamo 在真实代码上的可编译比例与结果可信度。

对谁有影响

对依赖 torch.compile 的团队,这份分类清单可用于判断哪些 copy 相关写法可能触发 graph break 或结果不一致,从而在性能敏感路径上规避或加测试。价值在于风险可见性,而非直接性能收益。

接下来观察

若后续提交开始逐项关闭 gb0091 与 wrong answer 类失败,说明 Dynamo 的 Python 语义覆盖进入收敛阶段;若长期停留在 expected failure 清单,则说明该模块仍是已知盲区。可观察的下一信号是 test/cpython/v3_13/ 下同类移植 PR 的通过率变化。