-
-
Notifications
You must be signed in to change notification settings - Fork 52
dev call 20230202
Stepan Sindelar edited this page Feb 2, 2023
·
11 revisions
Petr V., Florian, Stepan, Antonio, Tim, Du Toit, Matti, Simon
It's (again) all about the next release 0.9.
-
Merged PRs:
-
We need to make decisions for a few things:
- How to resolve Equivalent of PyObject_TypeCheck
- Do we want an Eval API? If so, which one?
-
Some important PRs still need to be reviewed and merged.
-
Numpy/HPy
-
There is a list of API functions we've introduced in our branch that are not yet on master and maybe will never be:
-
Less controversial ones:
int HPyType_IsSubtype(HPyContext *ctx, HPy sub, HPy type); const char *HPyType_GetName(HPyContext *ctx, HPy type); HPy HPySeqIter_New(HPyContext *ctx, HPy seq); HPy HPyUnicode_FromEncodedObject(HPyContext *ctx, HPy obj, const char *encoding, const char *errors); HPy HPyUnicode_Substring(HPyContext *ctx, HPy obj, HPy_ssize_t start, HPy_ssize_t end); HPy HPyDict_Keys(HPyContext *ctx, HPy h); int HPySlice_Unpack(HPyContext *ctx, HPy slice, HPy_ssize_t *start, HPy_ssize_t *stop, HPy_ssize_t *step); HPy HPyContextVar_New(HPyContext *ctx, const char *name, HPy default_value); int HPyContextVar_Get(HPyContext *ctx, HPy context_var, HPy default_value, HPy *result); HPy HPyContextVar_Set(HPyContext *ctx, HPy context_var, HPy value);
-
Controversial ones:
HPy HPy_MaybeGetAttr_s(HPyContext *ctx, HPy obj, const char *name); /* more like HPy_GetAttr_NoError */ int HPy_SetType(HPyContext *ctx, HPy obj, HPy type); /* should eventually go away */ HPy HPyDict_GetItem(HPyContext *ctx, HPy op, HPy key); /* Simon prefers to avoid that and have only the generic API; Antonio argues that it's used a lot. Simon wants HPyDict_GetItemWithError */ int HPyType_CheckSlot(HPyContext *ctx, HPy type, HPyDef *value); /* CPython is up to introduce HPy HPyUnicode_InternFromString(HPyContext *ctx, const char *str); /* let's leave that out */ int HPySequence_Check(HPyContext *ctx, HPy h);
-
-
Misc
- Module state: use separate calling convention? Call for better macro names. https://github.com/hpyproject/hpy/issues/286#issuecomment-1413418275
-
Use fixed width integers (at least in ABI): I'm working on using
int64_t
forHPy_ssize_t
but that's a bit cumbersome. We assume thatsizeof(HPy_ssize_t) == sizeof(Py_ssize_t)
which could be violated. - More doc is needed. In particular API function documentation. If anyone has spare time, please help.
- We need a few more API functions (or replacements) for Numpy/HPy. I've updated the branches and this is the current diff.
- How to resolve Equivalent of PyObject_TypeCheck
- Let's go for option 1 as described in the issue.
- Do we want an Eval API? If so, which one?
- Florian suggests to implement very basic functions like CPython's Py_CompileString and PyEval_EvalCode. Everyone agrees with that.
-
Use fixed-width integers and clarify encoding of C strings.: Let's not waste time on that and just use
ssize_t
forHPy_ssize_t
. -
Support vectorcall protocol
- Simon is mostly concerned about having so many different but somehow similar calling conventions.
- Florian suggests that we could align them. E.g. the
varargs
convention already uses CPython's fastcall convention but we could also use the vectorcall convention. - Antonio suggested to make vectorcall the default (so, maybe no
tp_call
at all). - Stepan asks Petr for the reason of vectorcall; this is for better performance. There are several sources of better performance depending on what is being called. First because tuple's don't need to be created/unpacked. For methods, it's the extra slot in the args array for self. etc.
- Given that we already use fastcall internally, does vectorcall make sense at all? Petr answers yes because fastcall doesn't address all problems.
- Stepan suggests that we should think of vectorcall as a slot and slots have different calling conventions.
- Antonio points out that CPython has also METH_FASTCALL | METH_KEYWORDS, which is the same as vectorcall and HPy could take use of that. Maybe use that instead of the other kwargs calling conventions that HPy has? Petr pointed out that sometimes it is preferable to take keyword args as dictionary if you pass it to some other functions.
- Discussion of controversial API functions used in the Numpy/HPy port:
HPy_SetType
- Setting the type is only a temporary thing and eventually go away.
HPyDict_GetItem
- Simon prefers to avoid such functions and have only the generic API. Antonio argues that it's used a lot. It's not clear why this function is used. Simon argues that if this is for performance, then again: the runtime should do it (having shortcuts internally instead of doing the full dispatch). If it's because of the different error behavior, then Simon rather prefers to have a
HPy(Dict)_GetItemNoError
. HPy_MaybeGetAttr_s
- Similar to
HpyDict_GetItem
: should it beHPy_GetAttr_NoError
. Florian suggests to create an issue for further discussion. HPyType_CheckSlot
- CPython is up to introduce something similar. It is therefore also a possible way for us. Petr asks, where Numpy is using that since he wants to track that a bit.
HPyUnicode_InternFromString
- It's unclear what guarantees are given with string interning. Matti says, this is a perf optimization. That's something the runtime should do. We won't implement that but use
HPyUnicode_FromString
instead. HPySequence_Check
- We may need something like this since semantics is derived from slots. Florian will analyze usage of it in Numpy and maybe that helps to make a decision on if and how we should implement that.
We also quickly talked about conferences.
- Matti will certainly attend
SciPy 2023
- Antonio (and Simon?) will certainly be at
PyCon US 2023
- One of Tim, Stepan, Florian will try to be at
EuroPython 2023
- There is also a Python core dev sprint in autumn 2023 (Brno, CZ)
- We could co-locate an HPy sprint with that.
- 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