-
-
Notifications
You must be signed in to change notification settings - Fork 53
dev call 20230112
Florian Angerer edited this page Jan 12, 2023
·
2 revisions
Stepan, Florian, Mohaned, Ronan, Simon, Tim, Antonio, Du Toit
- Next release 0.9: I think the major parts are mostly ready. Some important PRs still need to be reviewed and merged.
- Merged PRs:
- Status updates
- This is the way to go forward and we will drop single-phase init.
- Antonio is just slightly concerned about the more complicated migration path since most C API extensions still use single-phase init.
- We already have this problem with types since one needs to convert from static types to heap types.
- Migration might not be too hard since most of the
PyInit_*
function just goes into theHPy_mod_exec
slot. - Major difference: it is no longer possible to directly create a module instance since
HPyModule_Create
was removed and the runtime will create the module instance. As a consequence, theHPy_mod_create
slot may also just create other objects likeSimpleNamespace
but there is anyhow not many use cases forHPy_mod_create
. - People are in favor of merging this PR. It may be possible to provide a few more helper macros to make migration easier.
- Stepan investigated and discussed (with CPython core devs) one flaw in the current CPython API: It is possible to create multiple instances of one module in the same interpreter with multi-phase init. In this case, using module state may be problematic when used in slots. This problem may be hit if one inherits from a type of a module with multiple instances. The module instance needs to be looked up with the corresponding
PyModuleDef
but and this will point to the old instance. So, it is possible to operate on the wrong module state. - See Issue 286
- Antonio proposed: change convention such that you always get a module state in slots as well; then introduce a global flag that you don't care about this such that we can be fast on CPython.
- Antonio strongly asks for getting the API right even if we cannot implement it correctly or efficiently on CPython.
- Simon suggested to create a micro benchmark and measure the expensive lookup on CPython
- After some discussion, everyone seems to be convinced that it is useful to have fixed-width integers in the ABI.
- The open PR still provides inline helper functions like
HPyLong_FromLong
that will decide at HPy extension compilation time what ABI function to use. Hence, the API doesn't change much but gets additional functions forHPyLong_FromInt32_t
and such. - We also discussed on how to deal with
size_t
andHPy_ssize_t
. In particularHPy_ssize_t
is a bit more problematic because it is also frequently used in function signatures for slots or varargs etc. Since HPy mainly targets for 64-bit systems, we might just useint64_t
instead ofHPy_ssize_t
in those signatures. This may be a slight performance drawback on 32-bit systems but we don't even test on those. - Antonio also suggested to replace
HPy_ssize_t
byssize_t
since that should be available on all C99 (and newer) compilers.
- Florian will kick out Issue 181 and Issue 214 since we preserve those for internship projects. They will mainly just add API and thus shouldn't be a problem to do after the next release.
- Florian also asked for a review of PR Support vectorcall protocol. Even if the vectorcall function signature is already very similar to HPy's varargs function signature, it gives one major advantage: you can have different functions per object.
- 5 September 2024
- 4 April 2024
- 7 March 2024
- 1 February 2024
- 11 January 2024
- 7 December 2023
- 9 November 2023
- 5 October 2023
- 14 September 2023
- 3 August 2023
- 6 July 2023
- 1 June 2023
- 4 May 2023
- 13 April 2023
- 2 March 2023
- 2 February 2023
- 12 January 2023
- 1 December 2022
- 3 November 2022
- 6 October 2022
- 8 September 2022
- 4 August 2022
- 7 July 2022
- 2 June 2022
- 5 May 2022
- 7 April 2022
- 3 March 2022
- 3 February 2022
- 13 January 2022
- 2 December 2021
- 4 November 2021
- 7 October 2021
- 2 September 2021
- 12 August 2021
- 8 July 2021
- 6 May 2021
- 4 March 2021
- 7 January 2021
- 3 December 2020
- 5 November 2020