code wiki / _hdl_build / nx_dr_densejudge.nx

nx_dr_densejudge.nx

buildroot/runtime/_hdl_build/nx_dr_densejudge.nx

6878 B201 linesdepth 5pulls 6 transitivereach 2 importersview sourcekind librarytopic dr
docsdependenciesstructsconstsfunctions

about

nx_dr_densejudge.nx -- TRAINED DENSE representation for the judge (DR-13). Three measured rejections (§10 vocabulary, §12 term weighting, §14 learned fusion) localised the ceiling to the FEATURES themselves: sparse PPMI co-occurrence carries only ~65% pairwise signal on insight-vs-distractor, so no amount of reweighting or fusing fixes it. The remaining move is a DIFFERENT REPRESENTATION. This uses the ecosystem's TRAINED dense embeddings (knowledge/index/embed_v1.bin, Q10, nv x DIM), produced by nx_embed_train factorising the PPMI matrix (Levy & Goldberg 2014: factorising PPMI == word2vec/SGNS). On the known-hard pair the trained dense vectors ordered far more confidently than raw counts (607 vs 559, where sparse counts gave 86 vs 25), which is exactly the kind of representational change the diagnosis calls for. Vocabulary: embed_v1.bin rows are indexed by the SAME ids as semppmi_v1.bin (the trainer read that vocab), so word resolution still goes through nx_ppmi_lib -- BOTH models are loaded. on-disk: 24B header [magic "NXEMB1", i64 nv, i64 DIM] then nv*DIM Q10 i64 (block-padded tail is ignored -- we read exactly nv*DIM). Every func <=6 params (NAS nx_cc >6-arg skew, seq239). No hardware writes (Rule 26). module: nishi-core.research.dr_densejudge depends: nx_ppmi_lib.nx genealogy_id: levy_goldberg_2014_sgns + colbert_late_interaction

dependencies 1 imports · 2 importers

nx_ppmi_lib.nx nx_dr_densejudge.nx nx_dr_densejudge_cli.nx nx_lawsearch.nx

imports: nx_ppmi_lib.nx

imported by: nx_dr_densejudge_cli.nxnx_lawsearch.nx

structs

none

consts

23const K_MAGIC_536870912: i64 = 536870912
24const K_MAGIC_4096: i64 = 4096
25const K_MAGIC_262144: i64 = 262144

functions

28func dj_load_embed(g: *i64, path: *u8) -> i64
called by 2: mainmain calls 1: sys_read
69func dj_cos(g: *i64, a: i64, b: i64) -> i64
called by 1: dj_maxsim calls 1: ppl_isqrt
108func dj_build_mean(g: *i64) -> i64
called by 2: mainmain
130func dj_cos_centered(g: *i64, a: i64, b: i64) -> i64
called by 1: dj_maxsim_centered calls 1: ppl_isqrt
166func dj_maxsim_centered(g: *i64, a: *i64, na: i64, b: *i64, nb: i64) -> i64
called by 2: mainmain calls 1: dj_cos_centered
185func dj_maxsim(g: *i64, a: *i64, na: i64, b: *i64, nb: i64) -> i64
called by 1: main calls 1: dj_cos