nx_gpu_embed_gate.nx
buildroot/runtime/nx_gpu_embed_gate.nx
about
nx_gpu_embed_gate.nx -- E-ARC e4 (2026-07-15): the NISHILANG GPU-EMBED CLIENT, gated BIT-EXACT
vs the CPU path. This organ IS the #23 serve-integration contract rehearsed end-to-end: NishiLang
keeps tokenize (tk_bpe_encode) + dequant_row (embedding lookup); the resident-weight GPU server
(/home/elderwesto/nx_stage/nx_gpu.sock, gpu_embed_serve.c --serve, C=bootstrap oracle) runs the
24-layer forward; embed protocol = send [pos:-(i+1) i64][x1: 896 i64] per token, reply = the
last-token pooled final-norm hidden state [896 i64] (the jina-recipe embedding, no LM head).
GATES:
T1/T2 BIT-EXACT two texts: GPU-socket embedding == nsv_embed (CPU i8) vector, 896/896
T3 DISTINCT the two texts' vectors differ (comparator sanity)
T4 NEG perturbing the last token's embedding row by +1 MUST break equality
Requires: coder GGUF staged + GPU server running persistent. The 2nd model read (~676MB) is the
price of file-scoped serve statics -- the real serve integration runs in-process and pays nothing.
license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0
dependencies 2 imports · 0 importers
imports: nx_nofloat_serve_core.nxnx_lib_std.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
| 17 | const GE_NE: i64 = 896 |
functions
| 19 | func ge2_ws(s: *u8) -> i64 |
| 26 | func ge2_kv(label: *u8, v: i64) -> i64 |
| 35 | func ge2_connect() -> i64 |
| 49 | func ge2_wall(fd: i64, buf: *u8, count: i64) -> i64 called by 1: ge2_gpu_embed |
| 60 | func ge2_rall(fd: i64, buf: *u8, count: i64) -> i64 |
| 71 | func ge2_slen(s: *u8) -> i64 called by 1: main |
| 81 | func ge2_gpu_embed(sock: i64, mp: *i64, text: *u8, tlen: i64, gpuvec: *i64, perturb_last: i64) -> i64 |
| 105 | func ge2_mismatches(a: *i64, b: *i64) -> i64 called by 1: main |
| 112 | func main() -> i64 |