code wiki / _hdl_build / nx_dr_semjudge.nx
nx_dr_semjudge.nx
buildroot/runtime/_hdl_build/nx_dr_semjudge.nx
about
nx_dr_semjudge.nx -- SEMANTIC judge tier for the deep-research engine (DR-10).
The engine's judge was the LEXICAL tier: token containment, so an insight saying "won"
scored ZERO against a source saying "defeated". This escalates that socket to SEMANTIC
matching over a real PPMI count model: coverage(insight,doc) = mean over insight terms of
MAX PPMI cosine against any doc term -- ColBERT-class integer late-interaction, zero float.
★seq283 EATEN (this half): the loader/cosine numerics are NO LONGER duplicated here. They
live once in nx_ppmi_lib.nx and this file is a thin ADAPTER preserving the sj_* API its gate
and CLI already use. Two hand-rolled copies of the same numeric code could silently diverge
and change similarity scores with no gate noticing -- that risk is gone for this organ.
(nx_recall_dense still holds its own pb_* copy; it is a LIVE organ owned by the recall lane
and migrates on its owner's next touch, per the D001 migrate-on-touch law.)
⚠INTEGRATION LAW: the PPMI vocab is keyed by db_semhash (nx_qabench_engine), NOT the djb2
lexical hash -- the wrong hash silently returns -1 for every word and zeroes every
similarity. nx_ppmi_lib owns the lowercase-then-db_semhash resolution.
⚠HONEST CEILING: a count model is bounded by its corpus vocabulary; out-of-vocabulary terms
score 0. Use nx_dr_semjudge_x to A/B an alternative model against that ceiling.
module: nishi-core.research.dr_semjudge
depends: nx_ppmi_lib.nx
genealogy_id: levy_goldberg_2014_ppmi + colbert_late_interaction
dependencies 1 imports · 3 importers
imports: nx_ppmi_lib.nx
imported by: nx_dr_semcorpus.nxnx_dr_semjudge_cli.nxnx_dr_semjudge_gate.nx
structs
| none |
consts
| none |
functions
| 25 | func sj_isqrt(v: i64) -> i64 { return ppl_isqrt(v) } calls 1: ppl_isqrt |
| 28 | func sj_load(g: *i64) -> i64 { return ppl_load(g, "knowledge/index/semppmi_v1.bin" as *u8) } |
| 31 | func sj_cos(g: *i64, a: i64, b: i64) -> i64 { return ppl_cos(g, a, b) } calls 1: ppl_cos |
| 34 | func sj_dcos(g: *i64, a: i64, b: i64) -> i64 { return ppl_dcos(g, a, b) } |
| 37 | func sj_wid_range(g: *i64, buf: *u8, start: i64, end: i64) -> i64 { return ppl_wid_range(g, buf, start, end) } calls 1: ppl_wid_range |
| 40 | func sj_tokenize_ids(g: *i64, buf: *u8, len: i64, out: *i64, maxn: i64) -> i64 |
| 45 | func sj_maxsim(g: *i64, ins: *i64, ni: i64, doc: *i64, nd: i64) -> i64 |