nx_code_embed_gate.nx
buildroot/runtime/nx_code_embed_gate.nx
about
nx_code_embed_gate.nx -- SOVEREIGN CODE-EMBEDDING gate (2026-07-14). Grounds the jina-code-embeddings
recipe (arXiv:2508.21290, backbone = Qwen2.5-Coder-0.5B = OUR coder) on the no-float stack: embedding =
last-token pooled final-norm hidden state = nsv_embed(). Task instruction prefixes = jina's EXACT strings.
GATES (liar-killer style):
A ORDER jina model-card 2x2 demo: cos(q1,p1)>cos(q1,p2) AND cos(q2,p2)>cos(q2,p1)
(bf16 jina-tuned oracle values 817/124/120/553 pm -- we gate ORDER only: base weights differ)
B DETERM re-embed q1 AFTER all other texts -> vector must be BITWISE IDENTICAL (catches KV/state leak)
C SELF cos(q1,q1') >= 999 pm (isqrt floor can give 1000+/-1)
D RETRIEVE 3x3 Nishi-corpus NL->code argmax must hit the diagonal 3/3
E API synthetic HTTP POST /embed through nsv_handle -> 200 + ok:1 + dim:896 (the daemon serves
these exact bytes -> the capability is API-reachable, rule-27 style, not gate-only)
HONEST SCOPE: this proves PIPELINE CORRECTNESS on BASE coder weights. SOTA retrieval quality is NOT
claimed -- that grading pends the jina-weight oracle (cc-by-nc-4.0 -> benchmark-only, like gcc).
license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0
dependencies 1 imports · 0 importers
imports: nx_nofloat_serve_core.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 CE_NE: i64 = 896 |
| 18 | const CE_SLOTS: i64 = 11 |
functions
| 20 | func ce_ws(s: *u8) -> i64 |
| 27 | func ce_wdec(v: i64) -> i64 |
| 41 | func ce_kv(label: *u8, v: i64) -> i64 |
| 49 | func ce_isqrt(v: i64) -> i64 called by 1: ce_cos_pm |
| 59 | func ce_cos_pm(a: *i64, b: *i64) -> i64 |
| 92 | func ce_bytes_eq(a: *i64, b: *i64) -> i64 called by 1: main |
| 99 | func ce_find(hay: *u8, hn: i64, needle: *u8) -> i64 called by 1: main |
| 114 | func ce_maxabs(a: *i64) -> i64 called by 1: main |
| 127 | func ce_embed(vecs: *i64, slot: i64, pre: *u8, content: *u8) -> i64 |
| 144 | func ce_vp(vecs: *i64, slot: i64) -> *i64 called by 1: main |
| 149 | func main() -> i64 |