nx_organism.nx
buildroot/runtime/nx_organism.nx
about
nx_organism.nx -- ecosystem-wide pathway + symbiote container.
Biological analogue: an organism is the multi-pathway entity that
coordinates many pathways across many tissues with shared homeostasis.
In Nishi terms: an organism holds N nx_pathways (Nishi-native cells)
AND N nx_symbiotes (foreign processes integrated into the ecosystem
like Steam-hosted NMS, Chrome, OBS) and arbitrates resources across
the WHOLE union.
THIS IS THE ECOSYSTEM-WIDE OPTIMIZATION SUBSTRATE. Per user 2026-05-
19: "i want it work across the whole nishi ecosystem and then across
the whole nishi ecosystem + (nishi native and non native things that
are integrated)." Single host machine running Nishi cells + Steam +
NMS + dev tools simultaneously: organism is the layer that decides
which gets displaced when the host's VRAM crosses 90%.
Composes:
nx_pathway -- each contributes its own cells + budgets
nx_symbiote -- foreign-process virtual cells with observed
(not promised) resource consumption
nx_budget -- organism has its OWN host-aggregate budget
(the physical hardware ceiling)
nx_evict_journal -- organism-level events log here
nx_attention_class -- per-cell + per-symbiote class drives priority
nx_treaty -- bilateral agreements between organism members
V1 ships a flat container with built-in arbitration. The hypothalamus
(master regulator) function is folded in as nx_organism_pick_dis-
placement; if it grows, a separate nx_hypothalamus primitive is
extracted.
Gap list (V1 honest perf verdict):
- no actual host-resource probe (host_budget supplied by caller)
- no peer-mesh federation (one organism per host)
- flat membership (no nested organism-of-organisms)
- no fairness scheduling within same attention class
genealogy_id: nishi_cardinal_2026-05-19_ecosystem_wide + biology_multi_pathway_organism
lineage_id: substrate_organism_v1
dependencies 7 imports · 5 importers
imports: nx_syscalls.nxnx_tier.nxnx_budget.nxnx_attention_class.nxnx_evict_journal.nxnx_pathway.nxnx_symbiote.nx
imported by: nx_ecosystem_compose_test.nxnx_organism_test.nxnx_reclaim.nxnx_reclaim_test.nxnx_sovereign_compose_test.nx
structs
| 86 | struct NxOrganism |
consts
| 57 | const NX_MAGIC_1024: i64 = 1024 |
| 61 | const NX_ORG_OK: nx_int = 0 |
| 62 | const NX_ORG_ERR_FULL: nx_int = 1 |
| 63 | const NX_ORG_ERR_NOT_FOUND: nx_int = 2 |
| 64 | const NX_ORG_ERR_BAD_MEMBER: nx_int = 3 |
| 73 | const NX_DISP_NONE: nx_int = 0 // no displacement needed |
| 74 | const NX_DISP_NATIVE_CELL: nx_int = 1 |
| 75 | const NX_DISP_SYMBIOTE: nx_int = 2 |
functions
| 99 | func nx_organism_new(host_budget: *NxBudget, |
| 119 | func _organism_pathway_at(o: *NxOrganism, idx: nx_size) -> *NxPathway |
| 124 | func _organism_symbiote_at(o: *NxOrganism, idx: nx_size) -> *NxSymbiote |
| 129 | func _organism_pathway_set(o: *NxOrganism, idx: nx_size, p: *NxPathway) -> nx_int called by 1: nx_organism_add_pathway |
| 135 | func _organism_symbiote_set(o: *NxOrganism, idx: nx_size, s: *NxSymbiote) -> nx_int called by 1: nx_organism_add_symbiote |
| 143 | func nx_organism_add_pathway(o: *NxOrganism, p: *NxPathway) -> nx_int |
| 153 | func nx_organism_add_symbiote(o: *NxOrganism, s: *NxSymbiote) -> nx_int |
| 167 | func nx_organism_total_ram_max(o: *NxOrganism) -> nx_size called by 2: mainmain calls 3: nx_pathway_aggregate_ram_max_organism_pathway_at_organism_symbiote_at |
| 187 | func nx_organism_total_vram_max(o: *NxOrganism) -> nx_size called by 2: mainmain calls 3: nx_pathway_aggregate_vram_max_organism_pathway_at_organism_symbiote_at |
| 213 | func nx_organism_total_observed_ram(o: *NxOrganism) -> nx_size |
| 234 | func nx_organism_host_pressure_q10(o: *NxOrganism, kind: nx_int) -> nx_int |
| 273 | func nx_organism_pick_displacement(o: *NxOrganism, called by 2: mainmain calls 4: nx_organism_host_pressure_q10_organism_pathway_atnx_ac_priority_organism_symbiote_at |
| 324 | func nx_organism_count_members(o: *NxOrganism) -> nx_size |
| 330 | func nx_organism_total_observed_vram(o: *NxOrganism) -> nx_size called by 2: mainmain calls 3: nx_pathway_aggregate_vram_max_organism_pathway_at_organism_symbiote_at |