Skip to content

Dev Call: 4 November 2021

Tim Felgentreff edited this page Dec 2, 2021 · 1 revision

Present

Ronan, Stepan, Florian, Tim, Anto, Simon

Notes

  • Status of Numpy
    • tp_dealloc -> tp_finalize
    • transforming tp_traverse
    • setting it up to use HPy_Field => see discussion of HPy_GetContext
  • We may need a HPy_GetContext
    • otherwise almost everything needs to be migrated immediately
    • similar problems will come up when migrating pybind11, which has c++ operators which do Py_ calls
    • discussing HPy_Context stack for nested downcalls?
      • HPy_GetContext would give the top of the stack context
    • Simon proposal: HPy_MakeContext that gives you a context that you should not hold on to
    • Stepan proposal: use a trampoline to go through the runtime to call back into our converted function that takes HPy_Context*, void*
      • get the trampoline function from the context and keep it around
      • when we need a context, we call the trampoline with the migrated function that does take the context and additional void* args
  • tp_finalize is supported in NumPy and can upcall arbitrary code
    • guaranteed to be called once exactly, even though it can resurrect; same as __del__ on the Python level
  • weak referencable types need special handling for CPython
    • use a flag on HPy to declare a type as weak referencable
Clone this wiki locally