Uh oh!
There was an error while loading. Please reload this page.
gh-139716: StackRef tests are added - #139717
Conversation
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.
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 15, 2025
Friendly ping, @markshannon@Fidget-Spinner . |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| _PyStackRef_AsTuple(_PyStackRef ref, PyObject *op) | ||
| { | ||
| // Do not check StackRef flags in the free threading build. | ||
| return Py_BuildValue("(ni)", Py_REFCNT(op), -1); |
There was a problem hiding this comment.
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.
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.
efimov-mikhail
commented
Dec 20, 2025
CC @markshannon@Fidget-Spinner@colesbury Another option is merge #143024 first and adapt tests for that change here. |
This PR is stale because it has been open for 30 days with no activity. |
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