Thanks for the replies. I will cook up some private API in my cpython
fork. Whether or not my new vm ever sees the light of day, I think it
would be worthwhile to consider a proper API (even a _PyEval macro or
two) for the little dance the two subsystems do.

I committed a change to my fork:


This moves direct stack manipulation out of genobject.c into ceval.c and allows me to work on a non-stack way to deal with these tasks (note all the calls to Py_FatalError in the CO_REGISTER branches). I am specifically not holding this up as a proposal for how to do this (I am largely ignorant of many of the internal or CPython-specific aspects of the C API). Still, the tests pass and I can start to address those fatal errors.

Skip
.