code wiki / (root) / nx_mycorrhizal.nx

nx_mycorrhizal.nx

buildroot/runtime/nx_mycorrhizal.nx

7460 B213 linesdepth 2pulls 2 transitivereach 2 importersview sourcekind library
docsdependenciesstructsconstsfunctions

about

nx_mycorrhizal.nx -- peer-mesh network topology (fungal web). Biology: mycorrhizal fungi form a "wood-wide-web" between plant roots. Many bilateral hyphae connections compose into a network topology that shares nutrients, water, and chemical signals across an entire forest -- redundant, decentralized, healing. DIFFERENT FROM nx_hypha (which already exists for point-to-point peer share): nx_hypha is one edge. nx_mycorrhizal is the entire NETWORK of edges + nodes, with topology operations: connect, disconnect, traverse, find_shortest_path, count_healthy_peers, detect_partition. Per [[feedback-pathway-tropism-block-composition-location-agnostic]] vision: "same .nx pathway runs local/NAS/peer/cloud transparently." Mycorrhizal is the substrate-side topology over which peer pathways live. Composes: nx_hypha -- the edges this network is made of (each hypha is one bilateral connection) nx_pollinate -- distributes payloads ACROSS the mycorrhizal network (the topology determines who receives) nx_organism -- multi-host organism federations live atop this nx_tropism -- location-policy resolver consults topology when choosing destination nx_microbiome -- a mycorrhizal network of microbiomes is one legitimate "forest" topology

dependencies 2 imports · 2 importers

nx_syscalls.nx nx_tier.nx nx_mycorrhizal.nx nx_mycorrhizal_test.nx nx_tier3_ecology_compose_test.nx

imports: nx_syscalls.nxnx_tier.nx

imported by: nx_mycorrhizal_test.nxnx_tier3_ecology_compose_test.nx

structs

44struct NxMycoNode
53struct NxMycoEdge
62struct NxMycorrhizalNetwork

consts

32const NX_MAGIC_1024: i64 = 1024
36const NX_MYC_OK: nx_int = 0
37const NX_MYC_ERR_FULL: nx_int = 1
38const NX_MYC_ERR_NOT_FOUND: nx_int = 2
39const NX_MYC_ERR_ALREADY_LINKED: nx_int = 3
40const NX_MYC_ERR_PARTITIONED: nx_int = 4
71const NX_MYC_NODE_BYTES: nx_size = 32
72const NX_MYC_EDGE_BYTES: nx_size = 32
74const NX_MYC_HEALTHY_THRESHOLD_Q10: nx_int = 614 // 60%

functions

76func nx_mycorrhizal_new(node_capacity: nx_size,
called by 2: mainmain calls 1: sys_mmap
90func _myc_node_at(n: *NxMycorrhizalNetwork, idx: nx_size) -> *NxMycoNode
94func _myc_edge_at(n: *NxMycorrhizalNetwork, idx: nx_size) -> *NxMycoEdge
98func _myc_find_node(n: *NxMycorrhizalNetwork, peer_id: nx_int) -> nx_int
108func nx_mycorrhizal_join(n: *NxMycorrhizalNetwork,
called by 2: mainmain calls 2: _myc_find_node_myc_node_at
123func _myc_find_edge(n: *NxMycorrhizalNetwork, a: nx_int, b: nx_int) -> nx_int
156func nx_mycorrhizal_peer_count(n: *NxMycorrhizalNetwork) -> nx_size
called by 2: mainmain
160func nx_mycorrhizal_edge_count(n: *NxMycorrhizalNetwork) -> nx_size
called by 2: mainmain
164func nx_mycorrhizal_is_linked(n: *NxMycorrhizalNetwork,
called by 1: main calls 1: _myc_find_edge
172func nx_mycorrhizal_count_healthy(n: *NxMycorrhizalNetwork) -> nx_int
called by 2: mainmain calls 1: _myc_node_at
189func nx_mycorrhizal_peer_degree(n: *NxMycorrhizalNetwork, peer_id: nx_int) -> nx_int
called by 2: mainmain calls 1: _myc_edge_at
203func nx_mycorrhizal_update_health(n: *NxMycorrhizalNetwork,
called by 1: main calls 2: _myc_find_node_myc_node_at