code wiki / (root) / nx_symbiote.nx

nx_symbiote.nx

buildroot/runtime/nx_symbiote.nx

11395 B280 linesdepth 3pulls 5 transitivereach 7 importersview sourcekind library
docsdependenciesstructsconstsfunctions

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

nx_syscalls.nx nx_tier.nx nx_budget.nx nx_attention_class.nx nx_evict_journal.nx nx_symbiote.nx nx_ecosystem_compose_test.nx nx_organism.nx nx_organism_test.nx nx_sovereign_compose_test.nx nx_symbiote_test.nx

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

100struct NxSymbiote

consts

71const NX_MAGIC_1024: i64 = 1024
75const NX_SYM_RUNNING: nx_int = 0
76const NX_SYM_THROTTLED: nx_int = 1
77const NX_SYM_PAUSED: nx_int = 2
78const NX_SYM_TERMINATED: nx_int = 3
79const NX_SYM_GONE: nx_int = 4 // process exited on its own
80const NX_SYM_N_STATES: nx_int = 5
84const NX_SYM_OK: nx_int = 0
85const NX_SYM_ERR_BAD_STATE: nx_int = 1
86const NX_SYM_ERR_BAD_PID: nx_int = 2
87const NX_SYM_ERR_ALREADY_GONE: nx_int = 3

functions

116func nx_sym_state_is_valid(s: nx_int) -> nx_int
called by 1: main
124func nx_symbiote_new(pid: nx_int,
called by 4: mainmainmainmain calls 1: sys_mmap
150func nx_symbiote_update(s: *NxSymbiote,
called by 4: mainmainmainmain
170func nx_symbiote_overshoot_q10(s: *NxSymbiote, kind: nx_int) -> nx_int
called by 1: main
188func nx_symbiote_throttle(s: *NxSymbiote,
called by 1: main calls 1: nx_evict_log
209func nx_symbiote_pause(s: *NxSymbiote,
called by 1: main calls 1: nx_evict_log
230func nx_symbiote_resume(s: *NxSymbiote) -> nx_int
called by 1: main
243func nx_symbiote_terminate(s: *NxSymbiote,
called by 1: main calls 1: nx_evict_log
262func nx_symbiote_is_responsive(s: *NxSymbiote) -> nx_int
called by 3: mainmainmain
273func nx_symbiote_stale_observation(s: *NxSymbiote,
called by 1: main