Skip to content

Architecture Pybind Bridge

Devrajsinh Gohil edited this page Aug 30, 2026 · 1 revision

Zero-Copy Pybind11 Bridge

The Python adapter communicates with the C++20 engine with zero data serialization overhead.


Zero-Copy Mechanics

  • Python objects (dict, callable, router) are passed as raw CPython pointer handles (PyObject*).
  • Reference counts are incremented on registration (Py_INCREF) and released on destruction (Py_XDECREF).
  • State dictionaries are updated in-place via CPython C-API functions (PyDict_SetItem, PyDict_GetItem), avoiding expensive JSON or protobuf serialization during in-process execution.\n

Clone this wiki locally