gh-115999: Disable the specializing adaptive interpreter in free-threaded builds#116013
gh-115999: Disable the specializing adaptive interpreter in free-threaded builds#116013colesbury merged 7 commits intopython:mainfrom
Conversation
|
!buildbot nogil |
|
🤖 New build scheduled with the buildbot fleet by @colesbury for commit db4f433 🤖 The command will test the builders whose names match following regular expression: The builders matched are:
|
colesbury
left a comment
There was a problem hiding this comment.
This looks good to me, but I'd like someone working on the specializing interpreter to review it as well.
@brandtbucher, I saw your comment #115999. Would you be able to review this?
gvanrossum
left a comment
There was a problem hiding this comment.
I'll do the review. Looks good to me too. I was wondering if DECREMENT_ADAPTIVE_COUNTER() shouldn't just be an error. Otherwise only 1-2 nits.
|
Let me know if you need help figuring out the remaining test failures. |
|
The |
|
@swtaarrs - it looks like the free-threaded refleaks builds are broken on main: https://buildbot.python.org/all/#/builders/1226 |
|
Yeah, I've been trying (unsuccessfully) to bisect the failure for a bit. I'll update this PR with Guido's comment soon either way. |
|
This should be ready for review again. The test failures are from gh-116099. |
gvanrossum
left a comment
There was a problem hiding this comment.
Yeah! After the other PR lands you can merge the new main and then maybe @colesbury can merge this? (Or set up auto-merge.)
…e-threaded builds (python#116013) For now, disable all specialization when the GIL might be disabled.
…e-threaded builds (python#116013) For now, disable all specialization when the GIL might be disabled.
…e-threaded builds (python#116013) For now, disable all specialization when the GIL might be disabled.
For now, disable all specialization when the GIL might be disabled. We can reenable functionality as it is properly supported.
Disabling specialization was just a few lines in
pycore_code.h, then there are two related changes:Define an alternate implementation of
DECREMENT_ADAPTIVE_COUNTER()for free-threaded builds that aborts, as a sanity check.Add some code to the interpreter generator to avoid unused variable warnings for variables only used by code within
#ifdef ENABLE_SPECIALIZATIONblocks (likethis_instrandcounterhere). There are a variety of ways to suppress these warnings. I went with(void)foo;because it seemed like the most straightforward option, but I'm open to other suggestions. (Py_UNUSED(foo)won't work since it's intended for variables that are completely unused, and it changes the variable's name to_unused_foo.)Issue: Make the specializing interpreter thread-safe in
--disable-gilbuilds #115999