nx_swarm_coord.nx
buildroot/runtime/nx_swarm_coord.nx
about
nx_swarm_coord.nx -- SWARM FABRIC class-aware COORDINATOR (SF-R-COORD): the missing UNIFIER that routes
any job to the right COMPUTE CLASS across the heterogeneous pool. Fixes the "ignored the GPU" gap in the
fabric AND coordinates the fabric with the EXISTING mesh -- it does NOT duplicate them:
* GPU classes (image/video/render/train) -> the GPU worker roster from nx_worker_dispatch (wd_route/
wd_worker_where: gpu-image=laptop 5080, gpu-video=west 3090). Roles/endpoints are that organ's SSOT;
inlined here (like nx_dispatch_lease inlined rt_lock) to keep ONE nx_syscalls surface + dodge the
double-main trap of importing an executable organ.
* CPU classes (cpu/tile/transcode/hash) -> the fabric's nx_swarm_place over live beacon telemetry.
* CLOUD/LLM classes -> the cloud/no-float lane.
* ALLOCATION under contention (VRAM/GPU-us/CPU-us fairness+preempt) = nx_resource_arbiter (already models
these as first-class; its budgets are "fed by nothing" today -> the beacon telemetry is the FEED to wire).
★★THE LIAR-KILLER = THE OPERATOR'S CORRECTION, MECHANIZED: a GPU-class job is NEVER placed on a GPU-less
node. If no GPU is available it QUEUES (or falls back to ANOTHER GPU) -- it must NOT silently run gen on
CPU. The gate proves this can't happen. That is "don't ignore the GPU", turned into a test.
route <class> <gpu_avail_csv> -- decide subsystem+target for a job class given which GPU roles are up
[gate] -- self-gate: routing discriminates + the never-ignore-GPU liar-killers
gpu_avail_csv = comma list of live GPU roles, e.g. "gpu-image,gpu-video" or "" (none up). In production this
comes from the mesh probe / the beat store once GPU nodes beacon. license_tier: ORIGINAL expect_exit:0
dependencies 2 imports · 0 importers
imports: nx_swarm_lib.nxnx_swarm_endpoint_lib.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
| 26 | const CO_GPU: i64 = 0 |
| 27 | const CO_CPU: i64 = 1 |
| 28 | const CO_CLOUD: i64 = 2 |
| 29 | const CO_UNKNOWN: i64 = 3 |
functions
| 31 | func co_puts(s: *u8) -> i64 { sys_write(1, s, fa_len(s)); return 0 } |
| 32 | func co_eq(a: *u8, b: *u8) -> i64 |
| 40 | func co_kind(cls: *u8) -> i64 |
| 60 | func co_pref_role(cls: *u8) -> *u8 |
| 67 | func co_endpoint(role: *u8) -> *u8 |
| 74 | func co_csv_has(csv: *u8, role: *u8) -> i64 |
| 108 | func co_usable(role: *u8, gpu_avail: *u8) -> i64 |
| 119 | func co_route(cls: *u8, gpu_avail: *u8) -> i64 |
| 164 | func co_gate() -> i64 |
| 234 | func main(argc: i64, argv: *i64) -> i64 |