Title: JIT: Optimization in `_CHECK_FUNCTION_VERSION` is wrong · Issue #146261 · python/cpython · GitHub
Open Graph Title: JIT: Optimization in `_CHECK_FUNCTION_VERSION` is wrong · Issue #146261 · python/cpython
X Title: JIT: Optimization in `_CHECK_FUNCTION_VERSION` is wrong · Issue #146261 · python/cpython
Description: Bug report Bug description: A function version may be modified midway in the trace, so we need to recheck and add a watcher in the first check. (All credits go to @Fidget-Spinner for pointing this out, #145080 (comment)) Ken Jin suggeste...
Open Graph Description: Bug report Bug description: A function version may be modified midway in the trace, so we need to recheck and add a watcher in the first check. (All credits go to @Fidget-Spinner for pointing this ...
X Description: Bug report Bug description: A function version may be modified midway in the trace, so we need to recheck and add a watcher in the first check. (All credits go to @Fidget-Spinner for pointing this ...
Opengraph URL: https://github.com/python/cpython/issues/146261
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"JIT: Optimization in `_CHECK_FUNCTION_VERSION` is wrong","articleBody":"# Bug report\n\n### Bug description:\n\n~~A function version may be modified midway in the trace, so we need to recheck and add a watcher in the first check.\n(All credits go to @Fidget-Spinner for pointing this out, https://github.com/python/cpython/pull/145080#discussion_r2969429010)~~\n\nKen Jin suggested to restore the old optimization instead as the fix above the will result in quite bad performance, as it’s calling it on every function deallocation.\nThe PR will also include a tiny bugfix found in `_Py_uop_sym_set_func_version`\n\nWill open a PR soon\n\n### CPython versions tested on:\n\n3.15, CPython main branch\n\n### Operating systems tested on:\n\n_No response_\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-146291\n* gh-146300\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/Sacul0457","@type":"Person","name":"Sacul0457"},"datePublished":"2026-03-21T16:47:11.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":1},"url":"https://github.com/146261/cpython/issues/146261"}
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:fe8a0c70-c669-317c-2786-0b9e84b55a31 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | 82E0:446DE:482917B:64E7991:6A5074A5 |
| html-safe-nonce | 4453dfeaa2ce8a502e6306dddd3aa53df59c0b16f6d22a48e85470d749d10dab |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI4MkUwOjQ0NkRFOjQ4MjkxN0I6NjRFNzk5MTo2QTUwNzRBNSIsInZpc2l0b3JfaWQiOiIxNjgyMDI5MzcyMzc3MTY3MDEzIiwicmVnaW9uX2VkZ2UiOiJpYWQiLCJyZWdpb25fcmVuZGVyIjoiaWFkIn0= |
| visitor-hmac | 20efe9fb7cb6c65394d381ba8599878dbc71c9ed1fd00f40c2169a5add824383 |
| hovercard-subject-tag | issue:4113025275 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/python/cpython/146261/issue_layout |
| twitter:image | https://opengraph.githubassets.com/2c80fb49f6f47177e7f946e4740330d14c60ed956104a49bf24adfcc94692b5c/python/cpython/issues/146261 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/2c80fb49f6f47177e7f946e4740330d14c60ed956104a49bf24adfcc94692b5c/python/cpython/issues/146261 |
| og:image:alt | Bug report Bug description: A function version may be modified midway in the trace, so we need to recheck and add a watcher in the first check. (All credits go to @Fidget-Spinner for pointing this ... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | Sacul0457 |
| hostname | github.com |
| expected-hostname | github.com |
| None | d6dc8294eb500fa36bbc57472d61fe87c522f9c3c1d64f70f4926f66a66a7efb |
| turbo-cache-control | no-preview |
| go-import | github.com/python/cpython git https://github.com/python/cpython.git |
| octolytics-dimension-user_id | 1525981 |
| octolytics-dimension-user_login | python |
| octolytics-dimension-repository_id | 81598961 |
| octolytics-dimension-repository_nwo | python/cpython |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 81598961 |
| octolytics-dimension-repository_network_root_nwo | python/cpython |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7ac0ad2f2c7e4b9056617355fd9e33e22b0c8df9 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width