code wiki / _hdl_build / nx_vec_embed.nx

nx_vec_embed.nx

buildroot/runtime/_hdl_build/nx_vec_embed.nx

2122 B40 linesdepth 2pulls 2 transitivereach 2 importersview sourcekind librarytopic vec
docsdependenciesstructsconstsfunctions

about

nx_vec_embed.nx -- R-VEC-1 of the onsite-search S-class ladder: SOVEREIGN text->vector embeddings (LIBRARY), the CLASSICAL (count-based distributional) kind -- "methods to generate this mapping include neural networks" (cited srch_embedding.raw); this is the pre-neural, fully-sovereign, no-external-weights path (ladder option A). Principle (distributional semantics, cited srch_word2vec.raw): words in SIMILAR CONTEXTS get SIMILAR vectors. Realized with zero ML training instability: a term x term co-occurrence matrix from the corpus; each term's vector is its co-occurrence row; a query/doc is the bag-sum of its term vectors; relatedness = cosine (R-VEC-0 kernel). KAT lives in nx_vec_embed_gate.nx (library+gate split, matching nx_vec_kernel/nx_vec_fuse). HONEST: count-based, NOT neural understanding -- the neural cross-encoder stays census-BEHIND (R-VEC-6). Production scale = fill the matrix from the real manifest + reduce dims (R-VEC-4 quantization) -- wiring, not math. exports: vr_embed (term->vec), ve_docvec (bag->vec), ve_build_co. license_tier: ORIGINAL

dependencies 1 imports · 2 importers

nx_syscalls.nx nx_vec_embed.nx nx_vec_embed_gate.nx nx_vec_hybrid_gate.nx

imports: nx_syscalls.nx

imported by: nx_vec_embed_gate.nxnx_vec_hybrid_gate.nx

structs

none

consts

15const VE_V: i64 = 17 // controlled-corpus vocab size (gate); production reads vocab from the index

functions

18func ve_build_co(M: *i64, sent: *i64, L: i64) -> i64
called by 2: mainmain
32func vr_embed(M: *i64, t: i64) -> *i64 { return ((M as i64) + t*VE_V*8) as *i64 }
called by 3: ve_docvecmainmain
35func ve_docvec(M: *i64, terms: *i64, nt: i64, out: *i64) -> i64
called by 2: mainmain calls 1: vr_embed