code wiki / _hdl_build / nx_ltr_lib_gate.nx

nx_ltr_lib_gate.nx

buildroot/runtime/_hdl_build/nx_ltr_lib_gate.nx

5683 B116 linesdepth 3pulls 4 transitivereach 0 importersview sourcekind gate/prooftopic ltr
docsdependenciesstructsconstsfunctions

about

nx_ltr_lib_gate.nx -- teeth for the learning-to-rank reranker (nx_ltr_lib.ltr_cv) on a synthetic fixture it builds itself (search rung R0, 2026-09-14). A SIGNAL fixture where one feature predicts the sparse relevant candidates -- the trained arm's 5-fold held-out nDCG must be high; a SHUFFLE neg-control where gold is decorrelated from every feature -- with 20 candidates and only 3 relevant a random ordering pushes them out of the top-10, so it must score LOW (the model may not hallucinate signal); determinism (integer, so the same fixture twice is the same number). No corpus, no fork. Declared in organ_gate.conf.

dependencies 2 imports · 0 importers

nx_ltr_lib.nx nx_gate_verdict.nx nx_ltr_lib_gate.nx

imports: nx_ltr_lib.nxnx_gate_verdict.nx

imported by: nobody (leaf or entry point)

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

main gv_puts sys_write gv_ctr sys_mmap nxa_die sys_write ↻ sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ gl_build gl_mod gl_noise gl_idcg ltr_disc ltr_cv sys_mmap ↻ ltr_norm ltr_train_ca sys_mmap ↻ ltr_ndcg_sel sys_mmap ↻ ltr_dot ltr_disc ↻ sys_munmap sys_munmap ↻ ltr_ndcg_sel ↻ sys_munmap ↻ gv_check gv_puts ↻ gv_values_head

structs

none

consts

12const GL_NQ: i64 = 20
13const GL_NC: i64 = 20 // 20 candidates, only 3 relevant -> a bad ordering loses them past nDCG@10
14const GL_BOX: i64 = 8

functions

17func gl_noise(q: i64, c: i64, k: i64) -> i64
called by 1: gl_build
24func gl_idcg(gold: *i64, base: i64, nc: i64) -> i64
called by 1: gl_build calls 1: ltr_disc
44func gl_mod(a: i64, m: i64) -> i64 { return a - (a / m) * m }
called by 1: gl_build
49func gl_build(feat: *i64, gold: *i64, ncand: *i64, idcg: *i64, fold: *i64, mode: i64) -> i64
called by 1: main calls 3: gl_modgl_noisegl_idcg
86func main() -> i64