Title: The `cases_generator` handles some instructions incorrectly · Issue #106250 · python/cpython · GitHub
Open Graph Title: The `cases_generator` handles some instructions incorrectly · Issue #106250 · python/cpython
X Title: The `cases_generator` handles some instructions incorrectly · Issue #106250 · python/cpython
Description: I triggered this assert... Traceback (most recent call last): File "/home/brandtbucher/cpython/./Tools/cases_generator/generate_cases.py", line 1609, in
Open Graph Description: I triggered this assert... Traceback (most recent call last): File "/home/brandtbucher/cpython/./Tools/cases_generator/generate_cases.py", line 1609, in
X Description: I triggered this assert... Traceback (most recent call last): File "/home/brandtbucher/cpython/./Tools/cases_generator/generate_cases.py", line 1609, in <module> main() File "/...
Opengraph URL: https://github.com/python/cpython/issues/106250
X: @github
Domain: github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"The `cases_generator` handles some instructions incorrectly","articleBody":"I triggered this `assert`...\r\n\r\n```py\r\nTraceback (most recent call last):\r\n File \"/home/brandtbucher/cpython/./Tools/cases_generator/generate_cases.py\", line 1609, in \u003cmodule\u003e\r\n main()\r\n File \"/home/brandtbucher/cpython/./Tools/cases_generator/generate_cases.py\", line 1604, in main\r\n a.write_metadata()\r\n File \"/home/brandtbucher/cpython/./Tools/cases_generator/generate_cases.py\", line 1260, in write_metadata\r\n assert not instr.active_caches, (instr.name, instr.cache_effects)\r\nAssertionError: ('TO_BOOL_ALWAYS_TRUE', [CacheEffect(context=\u003cPython/bytecodes.c: 1807-1810\u003e, name='unused', size=1), CacheEffect(context=\u003cPython/bytecodes.c: 1811-1814\u003e, name='version', size=2)]\r\n```\r\n\r\n...while defining this new instruction...\r\n\r\n```c\r\n inst(TO_BOOL_ALWAYS_TRUE, (unused/1, version/2, value -- res)) {\r\n // This one is a bit weird, because we expect *some* failures:\r\n assert(version);\r\n DEOPT_IF(Py_TYPE(value)-\u003etp_version_tag != version, TO_BOOL);\r\n STAT_INC(TO_BOOL, hit);\r\n DECREF_INPUTS();\r\n res = Py_True;\r\n }\r\n```\r\n\r\n@gvanrossum thinks that the `assert` is incorrect: it appears that the current code doesn't know how to handle an instruction that uses caches but *doesn't* have an oparg.\n\n\u003c!-- gh-linked-prs --\u003e\n### Linked PRs\n* gh-106252\n\u003c!-- /gh-linked-prs --\u003e\n","author":{"url":"https://github.com/brandtbucher","@type":"Person","name":"brandtbucher"},"datePublished":"2023-06-29T18:24:09.000Z","interactionStatistic":{"@type":"InteractionCounter","interactionType":"https://schema.org/CommentAction","userInteractionCount":0},"url":"https://github.com/106250/cpython/issues/106250"}
| 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:1ffbbe2f-824b-5a8d-9420-cfaf4ff7102c |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | D8DA:37ADE8:839997:B33F38:696AB536 |
| html-safe-nonce | fc369403c3083e8a58637bc454c920324239f5639b86647b9185f16f83f2d0be |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJEOERBOjM3QURFODo4Mzk5OTc6QjMzRjM4OjY5NkFCNTM2IiwidmlzaXRvcl9pZCI6IjI2NzYwMDE1Mjg5ODI3MTM2NTQiLCJyZWdpb25fZWRnZSI6ImlhZCIsInJlZ2lvbl9yZW5kZXIiOiJpYWQifQ== |
| visitor-hmac | df09a45fffbb4a79253ddd32efd77a9b9f3775f48396f5cb60b5cdeb9df91b27 |
| hovercard-subject-tag | issue:1781287017 |
| 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/106250/issue_layout |
| twitter:image | https://opengraph.githubassets.com/af66caf0e39de44d830ef5319d422964b25f0a34c1dd9a420d39dc88321d8436/python/cpython/issues/106250 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/af66caf0e39de44d830ef5319d422964b25f0a34c1dd9a420d39dc88321d8436/python/cpython/issues/106250 |
| og:image:alt | I triggered this assert... Traceback (most recent call last): File "/home/brandtbucher/cpython/./Tools/cases_generator/generate_cases.py", line 1609, in |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | brandtbucher |
| hostname | github.com |
| expected-hostname | github.com |
| None | 4fa1799b6a53c2d30c950d74230781bef9e7f61138c72c7727e4b83f0743752b |
| 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 | 41f276818bd204c4a30a0281fb3c576298d9474c |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width