gh-95795: Move types.next_version_tag to PyInterpreterState#102343
gh-95795: Move types.next_version_tag to PyInterpreterState#102343ericsnowcurrently merged 9 commits intopython:mainfrom
Conversation
There was a problem hiding this comment.
One minor note from a first readthrough. Honestly, I have no idea why this PR would cause an assertion failure in insertdict during an attribute load. Everything about that seems wrong.
Maybe try rerunning locally, but setting ENABLE_SPECIALIZATION = False in opcode.py and regenerating everything. That way we can try to figure out if specialization is indeed the culprit, or if this is maybe some freeze/deepfreeze weirdness.
| the same __name__, for any __name__. Since that's a static property, it is | ||
| appropriate to declare fixed-size arrays for this. */ | ||
| #define MAX_EQUIV 10 | ||
| #define _Py_TYPE_BASE_VERSION_TAG (2<<16) |
There was a problem hiding this comment.
Did you mean (1<<16) here? This is currently the same as (1<<17)...
|
FYI, this PR is blocked by code objects being shared for deep-frozen modules. |
|
It seems like this PR will effectively mean that there will now be only 2^16 type versions available to heap types? This seems too low, since we estimate (for instance) that Instagram likely has somewhere around 2^16 heap types, period, without even considering modifications to types. It seems preferable if we can allocate fewer bits to the static types (since there aren't that many) and more to the heap types. |
|
Ignore my above comment; I misunderstood how this PR works. There are still (2^32) - (2^16) types available to heap types, which is much more than plenty. |
* main: pythongh-103801: Tools/wasm linting and formatting (python#103796) pythongh-103673: Add missing ForkingUnixStreamServer and ForkingUnixDatagramServer socketservers (python#103674) pythongh-95795: Move types.next_version_tag to PyInterpreterState (pythongh-102343)
Core static types will continue to use the global value. All other types will use the per-interpreter value. They all share the same range, where the global types use values < 2^16 and each interpreter uses values higher than that.