Title: Changes to specialized instructions requires a magic number change. · Issue #109256 · python/cpython · GitHub
Open Graph Title: Changes to specialized instructions requires a magic number change. · Issue #109256 · python/cpython
X Title: Changes to specialized instructions requires a magic number change. · Issue #109256 · python/cpython
Description: Until #107971 only changes to the set of instructions present in the pyc file required a new version change. Now, removing or adding any opcode requires a pyc file. There are a few problems with this. pyc files have to be regenerated for...
Open Graph Description: Until #107971 only changes to the set of instructions present in the pyc file required a new version change. Now, removing or adding any opcode requires a pyc file. There are a few problems with th...
X Description: Until #107971 only changes to the set of instructions present in the pyc file required a new version change. Now, removing or adding any opcode requires a pyc file. There are a few problems with th...
Opengraph URL: https://github.com/python/cpython/issues/109256
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Changes to specialized instructions requires a magic number change.","articleBody":"Until #107971 only changes to the set of instructions present in the pyc file required a new version change.\r\nNow, removing or adding *any* opcode requires a pyc file.\r\nThere are a few problems with this.\r\n\r\n* pyc files have to be regenerated for changes unrelated to the on disk format.\r\n* This makes it much harder to add or remove specializations during the beta phase, as it will invalidate pyc files\r\n* It consumes an unnecessary number of magic numbers. This is not a big deal, but want to keep to a limit of 50 per release\r\n* It reduces stability in layout and thus performance, making meaningful benchmarking harder.\r\n* It is even easier to forget the magic number bump #109198\r\n\r\n### Proposal\r\n\r\nAllocate \"external\" opcodes to odd numbers.\r\nAllocate instrumented opcodes to the top region (as we do now)\r\nAllocate specialized and other internal opcodes to even numbers \r\n\r\nIt would also be nice to be able to specify the most common opcodes, so that tooling does a decent job of laying out the tables.\r\n\r\nWe might also consider generating a hash of the opcodes and checking it `test_opcodes` to ensure that the magic number is updated when necessary.\r\n\r\n@iritkatriel \n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-109269\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/markshannon","@type":"Person","name":"markshannon"},"datePublished":"2023-09-11T08:37:50.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":8},"url":"https://github.com/109256/cpython/issues/109256"}
| 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:460fd5af-97f2-e22c-e2e4-363d6d1ab5b5 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E34A:1FC3E6:3A0414:51CD02:696A0A2A |
| html-safe-nonce | 2a69b52509198b4b9f94cdad1e8cdadac4a5f5b060a07024fc4aa8a0af39156f |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFMzRBOjFGQzNFNjozQTA0MTQ6NTFDRDAyOjY5NkEwQTJBIiwidmlzaXRvcl9pZCI6IjIyNzgyOTAxMTU5MTA3MjI5OCIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 72f67ea4d8011a2d2016ccd1ae9f8a411d9707ef47cc7c8c7598f03e9b88baf7 |
| hovercard-subject-tag | issue:1889979825 |
| 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/109256/issue_layout |
| twitter:image | https://opengraph.githubassets.com/ac444105b276d12c128b5b00c594e642783ce754aba0513ff6d73a4dcee368a4/python/cpython/issues/109256 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/ac444105b276d12c128b5b00c594e642783ce754aba0513ff6d73a4dcee368a4/python/cpython/issues/109256 |
| og:image:alt | Until #107971 only changes to the set of instructions present in the pyc file required a new version change. Now, removing or adding any opcode requires a pyc file. There are a few problems with th... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | markshannon |
| hostname | github.com |
| expected-hostname | github.com |
| None | 699227a00bbb7fe1eec276d2ae1c3a93068bc5ba483bd9dc4b2a27a8f4f2f595 |
| 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 | 7266b2d935baa1c6474b16dd9feaa5ca30607261 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width