You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
JIT: _Py_uop_sym_set_recorded_type may receive a non-type at trace optimization time. #148439
_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?
Hey @Fidget-Spinner , I just wrapped up PR #148373 on the cases generator and would love to take this one on!
Just to confirm your proposed fix: you want to replace the assert(PyType_Check(type)) inside _Py_uop_sym_set_recorded_type with a standard runtime check (e.g., if (!PyType_Check(type))) that bails out/returns gracefully if it receives a non-type?
Makes total sense! Better to fail loudly if the upstream state is invalid rather than silently papering over a deeper bug. I'll keep an eye on the thread to see what Mark thinks. If it turns out we need to hunt down the root cause upstream, just point me in the right direction and I'd be happy to help investigate
Activity
adityakrmishra commentedon Apr 12, 2026
Hey @Fidget-Spinner , I just wrapped up PR #148373 on the cases generator and would love to take this one on!
Just to confirm your proposed fix: you want to replace the assert(PyType_Check(type)) inside _Py_uop_sym_set_recorded_type with a standard runtime check (e.g., if (!PyType_Check(type))) that bails out/returns gracefully if it receives a non-type?
If so, I can get a PR up for this today
Fidget-Spinner commentedon Apr 12, 2026
Lets wait to hear what @markshannon thinks of this. The problem is this may be obscuring a bug somewhere else
adityakrmishra commentedon Apr 12, 2026
Makes total sense! Better to fail loudly if the upstream state is invalid rather than silently papering over a deeper bug. I'll keep an eye on the thread to see what Mark thinks. If it turns out we need to hunt down the root cause upstream, just point me in the right direction and I'd be happy to help investigate