GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — gh-131798: Optimize `_UNARY_NEGATIVE` by noamcohen97 · Pull Request #135223 · python/cpython

Conversation

@noamcohen97

@noamcohen97 noamcohen97 commented Jun 6, 2025 •
edited by bedevere-app Bot
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor
  • Issue: Better uop coverage in the JIT optimizer #131798

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
noamcohen97 added 3 commits June 6, 2025 19:16
@noamcohen97
optimize _UNARY_NEGATIVE
15da3e6
@noamcohen97
add news entry
e7dc06a
@noamcohen97
add test case
4135c71
@noamcohen97
noamcohen97 requested a review from Fidget-Spinner as a code owner June 6, 2025 16:29
@bedevere-app bedevere-app Bot added the awaiting review label Jun 6, 2025
@bedevere-app bedevere-app Bot mentioned this pull request Jun 6, 2025
Better uop coverage in the JIT optimizer #131798
Open
Zheaoli
Zheaoli reviewed Jun 6, 2025
View reviewed changes
Comment thread Python/optimizer_bytecodes.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

brandtbucher
brandtbucher approved these changes Jun 6, 2025
View reviewed changes

@brandtbucher brandtbucher left a comment

Copy link
Copy Markdown
Member

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.

Looks good, just some suggested improvements. Thanks!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
Comment thread Misc/NEWS.d/next/Core_and_Builtins/2025-06-06-19-17-22.gh-issue-131798.XoV8Eb.rst Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Python/optimizer_bytecodes.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

Comment thread Python/optimizer_bytecodes.c Resolved

Uh oh!

There was an error while loading. Please reload this page.

@bedevere-app bedevere-app Bot added awaiting merge and removed awaiting review labels Jun 6, 2025
noamcohen97 added 2 commits June 7, 2025 09:58
@noamcohen97
fix news entry
161bad9
@noamcohen97
better type lookups
68eed5e
@noamcohen97

noamcohen97 commented Jun 7, 2025

Copy link
Copy Markdown
Contributor Author

Thanks for the review! @brandtbucher @Zheaoli

Zheaoli reacted with heart emoji
All reactions
  • ❤️ 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

brandtbucher
brandtbucher approved these changes Jun 7, 2025
View reviewed changes

@brandtbucher brandtbucher left a comment

Copy link
Copy Markdown
Member

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.

Awesome! Can you just fix the merge conflict in the test file?

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@noamcohen97
Merge branch 'main' into optimize-unary-negate
20ca87b
@noamcohen97

noamcohen97 commented Jun 9, 2025

Copy link
Copy Markdown
Contributor Author

Done!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Fidget-Spinner
Fidget-Spinner approved these changes Jun 9, 2025
View reviewed changes
@Fidget-Spinner

Fidget-Spinner commented Jun 9, 2025

Copy link
Copy Markdown
Member

@noamcohen97 sorry it seems there's merge conflicts again from merging your other PR.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@noamcohen97
Merge branch 'main' into optimize-unary-negate
517d7ef
@noamcohen97

noamcohen97 commented Jun 9, 2025

Copy link
Copy Markdown
Contributor Author

@Fidget-Spinner I should have seen this coming 😄

tomasr8 reacted with laugh emoji
All reactions
  • 😄 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Fidget-Spinner

Fidget-Spinner commented Jun 23, 2025

Copy link
Copy Markdown
Member

@noamcohen97 sorry I forgot to merge this in time and seems there's conflicts again 🤦 . Could you please merge in main again? I'll make sure to remember to merge it soon this time.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@Fidget-Spinner Fidget-Spinner self-assigned this Jun 23, 2025
@noamcohen97
noamcohen97 requested a review from tomasr8 as a code owner June 23, 2025 18:46
@noamcohen97
noamcohen97 force-pushed the optimize-unary-negate branch from 72c83d8 to 517d7ef Compare June 23, 2025 18:47
@noamcohen97

noamcohen97 commented Jun 23, 2025

Copy link
Copy Markdown
Contributor Author

@Fidget-Spinner seems like _UNARY_NEGATIVE already got optimized in #135668 without considering float value and non-compact integer values.
I suggest we replace the current implementation with this one. WDYT?

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@noamcohen97
Merge branch 'main' into optimize-unary-negate
92e6c4b
@Fidget-Spinner

Fidget-Spinner commented Jun 23, 2025

Copy link
Copy Markdown
Member

@noamcohen97 sounds good. Just make sure to use compact ints. Thanks!

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@noamcohen97
support compact ints
1890739
@noamcohen97
noamcohen97 requested a review from Fidget-Spinner June 23, 2025 19:07
@noamcohen97
keep old styling
3fa5d86
Fidget-Spinner
Fidget-Spinner approved these changes Jun 23, 2025
View reviewed changes

@Fidget-Spinner Fidget-Spinner left a comment

Copy link
Copy Markdown
Member

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.

Thanks!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

noamcohen97 reacted with heart emoji
All reactions
  • ❤️ 1 reaction
tomasr8
tomasr8 approved these changes Jun 23, 2025
View reviewed changes
@Fidget-Spinner
Fidget-Spinner merged commit bda1218 into python:main Jun 23, 2025
@bedevere-app bedevere-app Bot removed the awaiting merge label Jun 23, 2025
@noamcohen97
noamcohen97 deleted the optimize-unary-negate branch June 23, 2025 19:42
AndPuQing pushed a commit to AndPuQing/cpython that referenced this pull request Jul 11, 2025
@noamcohen97 @AndPuQing
pythongh-131798: Optimize _UNARY_NEGATIVE (pythonGH-135223)
aed1ed0
Pranjal095 pushed a commit to Pranjal095/cpython that referenced this pull request Jul 12, 2025
@noamcohen97 @Pranjal095
pythongh-131798: Optimize _UNARY_NEGATIVE (pythonGH-135223)
3a28c51
taegyunkim pushed a commit to taegyunkim/cpython that referenced this pull request Aug 4, 2025
@noamcohen97 @taegyunkim
pythongh-131798: Optimize _UNARY_NEGATIVE (pythonGH-135223)
f5a2a15
Agent-Hellboy pushed a commit to Agent-Hellboy/cpython that referenced this pull request Aug 19, 2025
@noamcohen97 @Agent-Hellboy
pythongh-131798: Optimize _UNARY_NEGATIVE (pythonGH-135223)
9fc1522
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@tomasr8 tomasr8 tomasr8 approved these changes
@Fidget-Spinner Fidget-Spinner Fidget-Spinner approved these changes
@brandtbucher brandtbucher brandtbucher approved these changes
+1 more reviewer
@Zheaoli Zheaoli Zheaoli left review comments
Reviewers whose approvals may not affect merge requirements

Uh oh!

There was an error while loading. Please reload this page.

Assignees

@Fidget-Spinner Fidget-Spinner

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Uh oh!

There was an error while loading. Please reload this page.

5 participants

@noamcohen97 @Fidget-Spinner @Zheaoli @tomasr8 @brandtbucher
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.
You are visitor 01402503 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.