René's URL Explorer Experiment


Title: Tighten specialization guards and add send_none fastpath by youknowone · Pull Request #7359 · RustPython/RustPython · GitHub

Open Graph Title: Tighten specialization guards and add send_none fastpath by youknowone · Pull Request #7359 · RustPython/RustPython

X Title: Tighten specialization guards and add send_none fastpath by youknowone · Pull Request #7359 · RustPython/RustPython

Description: Summary Add send_none fastpath in Coro to skip the is_none check and type-error branch for the common case (generator iteration via for loops) Tighten CALL_METHOD_DESCRIPTOR_* guards to verify self type matches descr.objclass, matching CPython's CALL_METHOD_DESCRIPTOR type checks Allow list.append on subclasses in CALL_LIST_APPEND (use downcast_ref instead of downcast_ref_if_exact) Add specialization_eval_frame_active guard to prevent specializing CALL/CALL_KW/SEND/FOR_ITER_GEN when custom eval frames are active Fix FOR_ITER_GEN to deoptimize on guard miss and check running() state before send_none Fix SEND_GEN to deoptimize on guard miss and add send_none fastpath for None values Fix specialize_send to require exact generator/coroutine types Fix specialize_for_iter to validate END_FOR shape and jump delta bounds for generator specialization Route CALL_METHOD_DESCRIPTOR_FAST through CALL_METHOD_DESCRIPTOR_FAST_WITH_KEYWORDS for correct nargs > 1 dispatch Add CallBuiltinFastWithKeywords fallback for builtin calls with effective_nargs > 1 Skip CALL/CALL_KW specialization for PyFunction when eval frame hook is active Test plan CI passes on all platforms (Ubuntu, macOS, Windows) test_bdb generator stepping works correctly with ForIterGen deoptimize path test_generators passes with send_none fastpath 🤖 Generated with Claude Code Summary by CodeRabbit Refactor Centralized coroutine send/result handling for more consistent iteration/stop error mapping and cleaner generator closure behavior. Made execution-frame specialization VM-aware to improve optimization decisions and safer fallback behavior during hot paths. Behavior Improved native method call flag inference and method flag availability, yielding more accurate method dispatch semantics (affecting native extensions and method calling behavior).

Open Graph Description: Summary Add send_none fastpath in Coro to skip the is_none check and type-error branch for the common case (generator iteration via for loops) Tighten CALL_METHOD_DESCRIPTOR_* guards to verify sel...

X Description: Summary Add send_none fastpath in Coro to skip the is_none check and type-error branch for the common case (generator iteration via for loops) Tighten CALL_METHOD_DESCRIPTOR_* guards to verify sel...

Opengraph URL: https://github.com/RustPython/RustPython/pull/7359

X: @github

direct link

Domain: github.com

route-pattern/:user_id/:repository/pull/:id/files(.:format)
route-controllerpull_requests
route-actionfiles
fetch-noncev2:c24a2159-b0da-a7d3-6aed-fd5b053a0c28
current-catalog-service-hashae870bc5e265a340912cde392f23dad3671a0a881730ffdadd82f2f57d81641b
request-idABC4:1C1025:22161C0:2DA0882:6A5BD5A7
html-safe-nonce00a5db87c3fbe4b07e5ae2ffa77a7fd4e535015f4f8f6745019ee159ff36f0c1
visitor-payloadeyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJBQkM0OjFDMTAyNToyMjE2MUMwOjJEQTA4ODI6NkE1QkQ1QTciLCJ2aXNpdG9yX2lkIjoiOTE0MTczMTAxNTM1NDIwOTcwMyIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9
visitor-hmacaeca3263518cd0d0296a16420a4471e5c5cb8a7a6fcb21ad14233fea4d869409
hovercard-subject-tagpull_request:3358338168
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/RustPython/RustPython/pull/7359/files
twitter:imagehttps://avatars.githubusercontent.com/u/69878?s=400&v=4
twitter:cardsummary_large_image
og:imagehttps://avatars.githubusercontent.com/u/69878?s=400&v=4
og:image:altSummary Add send_none fastpath in Coro to skip the is_none check and type-error branch for the common case (generator iteration via for loops) Tighten CALL_METHOD_DESCRIPTOR_* guards to verify sel...
og:site_nameGitHub
og:typeobject
hostnamegithub.com
expected-hostnamegithub.com
None5290d7e14309ad1e76106a9c4237bd1041517e83ea182c8ab756752cb0c6940b
turbo-cache-controlno-preview
diff-viewunified
go-importgithub.com/RustPython/RustPython git https://github.com/RustPython/RustPython.git
octolytics-dimension-user_id39710557
octolytics-dimension-user_loginRustPython
octolytics-dimension-repository_id135201145
octolytics-dimension-repository_nwoRustPython/RustPython
octolytics-dimension-repository_publictrue
octolytics-dimension-repository_is_forkfalse
octolytics-dimension-repository_network_root_id135201145
octolytics-dimension-repository_network_root_nwoRustPython/RustPython
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
release9c975978430e9ad293956f2bbdaf153b1bd84a99
ui-targetfull
theme-color#1e2327
color-schemelight dark

Links:

Skip to contenthttps://github.com/RustPython/RustPython/pull/7359/files#start-of-content
https://github.com/
Sign in https://github.com/login?return_to=https%3A%2F%2Fgithub.com%2FRustPython%2FRustPython%2Fpull%2F7359%2Ffiles
GitHub CopilotWrite better code with AIhttps://github.com/features/copilot
GitHub Copilot appDirect agents from issue to mergehttps://github.com/features/ai/github-app
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
View all resourceshttps://github.com/resources
GitHub SponsorsFund open source developershttps://github.com/open-source/sponsors
Security Labhttps://securitylab.github.com
Maintainer Communityhttps://maintainers.github.com
Acceleratorhttps://github.com/open-source/accelerator
GitHub Starshttps://stars.github.com
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/enterprise/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%2FRustPython%2FRustPython%2Fpull%2F7359%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=RustPython%2FRustPython
Reloadhttps://github.com/RustPython/RustPython/pull/7359/files
Reloadhttps://github.com/RustPython/RustPython/pull/7359/files
Reloadhttps://github.com/RustPython/RustPython/pull/7359/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/7359/files
RustPython https://github.com/RustPython
RustPythonhttps://github.com/RustPython/RustPython
Notifications https://github.com/login?return_to=%2FRustPython%2FRustPython
Fork 1.5k https://github.com/login?return_to=%2FRustPython%2FRustPython
Star 22.2k https://github.com/login?return_to=%2FRustPython%2FRustPython
Code https://github.com/RustPython/RustPython
Issues 291 https://github.com/RustPython/RustPython/issues
Pull requests 106 https://github.com/RustPython/RustPython/pulls
Discussions https://github.com/RustPython/RustPython/discussions
Actions https://github.com/RustPython/RustPython/actions
Projects https://github.com/RustPython/RustPython/projects
Models https://github.com/RustPython/RustPython/models
Wiki https://github.com/RustPython/RustPython/wiki
Security and quality 0 https://github.com/RustPython/RustPython/security
Insights https://github.com/RustPython/RustPython/pulse
Code https://github.com/RustPython/RustPython
Issues https://github.com/RustPython/RustPython/issues
Pull requests https://github.com/RustPython/RustPython/pulls
Discussions https://github.com/RustPython/RustPython/discussions
Actions https://github.com/RustPython/RustPython/actions
Projects https://github.com/RustPython/RustPython/projects
Models https://github.com/RustPython/RustPython/models
Wiki https://github.com/RustPython/RustPython/wiki
Security and quality https://github.com/RustPython/RustPython/security
Insights https://github.com/RustPython/RustPython/pulse
Sign up for GitHub https://github.com/signup?return_to=%2FRustPython%2FRustPython%2Fissues%2Fnew%2Fchoose
terms of servicehttps://docs.github.com/terms
privacy statementhttps://docs.github.com/privacy
Sign inhttps://github.com/login?return_to=%2FRustPython%2FRustPython%2Fissues%2Fnew%2Fchoose
youknowonehttps://github.com/youknowone
RustPython:mainhttps://github.com/RustPython/RustPython/tree/main
youknowone:specializationhttps://github.com/youknowone/RustPython/tree/specialization
Conversation 5 https://github.com/RustPython/RustPython/pull/7359
Commits 17 https://github.com/RustPython/RustPython/pull/7359/commits
Checks 12 https://github.com/RustPython/RustPython/pull/7359/checks
Files changed https://github.com/RustPython/RustPython/pull/7359/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/7359/files
Tighten specialization guards and add send_none fastpath https://github.com/RustPython/RustPython/pull/7359/files#top
Show all changes 17 commits https://github.com/RustPython/RustPython/pull/7359/files
e4abe4a vm: align specialization guards with CPython patterns youknowone Mar 5, 2026 https://github.com/RustPython/RustPython/pull/7359/commits/e4abe4aa44f4441bcf8d3a604369922a9d61efc4
1d69c5b vm: tighten call specialization runtime guards youknowone Mar 5, 2026 https://github.com/RustPython/RustPython/pull/7359/commits/1d69c5b1b2a99e78f102bd9592397f7562849d6f
f0a235e vm: add send_none fastpath for generator specialization youknowone Mar 5, 2026 https://github.com/RustPython/RustPython/pull/7359/commits/f0a235ee59794389497877d3fb93ea3757e692ac
e518287 vm: restrict method-descriptor specialization to methods youknowone Mar 5, 2026 https://github.com/RustPython/RustPython/pull/7359/commits/e518287ea340ee3725fb2609b113b04b04b0d3ea
01cdfb5 vm: deopt call specializations on guard misses youknowone Mar 5, 2026 https://github.com/RustPython/RustPython/pull/7359/commits/01cdfb5253f2d386973fd692a4a461b998c29598
690921a vm: match CPython send/for-iter closed-frame guards youknowone Mar 5, 2026 https://github.com/RustPython/RustPython/pull/7359/commits/690921a2196d7c12ed70e41470d4b44700ffac6d
ed4b7fa vm: restrict len/isinstance specialization to builtins youknowone Mar 5, 2026 https://github.com/RustPython/RustPython/pull/7359/commits/ed4b7fae11f5361ea28fab64b9083799f53ee380
78dbbb0 vm: use exact-type guards for call specializations youknowone Mar 5, 2026 https://github.com/RustPython/RustPython/pull/7359/commits/78dbbb0152f39139d75e4a74392ac943b15aee45
01a4c27 vm: align class-call specialization flow with CPython youknowone Mar 5, 2026 https://github.com/RustPython/RustPython/pull/7359/commits/01a4c27014ab5b94200388fbb53b96d9bcec4003
397143b vm: prefer FAST call opcodes for positional builtin calls youknowone Mar 5, 2026 https://github.com/RustPython/RustPython/pull/7359/commits/397143b08f3ac6e40df1754bdf2bc01c24cdd26c
41e58d3 vm: add callable identity guard to CALL_LIST_APPEND youknowone Mar 5, 2026 https://github.com/RustPython/RustPython/pull/7359/commits/41e58d372ea71932ef1debb104f400d01b4ec6ea
c694fe1 vm: make CALL_LIST_APPEND runtime guard pointer-based youknowone Mar 5, 2026 https://github.com/RustPython/RustPython/pull/7359/commits/c694fe11f292fe04e7c28bc71233e5b94b710621
ab82f5b vm: align call guard cache and fallback behavior with CPython youknowone Mar 5, 2026 https://github.com/RustPython/RustPython/pull/7359/commits/ab82f5bffd143b8dfa6224c8c7a415899a1b0220
f630d01 vm: use base vectorcall fallback for EXIT-style call misses youknowone Mar 5, 2026 https://github.com/RustPython/RustPython/pull/7359/commits/f630d01d96c72843ee14dc391ef5b5ee92f41dc7
eeff412 vm: simplify CALL_LEN/CALL_ISINSTANCE runtime guards youknowone Mar 5, 2026 https://github.com/RustPython/RustPython/pull/7359/commits/eeff41296580f202e33bc202f0a179b1209805da
2a23d3b vm: infer call-convention flags for CPython-style CALL specialization youknowone Mar 5, 2026 https://github.com/RustPython/RustPython/pull/7359/commits/2a23d3badf6c27dfb7eb31add757e699711f7e65
c7d095a vm: check use_tracing in eval_frame_active, add SendGen send_none youknowone Mar 5, 2026 https://github.com/RustPython/RustPython/pull/7359/commits/c7d095a3ac8fdcbfcf6a40d694ab52392f31416c
Clear filters https://github.com/RustPython/RustPython/pull/7359/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/7359/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/7359/files
pyclass.rs https://github.com/RustPython/RustPython/pull/7359/files#diff-26c99b2025ccb53d8e726042a48a5886526d898281c27735bd1b6ebd51e55feb
pymodule.rs https://github.com/RustPython/RustPython/pull/7359/files#diff-bd1b19a26ea802742bdb1006a08982fb26404140e1dd0b5162271a6646258d39
util.rs https://github.com/RustPython/RustPython/pull/7359/files#diff-bc2426df61f173d5880449913c159a85524e8969df4743433c59436e77c3321d
coroutine.rs https://github.com/RustPython/RustPython/pull/7359/files#diff-d340edfa654334043dbe24788ce03de191ca484a34ae73e24ffb582575310bc0
frame.rs https://github.com/RustPython/RustPython/pull/7359/files#diff-03f2741d7d424014f3d2f0c82226be52fa58134aab34bf0780714ee67a248deb
method.rs https://github.com/RustPython/RustPython/pull/7359/files#diff-31faea07586d31264db50391d88bd13f1e0b25cd5ff8acde46dc44f1d70e42fa
crates/derive-impl/src/pyclass.rshttps://github.com/RustPython/RustPython/pull/7359/files#diff-26c99b2025ccb53d8e726042a48a5886526d898281c27735bd1b6ebd51e55feb
View file https://github.com/youknowone/RustPython/blob/c7d095a3ac8fdcbfcf6a40d694ab52392f31416c/crates/derive-impl/src/pyclass.rs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/RustPython/RustPython/pull/7359/{{ revealButtonHref }}
https://github.com/RustPython/RustPython/pull/7359/files#diff-26c99b2025ccb53d8e726042a48a5886526d898281c27735bd1b6ebd51e55feb
https://github.com/RustPython/RustPython/pull/7359/files#diff-26c99b2025ccb53d8e726042a48a5886526d898281c27735bd1b6ebd51e55feb
coderabbitaihttps://github.com/apps/coderabbitai
Mar 5, 2026https://github.com/RustPython/RustPython/pull/7359/files#r2890292280
Learn morehttps://docs.github.com/articles/managing-disruptive-comments/#hiding-a-comment
Please reload this pagehttps://github.com/RustPython/RustPython/pull/7359/files
https://github.com/RustPython/RustPython/pull/7359/files#diff-26c99b2025ccb53d8e726042a48a5886526d898281c27735bd1b6ebd51e55feb
https://github.com/RustPython/RustPython/pull/7359/files#diff-26c99b2025ccb53d8e726042a48a5886526d898281c27735bd1b6ebd51e55feb
https://github.com/RustPython/RustPython/pull/7359/files#diff-26c99b2025ccb53d8e726042a48a5886526d898281c27735bd1b6ebd51e55feb
https://github.com/RustPython/RustPython/pull/7359/files#diff-26c99b2025ccb53d8e726042a48a5886526d898281c27735bd1b6ebd51e55feb
https://github.com/RustPython/RustPython/pull/7359/files#diff-26c99b2025ccb53d8e726042a48a5886526d898281c27735bd1b6ebd51e55feb
https://github.com/RustPython/RustPython/pull/7359/files#diff-26c99b2025ccb53d8e726042a48a5886526d898281c27735bd1b6ebd51e55feb
https://github.com/RustPython/RustPython/pull/7359/files#diff-26c99b2025ccb53d8e726042a48a5886526d898281c27735bd1b6ebd51e55feb
crates/derive-impl/src/pymodule.rshttps://github.com/RustPython/RustPython/pull/7359/files#diff-bd1b19a26ea802742bdb1006a08982fb26404140e1dd0b5162271a6646258d39
View file https://github.com/youknowone/RustPython/blob/c7d095a3ac8fdcbfcf6a40d694ab52392f31416c/crates/derive-impl/src/pymodule.rs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/RustPython/RustPython/pull/7359/{{ revealButtonHref }}
https://github.com/RustPython/RustPython/pull/7359/files#diff-bd1b19a26ea802742bdb1006a08982fb26404140e1dd0b5162271a6646258d39
https://github.com/RustPython/RustPython/pull/7359/files#diff-bd1b19a26ea802742bdb1006a08982fb26404140e1dd0b5162271a6646258d39
https://github.com/RustPython/RustPython/pull/7359/files#diff-bd1b19a26ea802742bdb1006a08982fb26404140e1dd0b5162271a6646258d39
https://github.com/RustPython/RustPython/pull/7359/files#diff-bd1b19a26ea802742bdb1006a08982fb26404140e1dd0b5162271a6646258d39
https://github.com/RustPython/RustPython/pull/7359/files#diff-bd1b19a26ea802742bdb1006a08982fb26404140e1dd0b5162271a6646258d39
https://github.com/RustPython/RustPython/pull/7359/files#diff-bd1b19a26ea802742bdb1006a08982fb26404140e1dd0b5162271a6646258d39
https://github.com/RustPython/RustPython/pull/7359/files#diff-bd1b19a26ea802742bdb1006a08982fb26404140e1dd0b5162271a6646258d39
crates/derive-impl/src/util.rshttps://github.com/RustPython/RustPython/pull/7359/files#diff-bc2426df61f173d5880449913c159a85524e8969df4743433c59436e77c3321d
View file https://github.com/youknowone/RustPython/blob/c7d095a3ac8fdcbfcf6a40d694ab52392f31416c/crates/derive-impl/src/util.rs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/RustPython/RustPython/pull/7359/{{ revealButtonHref }}
https://github.com/RustPython/RustPython/pull/7359/files#diff-bc2426df61f173d5880449913c159a85524e8969df4743433c59436e77c3321d
https://github.com/RustPython/RustPython/pull/7359/files#diff-bc2426df61f173d5880449913c159a85524e8969df4743433c59436e77c3321d
crates/vm/src/coroutine.rshttps://github.com/RustPython/RustPython/pull/7359/files#diff-d340edfa654334043dbe24788ce03de191ca484a34ae73e24ffb582575310bc0
View file https://github.com/youknowone/RustPython/blob/c7d095a3ac8fdcbfcf6a40d694ab52392f31416c/crates/vm/src/coroutine.rs
Open in desktop https://desktop.github.com
https://github.co/hiddenchars
https://github.com/RustPython/RustPython/pull/7359/{{ revealButtonHref }}
https://github.com/RustPython/RustPython/pull/7359/files#diff-d340edfa654334043dbe24788ce03de191ca484a34ae73e24ffb582575310bc0
https://github.com/RustPython/RustPython/pull/7359/files#diff-d340edfa654334043dbe24788ce03de191ca484a34ae73e24ffb582575310bc0
https://github.com/RustPython/RustPython/pull/7359/files#diff-d340edfa654334043dbe24788ce03de191ca484a34ae73e24ffb582575310bc0
Please reload this pagehttps://github.com/RustPython/RustPython/pull/7359/files
Please reload this pagehttps://github.com/RustPython/RustPython/pull/7359/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.