nx_swarm_admit.nx
buildroot/runtime/nx_swarm_admit.nx
about
nx_swarm_admit.nx -- THE GENERAL ECOSYSTEM ADMISSION CAPABILITY (operator 2026-07-16: host-
oversubscription control is the SWARM's job as the cluster scheduler, not a forge hack). Any
workstream's heavy launcher (forge model decode, codec, image-gen, training, a big build) calls
admit BEFORE starting; the swarm returns GRANT/QUEUE/DENY from LIVE host telemetry so the box
never hits the load-105 collision (two uncoordinated model workloads). Supersedes the forge-
specific nx_model_lane by generalizing it: workstream+kind keyed, telemetry-backed, one verdict.
sa_verdict(load1, ncpu, avail_mb, est_mb, floor_mb, held, max_conc) -- PURE, gate-testable:
DENY_LOAD if load1>=ncpu · DENY_RAM if avail<est+floor · QUEUE if held>=max_conc · else GRANT.
Composes nx_model_lane_core (proven /proc telemetry: ml_load1/ml_ncores/ml_meminfo_avail_mb) --
DRY, no reinvention. RUNG 2 = fairness via nx_resource_arbiter (nx_ra_request) + auto cross-proc
holder ledger; RUNG 3 = beacon nb_loadavg_milli canonical source + MCP-expose on the swarm plane.
admit <workstream> <kind> <est_mb> <held> <max_conc> exit = verdict (0 GRANT/1 QUEUE/2/3 DENY)
license_tier: ORIGINAL
dependencies 1 imports · 1 importers
imports: nx_model_lane_core.nx
imported by: nx_swarm_admit_gate.nx
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 16 | const SA_GRANT: i64 = 0 |
| 17 | const SA_QUEUE: i64 = 1 |
| 18 | const SA_DENY_LOAD: i64 = 2 |
| 19 | const SA_DENY_RAM: i64 = 3 |
| 20 | const SA_FLOOR_MB: i64 = 2048 // headroom floor above est (data-driven default; overridable later via svc-config) |
functions
| 23 | func sa_verdict(load1: i64, ncpu: i64, avail_mb: i64, est_mb: i64, floor_mb: i64, held: i64, max_conc: i64) -> i64 |
| 34 | func sa_verdict_name(v: i64) -> *u8 called by 1: sa_admit_live |
| 43 | func sa_admit_live(workstream: *u8, kind: *u8, est_mb: i64, held: i64, max_conc: i64) -> i64 |
| 69 | func main(argc: i64, argv: *i64) -> i64 |