code wiki / _hdl_build / nx_gen_worker.nx

nx_gen_worker.nx

buildroot/runtime/_hdl_build/nx_gen_worker.nx

11726 B178 linesdepth 3pulls 4 transitivereach 8 importersview sourcekind librarytopic gen
docsdependenciesstructsconstsfunctions

about

nx_gen_worker.nx -- the GenWorker object: the GPU-worker CLIENT. Owns dispatch to a worker (a.b.c.d:port) for image gen (/v1/images/generations) and chat (/v1/chat/completions), plus the non-blocking TCP health-check that makes multi-worker availability-based selection + failover safe (a powered-off worker must never hang a dispatch). Extracted from nx_gen_orchestrator (monolith -> objects); behaviour-preserving. THIS is where ER-8 model-select-by- intent will land (route SFW->controlled model, explicit->turbo). Self-contained (private gw_* helpers). Object model: companion_arch.md. license_tier: ORIGINAL

dependencies 3 imports · 2 importers

nx_syscalls.nx nx_netprobe_lib.nx nx_gen_conf_lib.nx nx_gen_worker.nx nx_gen_inpaint_gate.nx nx_gen_orchestrator.nx

imports: nx_syscalls.nxnx_netprobe_lib.nxnx_gen_conf_lib.nx

imported by: nx_gen_inpaint_gate.nxnx_gen_orchestrator.nx

structs

none

consts

95const GW_CHAT_BUDGET_FALLBACK_S: i64 = 25
96const GW_CHAT_BUDGET_CEIL_S: i64 = 300
128const GW_MASK_EMPTY: i64 = 0 - 1
129const GW_MASK_NOT_B64: i64 = 0 - 2
130const GW_MASK_BAD_INVERT: i64 = 0 - 3
131const GW_CH_UP_A: i64 = 65
132const GW_CH_UP_Z: i64 = 90
133const GW_CH_LO_A: i64 = 97
134const GW_CH_LO_Z: i64 = 122
135const GW_CH_D0: i64 = 48
136const GW_CH_D9: i64 = 57
137const GW_CH_PLUS: i64 = 43
138const GW_CH_SLASH: i64 = 47
139const GW_CH_EQ: i64 = 61

functions

11func gw_cat(dst: *u8, off: i64, s: *u8) -> i64 { var o: i64=off; var i: i64=0; while s[i]!=(0 as u8){dst[o]=s[i]; o=o+1; i=i+1} return o }
12func gw_catb(dst: *u8, off: i64, src: *u8, n: i64) -> i64 { var o: i64=off; var i: i64=0; while i<n {dst[o]=src[i]; o=o+1; i=i+1} return o }
13func gw_itoa(dst: *u8, off: i64, v: i64) -> i64 { let t: *u8=sys_mmap(28); var m: i64=v; var k: i64=0; if m==0{t[0]=48 as u8;k=1} while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1} var o: i64=off; var q: i64=k-1; while q>=0{dst[o]=t[q];o=o+1;q=q-1} return o }
30func gw_read_full(fd: i64, respbuf: *u8, respcap: i64) -> i64
43func go_worker_dispatch(ha: i64, hb: i64, hc: i64, hd: i64, port: i64, body: *u8, blen: i64, respbuf: *u8, respcap: i64) -> i64
65func go_worker_img2img(ha: i64, hb: i64, hc: i64, hd: i64, port: i64, body: *u8, blen: i64, respbuf: *u8, respcap: i64) -> i64
89func go_worker_up(ha: i64, hb: i64, hc: i64, hd: i64, port: i64) -> i64 { return np_probe_up(ha, hb, hc, hd, port) }
97func gw_chat_budget_s() -> i64
140func gw_b64_byte_ok(c: i64) -> i64
called by 1: gw_inpaint_mask
149func gw_inpaint_mask(dst: *u8, off: i64, mask_b64: *u8, mlen: i64, invert: i64) -> i64
162func go_chat_dispatch(ha: i64, hb: i64, hc: i64, hd: i64, port: i64, body: *u8, blen: i64, respbuf: *u8, respcap: i64) -> i64