-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Tighten specialization guards and add send_none fastpath #7359
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
e4abe4a
vm: align specialization guards with CPython patterns
youknowone 1d69c5b
vm: tighten call specialization runtime guards
youknowone f0a235e
vm: add send_none fastpath for generator specialization
youknowone e518287
vm: restrict method-descriptor specialization to methods
youknowone 01cdfb5
vm: deopt call specializations on guard misses
youknowone 690921a
vm: match CPython send/for-iter closed-frame guards
youknowone ed4b7fa
vm: restrict len/isinstance specialization to builtins
youknowone 78dbbb0
vm: use exact-type guards for call specializations
youknowone 01a4c27
vm: align class-call specialization flow with CPython
youknowone 397143b
vm: prefer FAST call opcodes for positional builtin calls
youknowone 41e58d3
vm: add callable identity guard to CALL_LIST_APPEND
youknowone c694fe1
vm: make CALL_LIST_APPEND runtime guard pointer-based
youknowone ab82f5b
vm: align call guard cache and fallback behavior with CPython
youknowone f630d01
vm: use base vectorcall fallback for EXIT-style call misses
youknowone eeff412
vm: simplify CALL_LEN/CALL_ISINSTANCE runtime guards
youknowone 2a23d3b
vm: infer call-convention flags for CPython-style CALL specialization
youknowone c7d095a
vm: check use_tracing in eval_frame_active, add SendGen send_none
youknowone File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
馃З Analysis chain
馃弫 Script executed:
Repository: RustPython/RustPython
Length of output: 1499
馃弫 Script executed:
Repository: RustPython/RustPython
Length of output: 47
馃弫 Script executed:
Repository: RustPython/RustPython
Length of output: 1544
馃弫 Script executed:
Repository: RustPython/RustPython
Length of output: 122
馃弫 Script executed:
Repository: RustPython/RustPython
Length of output: 91
馃弫 Script executed:
Repository: RustPython/RustPython
Length of output: 91
馃弫 Script executed:
Repository: RustPython/RustPython
Length of output: 1305
馃弫 Script executed:
Repository: RustPython/RustPython
Length of output: 118
馃弫 Script executed:
Repository: RustPython/RustPython
Length of output: 97
馃弫 Script executed:
Repository: RustPython/RustPython
Length of output: 500
馃弫 Script executed:
Repository: RustPython/RustPython
Length of output: 465
馃弫 Script executed:
Repository: RustPython/RustPython
Length of output: 893
馃弫 Script executed:
Repository: RustPython/RustPython
Length of output: 392
馃弫 Script executed:
Repository: RustPython/RustPython
Length of output: 2095
馃弫 Script executed:
Repository: RustPython/RustPython
Length of output: 445
馃弫 Script executed:
Repository: RustPython/RustPython
Length of output: 202
馃弫 Script executed:
Repository: RustPython/RustPython
Length of output: 774
馃弫 Script executed:
Repository: RustPython/RustPython
Length of output: 1054
馃弫 Script executed:
Repository: RustPython/RustPython
Length of output: 888
馃弫 Script executed:
Repository: RustPython/RustPython
Length of output: 417
馃弫 Script executed:
Repository: RustPython/RustPython
Length of output: 830
馃弫 Script executed:
Repository: RustPython/RustPython
Length of output: 433
馃弫 Script executed:
Repository: RustPython/RustPython
Length of output: 831
馃弫 Script executed:
Repository: RustPython/RustPython
Length of output: 2496
馃弫 Script executed:
Repository: RustPython/RustPython
Length of output: 3069
馃弫 Script executed:
Repository: RustPython/RustPython
Length of output: 47
馃弫 Script executed:
Repository: RustPython/RustPython
Length of output: 153
馃弫 Script executed:
Repository: RustPython/RustPython
Length of output: 2226
馃弫 Script executed:
Repository: RustPython/RustPython
Length of output: 47
馃弫 Script executed:
Repository: RustPython/RustPython
Length of output: 47
馃弫 Script executed:
Repository: RustPython/RustPython
Length of output: 165
馃弫 Script executed:
Repository: RustPython/RustPython
Length of output: 1379
馃弫 Script executed:
Repository: RustPython/RustPython
Length of output: 2397
馃弫 Script executed:
Repository: RustPython/RustPython
Length of output: 2960
馃弫 Script executed:
Repository: RustPython/RustPython
Length of output: 2764
馃弫 Script executed:
Repository: RustPython/RustPython
Length of output: 2442
馃弫 Script executed:
Repository: RustPython/RustPython
Length of output: 97
馃弫 Script executed:
Repository: RustPython/RustPython
Length of output: 543
馃弫 Script executed:
Repository: RustPython/RustPython
Length of output: 808
馃弫 Script executed:
Repository: RustPython/RustPython
Length of output: 908
馃弫 Script executed:
Repository: RustPython/RustPython
Length of output: 4761
馃弫 Script executed:
Repository: RustPython/RustPython
Length of output: 212
馃弫 Script executed:
Repository: RustPython/RustPython
Length of output: 233
馃弫 Script executed:
Repository: RustPython/RustPython
Length of output: 392
馃弫 Script executed:
Repository: RustPython/RustPython
Length of output: 168
馃弫 Script executed:
Repository: RustPython/RustPython
Length of output: 849
Raw methods without receiver should not drop the first typed argument.
The
rawflag is extracted at line 1016 but not used in thedrop_first_typedlogic (lines 1023-1025). When#[pymethod(raw)]or#[pyclassmethod(raw)]is applied to a method without an explicit Rust receiver, the current code incorrectly setsdrop_first_typed = 1, which causes the first typed argument to be skipped during call-flags inference.Raw methods have different parameter semantics than normal methods: they receive
FuncArgsdirectly as their first argument without an implicit self/class parameter. For example, the existing raw method__getstate__(vm: &VirtualMachine, args: FuncArgs)has no receiver and no implicit self. With the current logic,FuncArgsgets incorrectly dropped, resulting inNOARGSflags instead of the correctFASTCALL | KEYWORDSflags.The fix should condition
drop_first_typedon!raw:馃 Prompt for AI Agents