Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

gh-115999: Add free-threaded specialization for COMPARE_OP#126410

Merged
Yhg1s merged 5 commits intopython:mainpython/cpython:mainfrom
Yhg1s:compare_opYhg1s/cpython:compare_opCopy head branch name to clipboard
Jan 7, 2025
Merged

gh-115999: Add free-threaded specialization for COMPARE_OP#126410
Yhg1s merged 5 commits intopython:mainpython/cpython:mainfrom
Yhg1s:compare_opYhg1s/cpython:compare_opCopy head branch name to clipboard

Conversation

@Yhg1s
Copy link
Member

@Yhg1s Yhg1s commented Nov 4, 2024

Add free-threaded specialization for COMPARE_OP, and tests for COMPARE_OP specialization in general. This relies on thread-local bytecode and atomic operations to update the counters and bytecode, which are single operations.

Copy link
Contributor

@mpage mpage left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Please add a short explanation of why the specialized instructions are thread-safe to either the pull request or the commit (when it's merged).

Copy link
Member

@markshannon markshannon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The approach looks sound, but the test will need moving and should not rely on specific sequences of instructions.

Lib/test/test_dis.py Outdated Show resolved Hide resolved
@bedevere-app
Copy link

bedevere-app bot commented Nov 6, 2024

When you're done making the requested changes, leave the comment: I have made the requested changes; please review again.

Python/specialize.c Show resolved Hide resolved
Python/specialize.c Outdated Show resolved Hide resolved
Copy link
Member Author

@Yhg1s Yhg1s left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PTAL.

Python/specialize.c Show resolved Hide resolved
Lib/test/test_dis.py Outdated Show resolved Hide resolved
@Yhg1s
Copy link
Member Author

Yhg1s commented Dec 11, 2024

PTAL.

Sorry, that's Google for:

I have made the requested changes; please review again.

@bedevere-app
Copy link

bedevere-app bot commented Dec 11, 2024

Thanks for making the requested changes!

@markshannon, @mpage: please review the changes made to this pull request.

@bedevere-app bedevere-app bot requested review from markshannon and mpage December 11, 2024 14:12
Copy link
Contributor

@mpage mpage left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. I queued benchmark runs for both the free-threaded and default builds for this PR. Let's wait until we have the results before merging this.

@mpage
Copy link
Contributor

mpage commented Dec 12, 2024

Performance doesn't look like a blocker:

@Yhg1s
Copy link
Member Author

Yhg1s commented Dec 17, 2024

@markshannon All your concerns should have been addressed, do you want to take another look?

Copy link
Member

@corona10 corona10 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@corona10
Copy link
Member

@mpage, @Yhg1s I think that it's okay to merge this PR at this moment :)

@Yhg1s
Copy link
Member Author

Yhg1s commented Dec 20, 2024

@mpage, @Yhg1s I think that it's okay to merge this PR at this moment :)

Well, not according to GitHub's UI :)

image

I want to give Mark the chance to review it again before I merge it, and a week and a half is not a long time when dealing with what is effectively a volunteer workforce :)

@Yhg1s Yhg1s merged commit 8f93dd8 into python:main Jan 7, 2025
55 checks passed
srinivasreddy pushed a commit to srinivasreddy/cpython that referenced this pull request Jan 8, 2025
…hon#126410)

Add free-threaded specialization for COMPARE_OP, and tests for COMPARE_OP specialization in general.

Co-authored-by: Donghee Na <donghee.na92@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

Morty Proxy This is a proxified and sanitized view of the page, visit original site.