JIT: _Py_uop_sym_set_recorded_type may receive a non-type at trace optimization time.
未關閉
還沒有人認領這個 Issue。
interpreter-core
topic-JIT
type-bug
- 主要語言
- Python
- 星號
- 77.2k
- 分支
- 36k
- PR 合併指標
- PR 指標待擷取
描述
Bug report
Bug description:
_Py_uop_sym_set_recorded_type asserts PyType_Check, but it's possible to have an instance change its __class__/type to a non-PyType_Check-ed class after JIT trace but right before JIT optimization time.
I think the fix is to convert that to a check instead of an assert?
CPython versions tested on:
CPython main branch
Operating systems tested on:
No response
貢獻指南
從這裡開始
- 先讀完整個 Issue,再讀專案的貢獻指南。
- 在 Issue 下留言說明你要接手 —— 這能避免兩個人做同樣的事。
- Fork 儲存庫,在一個分支上完成修改。
- 送出 Pull Request,並在描述裡引用這個 Issue 編號。
研究方向
首先定位 _Py_uop_sym_set_recorded_type 以及呼叫它的 JIT trace 最佳化路徑。重現報告中描述的 class 變更,然後驗證該最佳化能夠處理未通過 PyType_Check 的類別,且不會發生斷言失敗;如果找到相關的測試位置,則新增或更新回歸測試。
由索引模型根據 Issue 內容生成。
評估
- 技術堆疊
- python
- 領域
- compilers
- Issue 類型
- 缺陷
- 難度
- 3/5
- 預估耗時
- 1-2 天
- 活躍度
- 冷清
- 描述清晰度
- 基本清楚
- 新手友好度
- 52/100