Movatterモバイル変換


[0]ホーム

URL:


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

Sign up
Appearance settings

gh-131798: Usesym_new_type instead ofsym_new_not_null for_BUILD_LIST,_BUILD_SLICE, and_BUILD_MAP#132434

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

Zheaoli
Copy link
Contributor

@ZheaoliZheaoli commentedApr 12, 2025
edited by bedevere-appbot
Loading

@TeamSpen210
Copy link

_BUILD_MAPreturns adict not amap() object.

Copy link
Member

@Fidget-SpinnerFidget-Spinner left a comment

Choose a reason for hiding this comment

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

LGTM.

@Zheaoli
Copy link
ContributorAuthor

@Fidget-Spinner I think I still have some work for this PR

A few days ago, In#132289,@brandtbucher setup optimization path for_GUARD_NOS_DICT/_GUARD_NOS_LIST, But after usingsym_new_type instead ofsym_new_not_null, the_GUARD_NOS_DICT/_GUARD_NOS_LIST is not existed in the final generate result. So the test failed herehttps://github.com/python/cpython/actions/runs/14419426452/job/40440141201?pr=132434#step:4:1788

I'm not sure this is what we want to get(I guess it's, so maybe we just need to patch the test?)

@brandtbucherbrandtbucher changed the titlegh-131798: Usesym_new_type instead ofsym_new_not_null for _BUILD_LIST, _BUILD_SET, _BUILD_MAPgh-131798: Usesym_new_type instead ofsym_new_not_null for _BUILD_LIST, _BUILD_SLICE, _BUILD_MAPApr 12, 2025
@brandtbucherbrandtbucher changed the titlegh-131798: Usesym_new_type instead ofsym_new_not_null for _BUILD_LIST, _BUILD_SLICE, _BUILD_MAPgh-131798: Usesym_new_type instead ofsym_new_not_null for_BUILD_LIST,_BUILD_SLICE, and_BUILD_MAPApr 12, 2025
@brandtbucher
Copy link
Member

brandtbucher commentedApr 12, 2025
edited
Loading

@Zheaoli, that's actually agood thing! The additional information that you've added to the optimizer for_BUILD_MAP and_BUILD_LIST means that the JIT is able to remove those guard instructions. You should just update the tests to check for0 instead of1, since these guard instructions shouldn't be present at all anymore.

(I don't think writing a test for the_BUILD_SLICE change is going to be very helpful, given how this instruction is used right now. So don't worry about that one.)

Zheaoli reacted with thumbs up emoji

@Zheaoli
Copy link
ContributorAuthor

Zheaoli commentedApr 12, 2025
edited
Loading

that's actually agood thing! The additional information that you've added to the optimizer for_BUILD_MAP and_BUILD_LIST means that the JIT is able to remove those guard instructions. You should just update the tests to check for0 instead of1, since these guard instructions shouldn't be present at all anymore.

Yes, I guess the_GUARD_NOS_DICT is not needed here(just for the test) when we setup extra information for ops when I see the failed test. You confirmed my guess. Updating the PR

@ZheaoliZheaoli marked this pull request as ready for reviewApril 12, 2025 15:34
@ZheaoliZheaoliforce-pushed themanjusaka/build-tuple-set-map-list branch from5101fc8 to1e69348CompareApril 12, 2025 15:35
@@ -1706,7 +1706,7 @@ def f(n):
self.assertEqual(res, 2 * TIER2_THRESHOLD)
self.assertIsNotNone(ex)
uops = get_opnames(ex)
self.assertEqual(uops.count("_GUARD_NOS_LIST"),1)
self.assertEqual(uops.count("_GUARD_NOS_LIST"),0)

Choose a reason for hiding this comment

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

Can you please update the comment above and changeGuarded toUnguarded. The guard has now been removed.

Same fortest_remove_guard_for_known_type_dict

Zheaoli reacted with thumbs up emoji
… _BUILD_LIST, _BUILD_SET, _BUILD_MAPSigned-off-by: Manjusaka <me@manjusaka.me>
Signed-off-by: Manjusaka <me@manjusaka.me>
Signed-off-by: Manjusaka <me@manjusaka.me>
Signed-off-by: Manjusaka <me@manjusaka.me>
Signed-off-by: Manjusaka <me@manjusaka.me>
@ZheaoliZheaoliforce-pushed themanjusaka/build-tuple-set-map-list branch from8d55bc4 to839a749CompareApril 16, 2025 14:02
@Fidget-Spinner
Copy link
Member

@Zheaoli please don't force push, just normal push so we can see the commit diff. We will squash and merge at the end as one commit. Thanks!

Zheaoli reacted with thumbs up emoji

Copy link
Member

@Fidget-SpinnerFidget-Spinner left a comment

Choose a reason for hiding this comment

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

Thanks again! Great job.

@Fidget-SpinnerFidget-Spinner merged commitb9e88ff intopython:mainApr 16, 2025
62 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@Fidget-SpinnerFidget-SpinnerFidget-Spinner approved these changes

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

4 participants
@Zheaoli@TeamSpen210@brandtbucher@Fidget-Spinner

[8]ページ先頭

©2009-2025 Movatter.jp