Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork34.2k
gh-144991: Use runtime JIT threshold in _testinternalcapi#145496
gh-144991: Use runtime JIT threshold in _testinternalcapi#145496corona10 wants to merge 4 commits intopython:mainfrom
Conversation
corona10 commentedMar 4, 2026
|
Modules/_testinternalcapi.c Outdated
| if (PyModule_Add(module,"TIER2_THRESHOLD", | ||
| // + 1 more due to one loop spent on tracing. | ||
| PyLong_FromLong(JUMP_BACKWARD_INITIAL_VALUE+2))<0) { | ||
| PyLong_FromLong(interp->opt_config.jump_backward_initial_value+2))<0) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
You may use PyLong_FromUnsignedLong() since the member is unsigned (uint16_t). Suggestion to use shorter lines:
PyInterpreterState*interp=PyInterpreterState_Get();// + 1 more due to one loop spent on tracing.unsigned longthreshold=interp->opt_config.jump_backward_initial_value+2;if (PyModule_Add(module,"TIER2_THRESHOLD",PyLong_FromUnsignedLong(threshold))<0) {return1; }
vstinner commentedMar 4, 2026
"aarch64-pc-windows-msvc/msvc (Debug)" failed with:
The recent change commite6c3c04 added a new static type to |
Uh oh!
There was an error while loading.Please reload this page.
Co-authored-by: Victor Stinner <vstinner@python.org>
Uh oh!
There was an error while loading.Please reload this page.
vstinner left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
LGTM
| /* For now we hard-code this to a value for which we are confident | ||
| all the static builtin types will fit (for all builds). */ | ||
| #define_Py_MAX_MANAGED_STATIC_BUILTIN_TYPES201 | ||
| #define_Py_MAX_MANAGED_STATIC_BUILTIN_TYPES202 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Why was this changed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others.Learn more.
Because a new static type was added recently, and JIT tests crash or fail with an assertion error without this change:#145496 (comment)
Uh oh!
There was an error while loading.Please reload this page.
test_sysfails withPYTHON_JIT_STRESS=1#144991