gh-115999: Disable the specializing adaptive interpreter in free-threaded builds#116013
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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