code wiki / _hdl_build / nx_intlog_gate.nx

nx_intlog_gate.nx

buildroot/runtime/_hdl_build/nx_intlog_gate.nx

7622 B125 linesdepth 3pulls 4 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_intlog_gate.nx -- KAT gate for the integer log2 / IDF / tf-saturation primitives (the BM25 rung's math floor) and the S1 crossover side. Exact on powers of two, tight (+-2/1024) between them, monotonic, overflow-safe at the top of the domain, the derived idf/tfsat behaviors the ranking depends on, and the corpus-scale side decision with its planted-other-side control. MIGRATED onto nx_gate_verdict 2026-09-14: /api/promote refused the hand-rolled verdict (D001) because nothing outside the gate could read it. license_tier: ORIGINAL expect_exit: 0

dependencies 2 imports · 0 importers

nx_intlog.nx nx_gate_verdict.nx nx_intlog_gate.nx

imports: nx_intlog.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 ↻ ilog2_1024 gv_check gv_puts ↻ idf_q10 ilog2_1024 ↻ tfsat_q10 tfnorm_q10 cs_crossover gv_check_eq gv_check ↻ gv_puts ↻ gv_num sys_mmap ↻ sys_write ↻ sys_munmap qtfsat_q10 idf_bm25q qtfsat_q10 ↻ gv_values_head gv_puts ↻ gv_kv

structs

none

consts

10const GI_CROSSOVER_TOKENS: i64 = 10000000 // the published crossover the conf carries, planted here as the threshold
11const GI_ONE_UNDER: i64 = 9999999 // one token under the crossover reads BELOW
12const GI_WEB_TOKENS: i64 = 376066000 // a web-sized corpus, far above
13const GI_TWICE: i64 = 20000000 // twice the crossover, the planted other side
14const GI_ONE_TOKEN: i64 = 1 // a one-token corpus, the planted BELOW
15const GI_UNMEASURED: i64 = 0 // an unmeasured corpus or threshold

functions

17func main() -> i64