René's URL Explorer Experiment


Title: JIT: Different behaviors when JIT is enabled. · Issue #144681 · python/cpython · GitHub

Open Graph Title: JIT: Different behaviors when JIT is enabled. · Issue #144681 · python/cpython

X Title: JIT: Different behaviors when JIT is enabled. · Issue #144681 · python/cpython

Description: Bug report Bug description: Below is the example I triggered. i am in commit 3dadc22a2796af7718f1aec02e30f100ac6553bd of the main branch. The CPython is compiled with --with-pydebug --enable-experimental-jit. OS is ubuntu24.04. With PYTH...

Open Graph Description: Bug report Bug description: Below is the example I triggered. i am in commit 3dadc22a2796af7718f1aec02e30f100ac6553bd of the main branch. The CPython is compiled with --with-pydebug --enable-experi...

X Description: Bug report Bug description: Below is the example I triggered. i am in commit 3dadc22a2796af7718f1aec02e30f100ac6553bd of the main branch. The CPython is compiled with --with-pydebug --enable-experi...

Opengraph URL: https://github.com/python/cpython/issues/144681

X: @github

direct link

Domain: github.com


Hey, it has json ld scripts:
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"JIT: Different behaviors when JIT is enabled.","articleBody":"# Bug report\n\n### Bug description:\n\nBelow is the example I triggered. i am in commit `3dadc22a2796af7718f1aec02e30f100ac6553bd` of the main branch.\nThe CPython is compiled with `--with-pydebug --enable-experimental-jit`. OS is `ubuntu24.04`.\nWith `PYTHON_JIT=0 python ./test.py ` we successfully get `we finished`.\nHowever with `PYTHON_JIT=1 python ./test.py`,\nWe get\n```\npython: Python/optimizer.c:804: _PyJit_translate_single_bytecode_to_trace: Assertion `jump_happened == (target_instr[1].cache & 1)' failed.\nAborted (core dumped)\n```\nCode is below\n\n```python\n\n\nimport random\nfuzzer_rng = random.Random(1070)\nfrom random import random\nfrom sys import stderr\n\ndef uop_harness_f1():\n    import gc\n    gc.set_threshold(1)\n\n    class _SurferA:\n\n        def __init__(self, val):\n            self.val = val\n\n        def __bool__(self):\n            self.__class__ = _SurferB\n            return True\n\n        def __int__(self):\n            self.__class__ = _SurferB\n            return int(self.val)\n\n        def __index__(self):\n            self.__class__ = _SurferB\n            return int(self.val)\n\n        def __add__(self, other):\n            self.__class__ = _SurferB\n            return self.val + other\n\n    class _SurferB:\n\n        def __init__(self, val):\n            self.val = val\n\n        def __bool__(self):\n            self.__class__ = _SurferA\n            return False\n\n        def __int__(self):\n            self.__class__ = _SurferA\n            return int(self.val)\n\n        def __index__(self):\n            self.__class__ = _SurferA\n            return int(self.val)\n\n        def __add__(self, other):\n            self.__class__ = _SurferA\n            return self.val + other\n\n    class ChaoticIterator_comp_8805:\n\n        def __init__(self, items):\n            self._items = list(items)\n            self._index = 0\n\n        def __iter__(self):\n            return self\n\n        def __next__(self):\n            if fuzzer_rng.random() \u003c 0.05:\n                self._items.clear()\n            if fuzzer_rng.random() \u003c 0.05:\n                self._items.extend([999, 'chaos', None])\n            if fuzzer_rng.random() >= 0.1:\n                return 'unexpected_type_from_iterator'\n            if self._index >= len(self._items):\n                raise StopIteration\n            item = self._items[self._index]\n            self._index += 1\n            return item\n    evil_iter_comp_8805 = ChaoticIterator_comp_8805(range(200))\n    try:\n        _ = [x + y for x in evil_iter_comp_8805 for y in evil_iter_comp_8805 if evil_iter_comp_8805._items.append(x) or True]\n    except Exception:\n        pass\n\nfor i_f1 in range(300):\n    try:\n        final_harness_locals = uop_harness_f1()\n    except Exception as e:\n        print(f'EXCEPTION: {e.__class__.__name__}: {e}', file=stderr)\n        pass\nprint(\"we finished\")\n```\n\nBelow is the diff i used to trigger JIT easier\n```\ndiff --git a/Include/internal/pycore_backoff.h b/Include/internal/pycore_backoff.h\nindex ee907ae0534..7fd2c960cc4 100644\n--- a/Include/internal/pycore_backoff.h\n+++ b/Include/internal/pycore_backoff.h\n@@ -125,7 +125,7 @@ trigger_backoff_counter(void)\n // For example, 4095 does not work for the nqueens benchmark on pyperformance\n // as we always end up tracing the loop iteration's\n // exhaustion iteration. Which aborts our current tracer.\n-#define JUMP_BACKWARD_INITIAL_VALUE 4000\n+#define JUMP_BACKWARD_INITIAL_VALUE 63\n #define JUMP_BACKWARD_INITIAL_BACKOFF 6\n static inline _Py_BackoffCounter\n initial_jump_backoff_counter(_PyOptimizationConfig *opt_config)\n@@ -139,7 +139,7 @@ initial_jump_backoff_counter(_PyOptimizationConfig *opt_config)\n  * Must be larger than ADAPTIVE_COOLDOWN_VALUE,\n  * otherwise when a side exit warms up we may construct\n  * a new trace before the Tier 1 code has properly re-specialized. */\n-#define SIDE_EXIT_INITIAL_VALUE 4000\n+#define SIDE_EXIT_INITIAL_VALUE 63\n #define SIDE_EXIT_INITIAL_BACKOFF 6\n \n static inline _Py_BackoffCounter\ndiff --git a/Include/internal/pycore_optimizer.h b/Include/internal/pycore_optimizer.h\nindex 79a2d60eb78..ac7d9205e74 100644\n--- a/Include/internal/pycore_optimizer.h\n+++ b/Include/internal/pycore_optimizer.h\n@@ -173,7 +173,7 @@ PyAPI_FUNC(void) _Py_Executors_InvalidateCold(PyInterpreterState *interp);\n // Used as the threshold to trigger executor invalidation when\n // executor_creation_counter is greater than this value.\n // This value is arbitrary and was not optimized.\n-#define JIT_CLEANUP_THRESHOLD 1000\n+#define JIT_CLEANUP_THRESHOLD 10000\n \n int _Py_uop_analyze_and_optimize(\n     _PyThreadStateImpl *tstate,\ndiff --git a/Include/internal/pycore_optimizer_types.h b/Include/internal/pycore_optimizer_types.h\nindex 57c0c828c2a..afe2804eaba 100644\n--- a/Include/internal/pycore_optimizer_types.h\n+++ b/Include/internal/pycore_optimizer_types.h\n@@ -12,7 +12,7 @@ extern \"C\" {\n #include \"pycore_uop.h\"  // UOP_MAX_TRACE_LENGTH\n \n // Holds locals, stack, locals, stack ... (in that order)\n-#define MAX_ABSTRACT_INTERP_SIZE 512\n+#define MAX_ABSTRACT_INTERP_SIZE 8192\n \n #define TY_ARENA_SIZE (UOP_MAX_TRACE_LENGTH * 5)\n \n@@ -23,7 +23,7 @@ extern \"C\" {\n // progress (and inserting a new ENTER_EXECUTOR instruction). In practice, this\n // is the \"maximum amount of polymorphism\" that an isolated trace tree can\n // handle before rejoining the rest of the program.\n-#define MAX_CHAIN_DEPTH 4\n+#define MAX_CHAIN_DEPTH 16\n \n /* Symbols */\n /* See explanation in optimizer_symbols.c */\ndiff --git a/Python/optimizer.c b/Python/optimizer.c\nindex bf5d8a28264..acad398ec35 100644\n--- a/Python/optimizer.c\n+++ b/Python/optimizer.c\n@@ -534,7 +534,7 @@ guard_ip_uop[MAX_UOP_ID + 1] = {\n \n \n #define CONFIDENCE_RANGE 1000\n-#define CONFIDENCE_CUTOFF 333\n+#define CONFIDENCE_CUTOFF 100\n \n #ifdef Py_DEBUG\n #define DPRINTF(level, ...) \\\n```\n\n\n### CPython versions tested on:\n\nCPython main branch\n\n### Operating systems tested on:\n\nLinux\n\n\u003c!-- gh-linked-prs -->\n### Linked PRs\n* gh-144742\n\u003c!-- /gh-linked-prs -->\n","author":{"url":"https://github.com/nevercodecorrect","@type":"Person","name":"nevercodecorrect"},"datePublished":"2026-02-10T17:37:05Z","url":"https://github.com/python/cpython/issues/144681"}

react-profiling0
react-import-mapreact,react-dom,react-dom/client,react-dom/profiling,react-is,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@b8488ee2c322
route-pattern/_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format)
route-controllervoltron_issues_fragments
route-actionissue_layout
fetch-noncev2:ec583c28-de68-19c0-7c15-0af7bef3f09b
current-catalog-service-hash81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114
request-id863A:785A9:440D91E:5643F65:6B022F49
html-safe-nonce0085056b45524df83a1d39002b7c395daf2332e266f6615d9adbd2a0bfd994be
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4NjNBOjc4NUE5OjQ0MEQ5MUU6NTY0M0Y2NTo2QjAyMkY0OSIsInZpc2l0b3JfaWQiOiI4MDI3ODQ1NzY4NDMxOTM5NDAxIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0=
visitor-hmac462ba76422f39b7838ddb2610d7b6314c7ab5aed7697d973e9553c40f57aa708
hovercard-subject-tagissue:3922732229
github-keyboard-shortcutsrepository,issues,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///voltron/issues_fragments/issue_layout
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/144681/issue_layout
twitter:imagehttps://opengraph.githubassets.com/d15c00bad8d9cd1d826bc778800c01facc4466c161b8b08b42ba06095053f749/python/cpython/issues/144681
twitter:cardsummary_large_image
og:imagehttps://opengraph.githubassets.com/d15c00bad8d9cd1d826bc778800c01facc4466c161b8b08b42ba06095053f749/python/cpython/issues/144681
og:image:altBug report Bug description: Below is the example I triggered. i am in commit 3dadc22a2796af7718f1aec02e30f100ac6553bd of the main branch. The CPython is compiled with --with-pydebug --enable-experi...
og:image:width1200
og:image:height600
og:site_nameGitHub
og:typeobject
og:author:usernamenevercodecorrect
hostnamegithub.com
expected-hostnamegithub.com
None87e774ee7c6b3bee0490394e4d3e57ec9dbc956f74b87ea685dc8996c1676456
turbo-cache-controlno-preview
go-importgithub.com/python/cpython git https://github.com/python/cpython.git
octolytics-dimension-user_id1525981
octolytics-dimension-user_loginpython
octolytics-dimension-repository_id81598961
octolytics-dimension-repository_nwopython/cpython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id81598961
octolytics-dimension-repository_network_root_nwopython/cpython
turbo-body-classeslogged-out env-production page-responsive
disable-turbofalse
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release423dbb54c5e7bfecc838eb387c1435eb3d0e760d
ui-targetfull
theme-color#1e2327
color-schemelight dark
react-app-nameissues

Links:

Skip to contenthttps://github.com/python/cpython/issues/144681#start-of-content
https://github.com/
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F144681
GitHubRepository hosting, code review, and collaborationhttps://github.com/platform
CopilotAI coding agent for tasks, projects, and automated workhttps://github.com/features/copilot
ActionsCI/CD and automationhttps://github.com/features/actions
Code QualityQuality analysis, fixes, and enforcementhttps://github.com/features/code-quality
CodespacesCloud development environmentshttps://github.com/features/codespaces
Code SecurityVulnerability detection and remediationhttps://github.com/security/advanced-security/code-security
Secret ProtectionSecret scanning and leak preventionhttps://github.com/security/advanced-security/secret-protection
All Featureshttps://github.com/features
Documentationhttps://docs.github.com/en
Traininghttps://learn.github.com/skills
Certificationshttps://learn.github.com/credentials
Build with Copilothttps://github.com/features/ai
Customize Copilothttps://docs.github.com/en/copilot/how-tos/copilot-on-github/customize-copilot/customize-copilot-overview
Integrationshttps://github.com/marketplace
Trending reposhttps://github.com/trending
GitHub Sponsorshttps://github.com/open-source/sponsors
Developer articleshttps://github.com/resources/articles
ChangelogYour source for the latest features, improvements, and fixes across GitHub products, all in one place.https://github.blog/changelog/
Enterpriseshttps://github.com/enterprise
Teamhttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
Healthcarehttps://github.com/solutions/industry/healthcare
Financial serviceshttps://github.com/solutions/industry/financial-services
Manufacturinghttps://github.com/solutions/industry/manufacturing
Governmenthttps://github.com/solutions/industry/government
See all industrieshttps://github.com/solutions/industry
Why GitHubhttps://github.com/why-github
Customer Storieshttps://github.com/customer-stories
Business insightshttps://github.com/solutions/executive-insights
Trust Centerhttps://github.com/trust-center
GitHub Advanced SecurityEnterprise-grade code securityhttps://github.com/security/advanced-security
Copilot for businessEnterprise-grade AI featureshttps://github.com/features/copilot/copilot-business
Premium SupportEnterprise-grade 24/7 supporthttps://github.com/enterprise/premium-support
Documentationhttps://docs.github.com/en
Resource centerhttps://github.com/resources
Bloghttps://github.blog/
Events & webinarshttps://github.com/resources/events
Community Forumhttps://github.com/orgs/community/discussions
Customer Storieshttps://github.com/customer-stories
Integrationshttps://github.com/marketplace
Customer supporthttps://help.github.com/
Traininghttps://learn.github.com/skills
GitHub Statushttps://www.githubstatus.com/
Abouthttps://github.com/about
Partnershttps://github.com/partners
Changeloghttps://github.blog/changelog/
GitHub UniverseThe event for developers, by developers — talks, workshops, and what’s next for GitHub.https://githubuniverse.com/
Pricinghttps://github.com/pricing
Sign inhttps://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fissues%2F144681
Sign uphttps://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fvoltron%2Fissues_fragments%2Fissue_layout&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/issues/144681
Reloadhttps://github.com/python/cpython/issues/144681
Reloadhttps://github.com/python/cpython/issues/144681
pythonhttps://github.com/python
cpythonhttps://github.com/python/cpython
Codehttps://github.com/python/cpython
Issues5k+ (5k+)https://github.com/python/cpython/issues
Pull requests2.4k (2.4k)https://github.com/python/cpython/pulls
Actionshttps://github.com/python/cpython/actions
Projectshttps://github.com/python/cpython/projects
Security and qualityhttps://github.com/python/cpython/security
Insightshttps://github.com/python/cpython/insights
https://github.com/python/cpython
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/144681
New issuehttps://github.com/login?return_to=https://github.com/python/cpython/issues/144681
JIT: Different behaviors when JIT is enabled.https://github.com/python/cpython/issues/144681#top
interpreter-core(Objects, Python, Grammar, and Parser dirs)https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22interpreter-core%22
topic-JIThttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-JIT%22
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
https://github.com/nevercodecorrect
nevercodecorrecthttps://github.com/nevercodecorrect
on Feb 10, 2026https://github.com/python/cpython/issues/144681#issue-3922732229
gh-144681: Fix JIT trace builder assertion failure when conditional branch jump target coincides with fallthrough target #144742https://github.com/python/cpython/pull/144742
nevercodecorrecthttps://github.com/nevercodecorrect
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
on Feb 10, 2026https://github.com/python/cpython/issues/144681#event-22681491880
StanFromIrelandhttps://github.com/StanFromIreland
topic-JIThttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-JIT%22
interpreter-core(Objects, Python, Grammar, and Parser dirs)https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22interpreter-core%22
on Feb 10, 2026https://github.com/python/cpython/issues/144681#event-22684225360
cocolatohttps://github.com/cocolato
on Mar 9, 2026https://github.com/python/cpython/issues/144681#event-23398910592
Merge branch 'main' into fix-pythongh-144681https://github.com/cocolato/cpython/commit/1870e2f777f7c1d89e1670817e22b3ff4703f94f
pythongh-144681https://github.com/python/cpython/issues/144681
1870e2fhttps://github.com/cocolato/cpython/commit/1870e2f777f7c1d89e1670817e22b3ff4703f94f
Merge branch 'main' into fix-pythongh-144681https://github.com/cocolato/cpython/commit/c36251c2fc34b44a7439b9e18c25ccbe900b7678
pythongh-144681https://github.com/python/cpython/issues/144681
c36251chttps://github.com/cocolato/cpython/commit/c36251c2fc34b44a7439b9e18c25ccbe900b7678
markshannonhttps://github.com/markshannon
on Mar 9, 2026https://github.com/python/cpython/issues/144681#event-23405075598
Merge branch 'main' into fix-pythongh-144681https://github.com/cocolato/cpython/commit/aa8ef2ecd96a080fc7997df305424055c309135f
pythongh-144681https://github.com/python/cpython/issues/144681
aa8ef2ehttps://github.com/cocolato/cpython/commit/aa8ef2ecd96a080fc7997df305424055c309135f
cocolatohttps://github.com/cocolato
on Mar 10, 2026https://github.com/python/cpython/issues/144681#event-23417207897
Merge branch 'main' into fix-pythongh-144681https://github.com/cocolato/cpython/commit/d84ef062aafba6033107a3afbaec91cd52bbecba
pythongh-144681https://github.com/python/cpython/issues/144681
d84ef06https://github.com/cocolato/cpython/commit/d84ef062aafba6033107a3afbaec91cd52bbecba
Fidget-Spinnerhttps://github.com/Fidget-Spinner
on Mar 10, 2026https://github.com/python/cpython/issues/144681#event-23417904187
gh-144681: Fix JIT trace builder assertion failure when conditional b…https://github.com/python/cpython/commit/66eafc9ea74e5233f2c46b424729d6dadfbb3111
gh-144681https://github.com/python/cpython/issues/144681
66eafc9https://github.com/python/cpython/commit/66eafc9ea74e5233f2c46b424729d6dadfbb3111
cocolatohttps://github.com/cocolato
completedhttps://github.com/python/cpython/issues?q=is%3Aissue%20state%3Aclosed%20archived%3Afalse%20reason%3Acompleted
on Mar 10, 2026https://github.com/python/cpython/issues/144681#event-23425548371
ljfphttps://github.com/ljfp
on Apr 25, 2026https://github.com/python/cpython/issues/144681#event-24868324541
pythongh-144681: Fix JIT trace builder assertion failure when conditi…https://github.com/ljfp/cpython/commit/896c961fa5a9e534f6ba97abf9a481f207a1a556
pythongh-144681https://github.com/python/cpython/issues/144681
896c961https://github.com/ljfp/cpython/commit/896c961fa5a9e534f6ba97abf9a481f207a1a556
Sign up for freehttps://github.com/signup?return_to=https://github.com/python/cpython/issues/144681
Sign in to commenthttps://github.com/login?return_to=https://github.com/python/cpython/issues/144681
interpreter-core(Objects, Python, Grammar, and Parser dirs)https://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22interpreter-core%22
topic-JIThttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22topic-JIT%22
type-bugAn unexpected behavior, bug, or errorhttps://github.com/python/cpython/issues?q=state%3Aopen%20label%3A%22type-bug%22
https://github.com
Termshttps://docs.github.com/site-policy/github-terms/github-terms-of-service
Privacyhttps://docs.github.com/site-policy/privacy-policies/github-privacy-statement
Securityhttps://github.com/security
Statushttps://www.githubstatus.com/
Communityhttps://github.community/
Docshttps://docs.github.com/
Contacthttps://support.github.com?tags=dotcom-footer

Viewport: width=device-width


URLs of crawlers that visited me.