<phlebas> thanks for the notes :)
mwalkiewicz has joined #hpy
computerfarmer has joined #hpy
computerfarmer has quit [Ping timeout: 252 seconds]
<antocuni> fangerer: did you have a chance to review PR 220? I'd like to hear a GraalPython perspective before merging it
<ronan> antocuni: State.build_api() only calls rawrefcount.init() in tests. In a translated pypy, it's State.startup() that does it.
ronan_ has joined #hpy
ronan has quit [Ping timeout: 240 seconds]
ronan_ is now known as ronan
<ronan> I think we need to ensure that cpyext has been imported before loading any hpy extension
<ronan> the easiest way is probably to do it at _hpy_universal startup
<ronan> antocuni: I'm a bit confused between space.config.objspace.hpy_cpyext_API and space.config.objspace.usemodules.cpyext. Not sure which one I should use to guard the cpyext import
<antocuni> ronan: I think you you need hpy_cpyext_API
<antocuni> this is the flag used to enable the hpy-cpyext compatibility layer
<antocuni> without the flag, things like HPy_FromPyObject are not available
<antocuni> i.e. it is in theory possible to have usemodules.cpyext=True and objspace.hpy_cpyext_API=False. The utility of the latter is mostly to disable cpyext in tests to speed them up
<antocuni> re "ensure cpyext has been imported before loading hpy modules". Yes, I think it's the correct thing to do at the moment. It will be different once we introduce the hybrid API
<antocuni> so that we can know in advance whether a module will be fully universal or also cpyext features
computerfarmer has joined #hpy
<ronan> yes indeed
<ronan> so we should import cpyext lazily from _hpy_universal.load()
<antocuni> yes
<antocuni> well, the RPython-level imports don't need to be lazy of course. E.g. cpyext is unconditionally imported by interp_cpy_compat
<antocuni> but you have to call cpyext.setup() only if has_hpy_cpyext==True
computerfarmer has quit [Ping timeout: 252 seconds]
computerfarmer has joined #hpy
<ronan> well, we shouldn't call cpyext.setup() again if cpyext was already imported, but I think space.getbuiltinmodule('cpyext') does the right thing
<antocuni> ok
<ronan> hmm, hpy_cpyext_API=True should require usemodules.cpyext=True
<antocuni> maybe we can even kill hpy_cpyext_API and just use usemodules.cpyext. I don't remember why I had to introduce it (but I think there is/was a reason)
<ronan> well, in principle, you could have a pypy that supports hpy and cpyext without interoperation between them
<antocuni> yes, but I'm not sure there is a reasonable use case for that
<ronan> not sure either tbh
<ronan> for benchmarking, maybe?
<antocuni> maybe
<antocuni> indeed, keeping has_hpy_cpyext does not cost much, so we can just do that
<ronan> pff, after fighting with the config system, I couldn't find a good way to force usemodules.cpyext when hpy_cpyext_API=True
computerfarmer has quit [Ping timeout: 255 seconds]