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 摘要。