Proposal 0016: bb_python#19
Open
jimsynz wants to merge 1 commit into
Open
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds proposal 0016 —
bb_python, a safety-aware Python integration layered overpythonx(Livebook's in-process CPython embedding).Key shape:
BB.Python.BrokerGenServer serialises Python access — one GIL, one interpreter, predictable schedulingBB.Python.RobotSpark extension with apython do … endblock carrying apyproject.toml;uv_initruns at compile time for releases, runtime for devPyThreadState_SetAsyncExcraisingKeyboardInterruptto interrupt in-flight Python workBB.Python.PubSubBridge+ an injectedbbPython module exposingbb.on(name, fn),bb.publish(path, payload),bb.safety_state()— scripts cannot arm/disarmVec3/Quaternion/Transform(as NumPy arrays) /Localize.Unit/BB.Message, plus opaquePythonx.Objecthandoff so tensors don't round-trip through ElixirBB.Python.Action.CallandBB.Reactor.Step.PythonCallwrappers for symmetry withbb_jidoandbb_reactorExplicit non-goals: realtime control loops in Python, multiple interpreters, in-Python safety control.
Closes #17.
Test plan
pythonxv0.4.10 to confirm API references (uv_init/2,Pythonx.eval/3,Pythonx.Encoder,Pythonx.Object) match current shapePyThreadState_SetAsyncExc) is reachable throughpythonx's public surface, or scope it as a v0.2 follow-upbb.spawn, atom decoding policy)implemented/oncebb_pythonships