Uh oh!
There was an error while loading. Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork 34k
gh-139716: StackRef tests are added#139717
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base:main
Are you sure you want to change the base?
Uh oh!
There was an error while loading. Please reload this page.
Conversation
efimov-mikhail commented Oct 7, 2025 • edited by bedevere-app bot
Loading Uh oh!
There was an error while loading. Please reload this page.
edited by bedevere-app bot
Uh oh!
There was an error while loading. Please reload this page.
efimov-mikhail commented Oct 7, 2025
Uh oh!
There was an error while loading. Please reload this page.
markshannon left a comment
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. I've one concern about code organization, but that's all.
Uh oh!
There was an error while loading. Please reload this page.
A Python core developer has requested some changes be made to your pull request before we can consider merging it. If you could please address their requests along with any other requests in other reviews from core developers that would be appreciated. Once you have made the requested changes, please leave a comment on this pull request containing the phrase |
efimov-mikhail commented Oct 27, 2025
I have made the requested changes; please review again. |
Thanks for making the requested changes! @markshannon: please review the changes made to this pull request. |
efimov-mikhail commented Nov 13, 2025
Failure was because of #131229 |
efimov-mikhail commented Nov 15, 2025
Friendly ping, @markshannon@Fidget-Spinner . |
Fidget-Spinner left a comment
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.
Just two questions
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Include/internal/pycore_stackref.h Outdated
| _PyStackRef_AsTuple(_PyStackRef ref, PyObject *op) | ||
| { | ||
| // Do not check StackRef flags in the free threading build. | ||
| return Py_BuildValue("(ni)", Py_REFCNT(op), -1); |
efimov-mikhailNov 17, 2025 • edited
Loading Uh oh!
There was an error while loading. Please reload this page.
edited
Uh oh!
There was an error while loading. Please reload this page.
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.
Actually, I've realized that we could remove this special case.
It's related only to stackrefs for immortal objects at ft build.
We can make a little change for _PyStackRef_FromPyObjectSteal and for PyStackRef_FromPyObjectNew function: add Py_TAG_DEFERRED flag to references on immortal objects.
All tests passed with this change on my machine.
But I suggest doing this in the next small PR, and keep only tests changes here.
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've created a #141675 for this change.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
sergey-miryanov left a comment
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!
efimov-mikhail commented Dec 20, 2025
CC @markshannon@Fidget-Spinner@colesbury Another option is merge #143024 first and adapt tests for that change here. |
New test file
Lib/test/test_stackrefs.pyintroduced.Some auxillary functions are added to
_testinternalcapi.Those functions are examples of correct
StackRefscenarios.We check that all
refcountsremain correct.And that results are the same for equivalent scenarios.
PyStackReffunctions #139716