nx_symbiote.nx
buildroot/runtime/nx_symbiote.nx
about
nx_symbiote.nx -- foreign-process virtual cell.
Biological analogue: a symbiote is a non-self organism living
cooperatively with the host -- mitochondria are the classic example
(originally free-living bacteria, now permanent residents). Nishi
symbiote wraps a non-Nishi process (Steam-hosted NMS, Chrome, OBS,
VS Code, a CUDA training run) and projects it into the same resource-
arbitration substrate as Nishi-native cells.
THIS IS THE PARTNERSHIP INTERFACE. Per user 2026-05-19 NMS-via-Steam
scenario: "where can we build from the silicon up to get the best
experience on the nishi ecosystem and then as it moves off our
ecosystem into steam partnering with steam to improve things like
vram usage, disk space usage." The user runs NMS via Steam; we
can't make Steam speak Nishi grammar, but we can OBSERVE the Steam-
hosted process and NEGOTIATE through a treaty (see nx_treaty).
CRITICAL HONESTY (per [[feedback-honest-perf-verdict-no-aspirational-
claims]]): symbiote resource numbers are AS-OBSERVED, not AS-PROMISED.
A native nx_cell honors its budget contractually -- the substrate
enforces it. A symbiote may consume MORE than declared at any moment
because it has no contractual obligation. Symbiote's job is to
MEASURE the reality, not GUARANTEE the limit.
Composes:
nx_budget -- virtual_budget records the symbiote's
DECLARED resource ceiling (caller-supplied;
honest baseline for treaty negotiation)
nx_attention_class -- foreground game symbiote (NMS) gets
foreground priority just like native cells
nx_evict_journal -- throttle/pause/terminate events logged
nx_treaty -- bilateral resource agreement between
organism and symbiote
nx_organism -- the container that arbitrates across all
symbiotes + native pathways
V1 ships an in-memory descriptor with caller-supplied observation
updates. Real OS probes (Linux /proc/<pid>/status + /proc/<pid>/
io, Windows Job Object + GetProcessMemoryInfo + nvidia-smi pmon)
are queued -- the integration layer between nx_symbiote and the
dependencies 5 imports · 5 importers
imports: nx_syscalls.nxnx_tier.nxnx_budget.nxnx_attention_class.nxnx_evict_journal.nx
imported by: nx_ecosystem_compose_test.nxnx_organism.nxnx_organism_test.nxnx_sovereign_compose_test.nxnx_symbiote_test.nx
structs
| 100 | struct NxSymbiote |
consts
| 71 | const NX_MAGIC_1024: i64 = 1024 |
| 75 | const NX_SYM_RUNNING: nx_int = 0 |
| 76 | const NX_SYM_THROTTLED: nx_int = 1 |
| 77 | const NX_SYM_PAUSED: nx_int = 2 |
| 78 | const NX_SYM_TERMINATED: nx_int = 3 |
| 79 | const NX_SYM_GONE: nx_int = 4 // process exited on its own |
| 80 | const NX_SYM_N_STATES: nx_int = 5 |
| 84 | const NX_SYM_OK: nx_int = 0 |
| 85 | const NX_SYM_ERR_BAD_STATE: nx_int = 1 |
| 86 | const NX_SYM_ERR_BAD_PID: nx_int = 2 |
| 87 | const NX_SYM_ERR_ALREADY_GONE: nx_int = 3 |
functions
| 116 | func nx_sym_state_is_valid(s: nx_int) -> nx_int called by 1: main |
| 124 | func nx_symbiote_new(pid: nx_int, |
| 150 | func nx_symbiote_update(s: *NxSymbiote, |
| 170 | func nx_symbiote_overshoot_q10(s: *NxSymbiote, kind: nx_int) -> nx_int called by 1: main |
| 188 | func nx_symbiote_throttle(s: *NxSymbiote, |
| 209 | func nx_symbiote_pause(s: *NxSymbiote, |
| 230 | func nx_symbiote_resume(s: *NxSymbiote) -> nx_int called by 1: main |
| 243 | func nx_symbiote_terminate(s: *NxSymbiote, |
| 262 | func nx_symbiote_is_responsive(s: *NxSymbiote) -> nx_int |
| 273 | func nx_symbiote_stale_observation(s: *NxSymbiote, called by 1: main |