René's URL Explorer Experiment


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

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:83a31e36-749d-ef02-be94-7cb571e84818
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-id9AC8:15DFF5:15CDF84:1E18842:696AA5CB
html-safe-noncefc482486bf98d23ffbf54edbe7f9337330c4e3f241eb7ff68fd196027a21d91a
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiI5QUM4OjE1REZGNToxNUNERjg0OjFFMTg4NDI6Njk2QUE1Q0IiLCJ2aXNpdG9yX2lkIjoiNjg4MDMyMDc3ODUzNjY1ODM3OSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmac1594d5783996f1a87a12f3036c9a81c5c4ac9d9b2bdb2d3a924e1427c4f282ba
hovercard-subject-tagpull_request:1112234794
github-keyboard-shortcutsrepository,pull-request-list,pull-request-conversation,pull-request-files-changed,copilot
google-site-verificationApib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I
octolytics-urlhttps://collector.github.com/github/collect
analytics-location///pull_requests/show/files
fb:app_id1401488693436528
apple-itunes-appapp-id=1477376905, app-argument=https://github.com/python/cpython/pull/99182/files
twitter:imagehttps://avatars.githubusercontent.com/u/40968415?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/40968415?s=400&v=4
og:image:altThis 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_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
Nonea51f97dbb9326f71c08ecb61577457d543c602124d1a2672871258ef37ac5261
turbo-cache-controlno-preview
diff-viewunified
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 full-width
disable-turbotrue
browser-stats-urlhttps://api.github.com/_private/browser/stats
browser-errors-urlhttps://api.github.com/_private/browser/errors
release4bd0eac606c70914085176ef312ebdcd97a8cdf1
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/python/cpython/pull/99182/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F99182%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub SparkBuild and deploy intelligent appshttps://github.com/features/spark
GitHub ModelsManage and compare promptshttps://github.com/features/models
MCP RegistryNewIntegrate external toolshttps://github.com/mcp
ActionsAutomate any workflowhttps://github.com/features/actions
CodespacesInstant dev environmentshttps://github.com/features/codespaces
IssuesPlan and track workhttps://github.com/features/issues
Code ReviewManage code changeshttps://github.com/features/code-review
GitHub Advanced SecurityFind and fix vulnerabilitieshttps://github.com/security/advanced-security
Code securitySecure your code as you buildhttps://github.com/security/advanced-security/code-security
Secret protectionStop leaks before they starthttps://github.com/security/advanced-security/secret-protection
Why GitHubhttps://github.com/why-github
Documentationhttps://docs.github.com
Bloghttps://github.blog
Changeloghttps://github.blog/changelog
Marketplacehttps://github.com/marketplace
View all featureshttps://github.com/features
Enterpriseshttps://github.com/enterprise
Small and medium teamshttps://github.com/team
Startupshttps://github.com/enterprise/startups
Nonprofitshttps://github.com/solutions/industry/nonprofits
App Modernizationhttps://github.com/solutions/use-case/app-modernization
DevSecOpshttps://github.com/solutions/use-case/devsecops
DevOpshttps://github.com/solutions/use-case/devops
CI/CDhttps://github.com/solutions/use-case/ci-cd
View all use caseshttps://github.com/solutions/use-case
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
View all industrieshttps://github.com/solutions/industry
View all solutionshttps://github.com/solutions
AIhttps://github.com/resources/articles?topic=ai
Software Developmenthttps://github.com/resources/articles?topic=software-development
DevOpshttps://github.com/resources/articles?topic=devops
Securityhttps://github.com/resources/articles?topic=security
View all topicshttps://github.com/resources/articles
Customer storieshttps://github.com/customer-stories
Events & webinarshttps://github.com/resources/events
Ebooks & reportshttps://github.com/resources/whitepapers
Business insightshttps://github.com/solutions/executive-insights
GitHub Skillshttps://skills.github.com
Documentationhttps://docs.github.com
Customer supporthttps://support.github.com
Community forumhttps://github.com/orgs/community/discussions
Trust centerhttps://github.com/trust-center
Partnershttps://github.com/partners
GitHub SponsorsFund open source developershttps://github.com/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/accelerator
Archive Programhttps://archiveprogram.github.com
Topicshttps://github.com/topics
Trendinghttps://github.com/trending
Collectionshttps://github.com/collections
Enterprise platformAI-powered developer platformhttps://github.com/enterprise
GitHub Advanced SecurityEnterprise-grade security featureshttps://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/premium-support
Pricinghttps://github.com/pricing
Search syntax tipshttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
documentationhttps://docs.github.com/search-github/github-code-search/understanding-github-code-search-syntax
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2Fpython%2Fcpython%2Fpull%2F99182%2Ffiles
Sign up https://github.com/signup?ref_cta=Sign+up&ref_loc=header+logged+out&ref_page=%2F%3Cuser-name%3E%2F%3Crepo-name%3E%2Fpull_requests%2Fshow%2Ffiles&source=header-repo&source_repo=python%2Fcpython
Reloadhttps://github.com/python/cpython/pull/99182/files
Reloadhttps://github.com/python/cpython/pull/99182/files
Reloadhttps://github.com/python/cpython/pull/99182/files
python https://github.com/python
cpythonhttps://github.com/python/cpython
Please reload this pagehttps://github.com/python/cpython/pull/99182/files
Notifications https://github.com/login?return_to=%2Fpython%2Fcpython
Fork 33.9k https://github.com/login?return_to=%2Fpython%2Fcpython
Star 71.1k https://github.com/login?return_to=%2Fpython%2Fcpython
Code https://github.com/python/cpython
Issues 5k+ https://github.com/python/cpython/issues
Pull requests 2.1k https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects 31 https://github.com/python/cpython/projects
Security Uh oh! There was an error while loading. Please reload this page. https://github.com/python/cpython/security
Please reload this pagehttps://github.com/python/cpython/pull/99182/files
Insights https://github.com/python/cpython/pulse
Code https://github.com/python/cpython
Issues https://github.com/python/cpython/issues
Pull requests https://github.com/python/cpython/pulls
Actions https://github.com/python/cpython/actions
Projects https://github.com/python/cpython/projects
Security https://github.com/python/cpython/security
Insights https://github.com/python/cpython/pulse
Sign up for GitHub https://github.com/signup?return_to=%2Fpython%2Fcpython%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2Fpython%2Fcpython%2Fissues%2Fnew%2Fchoose
brandtbucherhttps://github.com/brandtbucher
python:mainhttps://github.com/python/cpython/tree/main
brandtbucher:merge-unquickened-and-adaptivehttps://github.com/brandtbucher/cpython/tree/merge-unquickened-and-adaptive
Conversation 8 https://github.com/python/cpython/pull/99182
Commits 25 https://github.com/python/cpython/pull/99182/commits
Checks 0 https://github.com/python/cpython/pull/99182/checks
Files changed https://github.com/python/cpython/pull/99182/files
Please reload this pagehttps://github.com/python/cpython/pull/99182/files
GH-98686: Get rid of "adaptive" and "quick" instructions https://github.com/python/cpython/pull/99182/files#top
Show all changes 25 commits https://github.com/python/cpython/pull/99182/files
2dc5e71 Combine all unquickened and adaptive instructions brandtbucher Oct 20, 2022 https://github.com/python/cpython/pull/99182/commits/2dc5e71d537bb215d343d4233d1b6f8b6a76d11f
15c806f Merge EXTENDED_ARG and EXTENDED_ARG_QUICK brandtbucher Oct 20, 2022 https://github.com/python/cpython/pull/99182/commits/15c806fc223ed8ab6c6357497dcc7443f6f942e3
7c164d2 Add back BINARY_OP_GENERIC and COMPARE_OP_GENERIC brandtbucher Oct 20, 2022 https://github.com/python/cpython/pull/99182/commits/7c164d272672a1e26dd9f4335a0821f112e3a341
2eda520 Merge the miss and backoff counters brandtbucher Oct 20, 2022 https://github.com/python/cpython/pull/99182/commits/2eda5205b0c7784736090adc6dfcc0c8e761523f
e36c5d7 make regen-cases brandtbucher Oct 20, 2022 https://github.com/python/cpython/pull/99182/commits/e36c5d718faf04cb7e40c36c84d919c50d76fa66
3caa5d4 Try inlining the miss label everywhere brandtbucher Oct 20, 2022 https://github.com/python/cpython/pull/99182/commits/3caa5d48eb620232c280f34aa12c87632ec8ade7
db558f1 Update adaptive.md brandtbucher Oct 21, 2022 https://github.com/python/cpython/pull/99182/commits/db558f12392ae66580b0273a8706efac06c8e310
b8796e6 Remove branching from EXTENDED_ARG brandtbucher Oct 21, 2022 https://github.com/python/cpython/pull/99182/commits/b8796e68063551b1e8c72721ed96ac4675c49ed6
a7a451b fixup brandtbucher Oct 21, 2022 https://github.com/python/cpython/pull/99182/commits/a7a451bdad25af74fc676e9ffc89d80e2d5d3c1a
6fdf5ad Remove tracing branches in adaptive instructions brandtbucher Oct 21, 2022 https://github.com/python/cpython/pull/99182/commits/6fdf5adf74f828b8466e4e018cd6c35512ed8fd0
e69e254 Remove error checking from many specializations brandtbucher Oct 21, 2022 https://github.com/python/cpython/pull/99182/commits/e69e254e15215460d728b1e5b076e7305f868df0
513aaab Fix macro brandtbucher Oct 21, 2022 https://github.com/python/cpython/pull/99182/commits/513aaab954e1a09b01d353d70632599303334463
a5c6cab Catch up with main brandtbucher Oct 21, 2022 https://github.com/python/cpython/pull/99182/commits/a5c6cab3d553e5993008b074c13df9f573633804
1cd6d66 Make sure stats overhead is disabled be default brandtbucher Oct 21, 2022 https://github.com/python/cpython/pull/99182/commits/1cd6d66d1f2754920b58f1f4cae2de906c19926e
ea175fc Use a single direct jump for misses brandtbucher Nov 5, 2022 https://github.com/python/cpython/pull/99182/commits/ea175fc6b74706dc227866903966e94f7e3cf59d
4dbff4d Catch up with main brandtbucher Nov 5, 2022 https://github.com/python/cpython/pull/99182/commits/4dbff4d4bdd397e13db73603f1af414305dd32ae
553ebab Revert some unrelated changes brandtbucher Nov 5, 2022 https://github.com/python/cpython/pull/99182/commits/553ebabc98ff7c7bb88392d6af7541f76d40e331
dc545bd Clean up the diff brandtbucher Nov 5, 2022 https://github.com/python/cpython/pull/99182/commits/dc545bda87a9f37c5b7c61f66590b71cf10a0423
3639b66 Clarify the reasoning behind each counter value brandtbucher Nov 5, 2022 https://github.com/python/cpython/pull/99182/commits/3639b66a409b6328cc0215de402b9b8ccd44aaac
84bc481 Merge EXTENDED_ARG and EXTENDED_ARG_QUICK brandtbucher Nov 5, 2022 https://github.com/python/cpython/pull/99182/commits/84bc48114d768b8dfd9883efa6bf9bf20c52af8e
6e60694 Catch up with main brandtbucher Nov 5, 2022 https://github.com/python/cpython/pull/99182/commits/6e606947e02b8f005c5c6f94b11fc8b30120a175
f885e6c Fix stats brandtbucher Nov 5, 2022 https://github.com/python/cpython/pull/99182/commits/f885e6c6e2e9db4787be9b47f18634fb345835dc
f33d882 fixup brandtbucher Nov 5, 2022 https://github.com/python/cpython/pull/99182/commits/f33d882b2e7ea77eb763a9f8cd92e8823f886cc3
cf98d4a blurb add brandtbucher Nov 6, 2022 https://github.com/python/cpython/pull/99182/commits/cf98d4aba6a2aa3e03b027bced7a0ead010f70a5
58698db Catch up with main brandtbucher Oct 21, 2022 https://github.com/python/cpython/pull/99182/commits/58698db86ea44dd0cd99a6dbf8b855df9a21d760
Clear filters https://github.com/python/cpython/pull/99182/files
Please reload this pagehttps://github.com/python/cpython/pull/99182/files
Please reload this pagehttps://github.com/python/cpython/pull/99182/files
pycore_code.h https://github.com/python/cpython/pull/99182/files#diff-97ea1759f82531a45fa685065ff86bc1077c3ab3d5f65220eea48b7730032bc8
pycore_opcode.h https://github.com/python/cpython/pull/99182/files#diff-7b986d4fccffcb2f2af4ec495559b2f0dc2e393e38f95e8ca3ef48e559177530
opcode.h https://github.com/python/cpython/pull/99182/files#diff-1cd1f0bb26c3fbaa279f83ee2bfe1d9072da7af07407111c79039c66034c57ed
dis.py https://github.com/python/cpython/pull/99182/files#diff-96747735ee3c8aed3dd0f4c1b1ab0310eeb344577b14887cc9f6605892df47a8
opcode.py https://github.com/python/cpython/pull/99182/files#diff-7681b13de881a13601ca56b73d052d032be48da4256df4f2f09e0474b0c1cbeb
test__opcode.py https://github.com/python/cpython/pull/99182/files#diff-ae73a75dc8c7af5ba9622b7222e7932d84851d64b5732b782f8525c157bfe12e
test_dis.py https://github.com/python/cpython/pull/99182/files#diff-fd7b118a01a9695dfa16eea9381d3c7b0652e1b7b55f51ff052a1f620d175642
test_embed.py https://github.com/python/cpython/pull/99182/files#diff-573be25566e43f5adc6650ad1b58d106dbbd79521cb9c6e6d5df9588616a1ffd
2022-11-06-00-47-11.gh-issue-98686.DBDy6U.rst https://github.com/python/cpython/pull/99182/files#diff-f3ae1acca6bd5c355c0ac3074278f1e717a25a55839ed3aa49b0a833e4924907
adaptive.md https://github.com/python/cpython/pull/99182/files#diff-e9684ac24ba1b98048a29738bab597cfaa0c2e538372aeaf9a5d5ceec0a2a587
bytecodes.c https://github.com/python/cpython/pull/99182/files#diff-729a985b0cb8b431cb291f1edb561bbbfea22e3f8c262451cd83328a0936a342
ceval.c https://github.com/python/cpython/pull/99182/files#diff-c22186367cbe20233e843261998dc027ae5f1f8c0d2e778abfa454ae74cc59de
compile.c https://github.com/python/cpython/pull/99182/files#diff-ebc983d9f91e5bcf73500e377ac65e85863c4f77fd5b6b6caf4fcdf7c0f0b057
generated_cases.c.h https://github.com/python/cpython/pull/99182/files#diff-4ef46fa654f95502e49a24f7dc8ee31a4cac9b3433fe9cd2b2d4dd78cfbad448
opcode_targets.h https://github.com/python/cpython/pull/99182/files#diff-d3363a4083b77b9157d0bf07c2e87f3d3464a8b4360d5d23b07bbb23061f007a
specialize.c https://github.com/python/cpython/pull/99182/files#diff-22e653d878778ca28317261f7826545288d02fd9980cf485d0329f28a34993f2
ignored.tsv https://github.com/python/cpython/pull/99182/files#diff-fa2373a9a002e491408e623369773045f4b7de90114b9f5ba6933bfbf2d8c45c
generate_cases.py https://github.com/python/cpython/pull/99182/files#diff-65feee563fa44b472b07751184c6f557699f84b3c2ef79174bfd5d538d748272
Include/internal/pycore_code.hhttps://github.com/python/cpython/pull/99182/files#diff-97ea1759f82531a45fa685065ff86bc1077c3ab3d5f65220eea48b7730032bc8
View file https://github.com/brandtbucher/cpython/blob/1cd6d66d1f2754920b58f1f4cae2de906c19926e/Include/internal/pycore_code.h
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/python/cpython/pull/99182/{{ revealButtonHref }}
https://github.com/python/cpython/pull/99182/files#diff-97ea1759f82531a45fa685065ff86bc1077c3ab3d5f65220eea48b7730032bc8
https://github.com/python/cpython/pull/99182/files#diff-97ea1759f82531a45fa685065ff86bc1077c3ab3d5f65220eea48b7730032bc8
https://github.com/python/cpython/pull/99182/files#diff-97ea1759f82531a45fa685065ff86bc1077c3ab3d5f65220eea48b7730032bc8
https://github.com/python/cpython/pull/99182/files#diff-97ea1759f82531a45fa685065ff86bc1077c3ab3d5f65220eea48b7730032bc8
https://github.com/python/cpython/pull/99182/files#diff-97ea1759f82531a45fa685065ff86bc1077c3ab3d5f65220eea48b7730032bc8
https://github.com/python/cpython/pull/99182/files#diff-97ea1759f82531a45fa685065ff86bc1077c3ab3d5f65220eea48b7730032bc8
https://github.com/python/cpython/pull/99182/files#diff-97ea1759f82531a45fa685065ff86bc1077c3ab3d5f65220eea48b7730032bc8
Include/internal/pycore_opcode.hhttps://github.com/python/cpython/pull/99182/files#diff-7b986d4fccffcb2f2af4ec495559b2f0dc2e393e38f95e8ca3ef48e559177530
View file https://github.com/brandtbucher/cpython/blob/1cd6d66d1f2754920b58f1f4cae2de906c19926e/Include/internal/pycore_opcode.h
Open in desktop https://desktop.github.com
how customized files appear on GitHubhttps://docs.github.com/github/administering-a-repository/customizing-how-changed-files-appear-on-github
Please reload this pagehttps://github.com/python/cpython/pull/99182/files
Please reload this pagehttps://github.com/python/cpython/pull/99182/files
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.