nx_substrate_python_spawn_test.nx
buildroot/runtime/nx_substrate_python_spawn_test.nx
about
nx_substrate_python_spawn.nx -- substrate IS a Python supervisor.
Cardinal 2026-05-21 ("bits up top down bottom up everything till
we own silicon"): this is the bottom-up convergence witness. A
NishiLang ELF, compiled by nxc2 and running under qemu/WSL2,
becomes the PARENT process of /usr/bin/python3. No bash spawn
step. Substrate calls nx_hal_spawn -> sys_fork + sys_execve;
child runs Python; parent reaps via nx_hal_wait.
What this proves end-to-end:
- nx_hal_spawn handles real-world execve (Python interpreter is
a much larger / more complex binary than /bin/echo + /bin/true
in the prior smoke 10bc9d89)
- argv marshalling works for multi-arg invocations (-c "code")
- exit-code propagation works for arbitrary 0..255 codes (test
specifically requests exit 42 to prove the value reaches the
substrate parent and isn't masked to 0/1)
- Substrate can supervise a Python lifecycle the same way a
container runtime does: spawn + observe + reap
Gap left open after this commit:
- WSL2 Python (3.12) has NO fastapi/uvicorn/pydantic installed
today. Wiring substrate-spawn into the real Elder AI service
path requires installing those Python deps in WSL2 OR adding
a Windows backend to nxc2 (multi-session) so the substrate
ELF runs natively on Windows and spawns Win32 python.exe.
- This smoke is the proof-of-concept; production Elder AI
services still launch via bash adapter today (commits
4551a0d5 / 5e203032 / 6d43d14e / 18f567d3).
genealogy_id: docker_runc_init_2014 + systemd_lifespan_2010 +
cardinal_2026-05-21_top_down_bottom_up_dual_mandate
lineage_id: substrate_python_supervisor_v0_smoke
dependencies 2 imports · 0 importers
imports: nx_syscalls.nxnx_hal.nx
imported by: nobody (leaf or entry point)
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| none |
functions
| 38 | func _emit_stdout(buf: *u8, len: i64) -> i64 |
| 42 | func main() -> i64 |