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-104635: Add a test case for variables that have a dependency. by corona10 · Pull Request #106583 · python/cpython

Conversation

@corona10

@corona10 corona10 commented Jul 10, 2023 •
edited by bedevere-bot
Loading

Uh oh!

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

Copy link
Copy Markdown
Member
  • Issue: dead store elimination in the compiler #104635

Sorry, something went wrong.

Uh oh!

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

All reactions
@corona10
pythongh-104635: Add a test case for variables that have a dependency.
e92bc67
@bedevere-bot bedevere-bot added the awaiting core review label Jul 10, 2023
@corona10
corona10 requested a review from carljm July 10, 2023 05:09
@bedevere-bot bedevere-bot added the tests Tests in the Lib/test dir label Jul 10, 2023
@bedevere-bot bedevere-bot mentioned this pull request Jul 10, 2023
dead store elimination in the compiler #104635
Open
@corona10
corona10 requested review from Fidget-Spinner and vstinner July 10, 2023 05:09
@corona10 corona10 added skip news and removed tests Tests in the Lib/test dir awaiting core review labels Jul 10, 2023
@corona10

corona10 commented Jul 10, 2023

Copy link
Copy Markdown
Member Author

I found this case while I worked for #106571 (comment), It will be helpful to the future researcher.

All reactions

Sorry, something went wrong.

Uh oh!

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

vstinner
vstinner reviewed Jul 10, 2023
View reviewed changes
Comment thread Lib/test/test_compile.py
return a
self.assertEqual(f("x", "y", "z"), "y")

def test_variable_dependent(self):

@vstinner vstinner Jul 10, 2023

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.

Can you please explain the purpose of the test in a comment? From the code, it's nonibvious to me how it can be miscompiled.

Sorry, something went wrong.

Uh oh!

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

All reactions

@corona10 corona10 Jul 10, 2023

Copy link
Copy Markdown
Member Author

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.

Can you please explain the purpose of the test in a comment? From the code, it's nonibvious to me how it can be miscompiled.

No, it doesn't miscompile at this optimization moment.
But I was quite surprised with the CI never failed with the wrong compile for the #106571 (comment).
So it could be good to be added. I thought that miscompile case should be caught at the CI level.

Sorry, something went wrong.

Uh oh!

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

All reactions

@vstinner vstinner Jul 10, 2023

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.

I don't say that the code is miscompiled. I propose adding a comment to explain that the test checks that this specific code is not miscompiled, but please explain why it could be miscompiled.

Sorry, something went wrong.

Uh oh!

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

corona10 reacted with thumbs up emoji
All reactions
  • 👍 1 reaction

@corona10 corona10 Jul 10, 2023

Copy link
Copy Markdown
Member Author

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.

Done!

Sorry, something went wrong.

Uh oh!

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

All reactions
@corona10
corona10 requested a review from vstinner July 10, 2023 11:30
@corona10
Add comment
b228473
carljm
carljm approved these changes Jul 10, 2023
View reviewed changes
@bedevere-bot bedevere-bot added the awaiting merge label Jul 10, 2023
vstinner
vstinner approved these changes Jul 10, 2023
View reviewed changes

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

LGTM. I just suggest a minor phrasing change.

Sorry, something went wrong.

Uh oh!

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

All reactions
Comment thread Lib/test/test_compile.py Resolved

Uh oh!

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

@corona10 @carljm
Update Lib/test/test_compile.py
c0f0393
Co-authored-by: Carl Meyer <[email protected]>
vstinner
vstinner approved these changes Jul 10, 2023
View reviewed changes

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

LGTM

Sorry, something went wrong.

Uh oh!

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

All reactions
@corona10
corona10 merged commit 115df84 into python:main Jul 11, 2023
@bedevere-bot bedevere-bot removed the awaiting merge label Jul 11, 2023
@corona10
corona10 deleted the gh-104635-test-case branch July 11, 2023 01:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@carljm carljm carljm approved these changes
@vstinner vstinner vstinner approved these changes
@Fidget-Spinner Fidget-Spinner Awaiting requested review from Fidget-Spinner

Uh oh!

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

Assignees

No one assigned

Labels

skip news

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.

4 participants

@corona10 @carljm @vstinner @bedevere-bot
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 01402520 — 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.