Skip to content

Conversation

@Yhg1s
Copy link
Member

@Yhg1sYhg1s 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

@mpagempage 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

@markshannonmarkshannon 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.

@bedevere-app
Copy link

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

Copy link
MemberAuthor

@Yhg1sYhg1s left a comment

Choose a reason for hiding this comment

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

PTAL.

@Yhg1s
Copy link
MemberAuthor

PTAL.

Sorry, that's Google for:

I have made the requested changes; please review again.

@bedevere-app
Copy link

Thanks for making the requested changes!

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

Copy link
Contributor

@mpagempage 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

Performance doesn't look like a blocker:

@Yhg1s
Copy link
MemberAuthor

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

Copy link
Member

@corona10corona10 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
MemberAuthor

@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 :)

@Yhg1sYhg1s merged commit 8f93dd8 into python:mainJan 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 <[email protected]>
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

skip newstopic-free-threadingtype-featureA feature request or enhancement

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants

@Yhg1s@mpage@corona10@markshannon@Eclips4