Title: GH-98686: Get rid of "adaptive" and "quick" instructions by brandtbucher · Pull Request #99182 · python/cpython · GitHub
Open Graph Title: GH-98686: Get rid of "adaptive" and "quick" instructions by brandtbucher · Pull Request #99182 · python/cpython
X Title: GH-98686: Get rid of "adaptive" and "quick" instructions by brandtbucher · Pull Request #99182 · python/cpython
Description: This gets us one step closer to skipping the quickening step entirely for new code objects... with this change, quickening only involves inserting superinstructions and initializing warmup counters. We do this by getting rid of the EXTENDED_ARG_QUICK instruction and making all specializable opcodes contain their own adaptive logic. Getting this right is a bit tricky, since there are four cases where we want to execute an unquickened instruction: When the instruction is warming up. When a specialized instruction fails a guard. When the instruction is backing off after a failed specialization attempt. When we're tracing. The key insight here is that the logic is identical for the first three cases: Check if the counter is zero. If so, try to specialize. If not, decrement the counter and run the instruction. All that we need to do is change the miss counters for specialized instructions to use the same format as the adaptive backoff counter, and the same code paths can be shared. We skip all of this in the fourth case (tracing) with a simple if (!cframe.use_tracing) { ... } guard around the adaptive code (maybe there's a clever way of avoiding this branch, but I doubt it's actually very expensive in practice). Finally, as an added bonus, merging these code paths allows specialization misses to jump directly into the unquickened instructions, rather than using an indirect jump through a shared miss block. Issue: gh-98686
Open Graph Description: This gets us one step closer to skipping the quickening step entirely for new code objects... with this change, quickening only involves inserting superinstructions and initializing warmup counters...
X Description: This gets us one step closer to skipping the quickening step entirely for new code objects... with this change, quickening only involves inserting superinstructions and initializing warmup counters...
Opengraph URL: https://github.com/python/cpython/pull/99182
X: @github
Domain: github.com
| route-pattern | /:user_id/:repository/pull/:id/checks(.:format) |
| route-controller | pull_requests |
| route-action | checks |
| fetch-nonce | v2:dac3d85d-c56f-f67c-ddbd-414e8cccadae |
| current-catalog-service-hash | 87dc3bc62d9b466312751bfd5f889726f4f1337bdff4e8be7da7c93d6c00a25a |
| request-id | EACC:21279A:94BAF2:BFDCED:696B1C26 |
| html-safe-nonce | a4982219ff8d297bb53c20ea088922022f4b73c341934fede845efa43e1d58eb |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFQUNDOjIxMjc5QTo5NEJBRjI6QkZEQ0VEOjY5NkIxQzI2IiwidmlzaXRvcl9pZCI6IjgxMzQwMDAzMzc3NDQ3NjMyNiIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 6d1cf45ed7493a476c61ebefd9ee75afcce3bb3aa383d3877a6a3b2d6e0f9e50 |
| hovercard-subject-tag | pull_request:1112234794 |
| github-keyboard-shortcuts | repository,pull-request-list,pull-request-conversation,pull-request-files-changed,checks,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/python/cpython/pull/99182/checks |
| twitter:image | https://avatars.githubusercontent.com/u/40968415?s=400&v=4 |
| twitter:card | summary_large_image |
| og:image | https://avatars.githubusercontent.com/u/40968415?s=400&v=4 |
| og:image:alt | This gets us one step closer to skipping the quickening step entirely for new code objects... with this change, quickening only involves inserting superinstructions and initializing warmup counters... |
| og:site_name | GitHub |
| og:type | object |
| hostname | github.com |
| expected-hostname | github.com |
| None | 5f99f7c1d70f01da5b93e5ca90303359738944d8ab470e396496262c66e60b8d |
| 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 full-width full-width-p-0 |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 82560a55c6b2054555076f46e683151ee28a19bc |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
Links:
Viewport: width=device-width