python / python/cpython

Widen specialized int fast paths to full int64 range

未关闭
#150,424 8 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

还没有人认领这个 Issue。

interpreter-core performance type-feature
主要语言
Python
星标
77.2k
派生
35.9k
PR 合并指标
PR 指标待抓取

描述

This work widens the interpreter’s specialized int fast paths (tier-2 / uop execution) from the compact-only range to the full int64_t range.

It also fixes follow-up correctness issues in the widened specialized paths for non-compact exact PyLongObjects and on 15-bit builds.

Scope:

  • widen specialized integer add/subtract/multiply fast paths to operate across the full int64_t range
  • accept exact int operands that fit in int64_t, including non-compact PyLongObjects
  • keep specialized in-place mutation compact-only and fall back safely for non-compact inputs
  • handle widened integer compare without compact-only assumptions
  • construct widened arithmetic results with PyLong_FromInt64() so 15-bit builds do not narrow through stwodigits
  • add regression coverage for widened operations, non-compact exact ints, boundary cases, and overflow fallback
  • add benchmark scripts for measuring widened specialized integer fast-path performance
Linked PRs
  • gh-150425

贡献指南

打开贡献指南

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

调研方向

首先定位解释器在 tier-2/uop 中针对整数加法、减法、乘法和比较的专用快速路径,包括对 PyLongObject 操作数的处理。检查为扩展运算添加的回归覆盖和基准测试脚本,然后验证完整的 int64_t 边界、非紧凑型 Exact Int、溢出回退、原地变更行为以及 15-bit 构建。

由索引模型根据 Issue 内容生成。

评估

技术栈
c, python
领域
compilers
Issue 类型
功能
难度
5/5
预计耗时
一周以上
活跃度
停滞
描述清晰度
基本清楚
新手友好度
25/100

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。