code wiki / _hdl_build / nx_dr_semjudge_cli.nx

nx_dr_semjudge_cli.nx

buildroot/runtime/_hdl_build/nx_dr_semjudge_cli.nx

4425 B77 linesdepth 6pulls 9 transitivereach 0 importersview sourcekind tooltopic dr
docsdependenciesstructsconstsfunctions

about

nx_dr_semjudge_cli.nx -- judge insights against a document BOTH ways, side by side (DR-10). Shows exactly where the semantic tier beats the lexical one: for every insight it reports the lexical containment score, the PPMI semantic maxsim score, and whether lexical MISSED a match the semantic judge found (lexical 0, semantic > 0). Useful for calibrating the judge threshold and for auditing why a source was or was not credited. nx_dr_semjudge <document_text> <insight_1> [insight_2 ...] e.g. nx_dr_semjudge "the team defeated their rivals" "won" -> {"insights":[{"lexical_permil":0,"semantic_permil":86,"lexical_missed":1}]} ⚠The PPMI model is a count model over QA-benchmark prose; specialist terms are OOV and score 0. Honest tiering: this is not a neural cross-encoder. license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0

dependencies 5 imports · 0 importers

nx_dr_semjudge.nx nx_itoa_lib.nx nx_dr_run.nx nx_dr_verify.nx nx_syscalls.nx nx_dr_semjudge_cli.nx

imports: nx_dr_semjudge.nxnx_itoa_lib.nxnx_dr_run.nxnx_dr_verify.nxnx_syscalls.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main sg_puts sys_write sg_key sg_q sys_mmap sys_write ↻ sg_puts ↻ sg_q ↻ sys_exit sys_mmap ↻ sj_load ppl_load sys_openat_rd sys_mmap ↻ sys_read sys_close drr_strlen drr_tokenize drr_hash sj_tokenize_ids ppl_tokenize_ids ppl_wid_range sys_mmap ↻ db_bsearch_i64 db_semhash sg_num nxi_out nxi_fd sys_mmap ↻ ccz_cat_num sys_write ↻ sys_munmap dv_entail dv_contains sj_maxsim ppl_maxsim ppl_dcos ppl_cos ppl_isqrt

structs

none

consts

17const K_MAGIC_16384: i64 = 16384
18const K_MAGIC_1024: i64 = 1024

functions

20func sg_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 }
called by 2: sg_keymain calls 1: sys_write
21func sg_q() -> i64 { let b: *u8 = sys_mmap(1); b[0] = 34 as u8; sys_write(1, b, 1); return 0 }
called by 2: sg_keymain calls 2: sys_mmapsys_write
22func sg_key(name: *u8) -> i64 { sg_q(); sg_puts(name); sg_q(); sg_puts(":" as *u8); return 0 }
called by 1: main calls 2: sg_qsg_puts
27func sg_num(v: i64) -> i64 { nxi_out(v); return 0 }
called by 1: main calls 1: nxi_out
29func main(argc: i64, argv: *i64) -> i64