code wiki / (root) / nx_incumbent_gate.nx

nx_incumbent_gate.nx

buildroot/runtime/nx_incumbent_gate.nx

18426 B269 linesdepth 3pulls 5 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_incumbent_gate.nx -- GATE for the incumbents ruler (nx_incumbent_lib, engineshift ES28), driven IN-PROCESS on a planted fixture tree under /tmp: thirteen fake organs (a dense-judge twin naming a knowledge/ asset and carrying a rejection line, a cross-encoder twin, a voxel organ, nine fillers, one whose header overruns the read window) and two fake assets. Proves: the index envelope (files, assets, truncation counted, corpus_complete), a rerank contract names both rerank twins and neither the voxel organ nor the excluded organ, the asset named in a matched header is listed, the rejection line is listed, a voxel contract names the voxel organ alone, a nonsense contract prints NONE with its terms, a contract made only of words every header carries is dropped as non-discriminating, the index states (FRESH, STALE by age, ABSENT, MALFORMED), and THE DECLARED ACCEPT RULE on the live tree: the search board's R0 contract, answered from a live index built into /tmp, names nx_dr_densejudge, embed_v1.bin and the DR-13 rejection with no seat input. Every fixture asserts its own condition first. license_tier: ORIGINAL Writes only under /tmp/nx_incumbent_gate. No hw writes (Rule 26).

dependencies 4 imports · 0 importers

nx_syscalls.nx nx_gatekit_lib.nx nx_incumbent_lib.nx nx_gate_verdict.nx nx_incumbent_gate.nx

imports: nx_syscalls.nxnx_gatekit_lib.nxnx_incumbent_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_head 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 ↻ inc_conf_load sys_mmap ↻ sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_munmap sys_close inc_lend inc_conf_take inc_kv_int inc_slen inc_atoi inc_is_digit gk_mkdir sys_mkdir gk_write sys_openat_wr gk_len

structs

none

consts

17const G_ROOT: *u8 = "/tmp/nx_incumbent_gate"
18const G_RA: *u8 = "/tmp/nx_incumbent_gate/ra"
19const G_RB: *u8 = "/tmp/nx_incumbent_gate/rb"
20const G_IDXDIR: *u8 = "/tmp/nx_incumbent_gate/idx"
21const G_INDEX: *u8 = "/tmp/nx_incumbent_gate/incumbent_index.txt"
22const G_LIVE_INDEX: *u8 = "/tmp/nx_incumbent_gate/live_index.txt"
23const G_JUNK: *u8 = "/tmp/nx_incumbent_gate/junk.txt"
24const G_ABSENT: *u8 = "/tmp/nx_incumbent_gate/absent.txt"
25const G_DENSE: *u8 = "/tmp/nx_incumbent_gate/ra/nx_fake_densejudge.nx"
26const G_CROSS: *u8 = "/tmp/nx_incumbent_gate/rb/nx_fake_crossenc.nx"
27const G_VOXEL: *u8 = "/tmp/nx_incumbent_gate/ra/nx_fake_voxel.nx"
28const G_LONG: *u8 = "/tmp/nx_incumbent_gate/rb/nx_fake_longhead.nx"
29const G_ASSET1: *u8 = "/tmp/nx_incumbent_gate/idx/fake_embed_v1.bin"
30const G_ASSET2: *u8 = "/tmp/nx_incumbent_gate/idx/unrelated.tsv"
31const G_DENSE_SRC: *u8 = "// nx_fake_densejudge.nx -- TRAINED DENSE representation for the reranker judge (a sovereign fixture twin of DR-13).\n// Three measured rejections localised the ceiling to the features themselves: learned fusion over PPMI does not transfer.\n// This uses the trained dense embeddings (knowledge/index/fake_embed_v1.bin) produced by the trainer.\nimport \"nx_syscalls.nx\"\nfunc dj_fake_maxsim() -> i64 { return 0 }\n"
32const G_CROSS_SRC: *u8 = "// nx_fake_crossenc.nx -- cross-encoder rerank over the top candidates, a sovereign fixture.\n// A rerank arm that must beat the BM25 arm before it is wired.\nimport \"nx_syscalls.nx\"\nfunc ce_fake_score() -> i64 { return 0 }\n"
33const G_VOXEL_SRC: *u8 = "// nx_fake_voxel.nx -- voxel exterior flood fill with a pad, a sovereign fixture.\n// The flood seeds from the pad and the exterior cells are counted.\nimport \"nx_syscalls.nx\"\nfunc vx_fake_flood() -> i64 { return 0 }\n"
34const G_FILLER_HEAD: *u8 = "// nx_fake_f"
35const G_FILLER_MID: *u8 = ".nx -- sovereign fixture organ about "
36const G_FILLER_TAIL: *u8 = ".\nimport \"nx_syscalls.nx\"\nfunc fk_noop() -> i64 { return 0 }\n"
37const G_LONG_LINE: *u8 = "// sovereign fixture filler line with granite words to overrun the header window of the reader\n"
38const G_LONG_LINES: i64 = 220
39const G_FILLERS: i64 = 9
40const G_FIXTURE_FILES: i64 = 14 // dense twin, cross twin, voxel, prose-only, nine fillers, one long header
41const G_PROSE: *u8 = "/tmp/nx_incumbent_gate/rb/nx_fake_prose.nx"
42const G_PROSE_SRC: *u8 = "// nx_fake_prose.nx -- notes on the reranker, dense and trained, over the years, a sovereign fixture.\n// It matches exactly the bag words the dense twin matches and carries none of them in its name.\nimport \"nx_syscalls.nx\"\nfunc pr_fake_notes() -> i64 { return 0 }\n"
43const G_FIXTURE_ASSETS: i64 = 2
44const G_OUT_CAP: i64 = 16384
45const G_I64: i64 = 8
46const G_LIVE_PLAN_A: *u8 = "buildroot/knowledge/compare/search.plan"
47const G_LIVE_PLAN_B: *u8 = "knowledge/compare/search.plan"
48const G_LIVE_RUNG: *u8 = "rung|R0|"
49const G_LIVE_EXCL: *u8 = "nx_neural_reranker"
50const G_LIVE_WANT_ORGAN: *u8 = "nx_dr_densejudge"
51const G_LIVE_WANT_ASSET: *u8 = "embed_v1.bin"
52const G_LIVE_WANT_REJ: *u8 = "rejections"
53const G_LIVE_MIN_FILES: i64 = 1000
54const G_R0_TITLE: *u8 = "Neural rerank that beats BM25"
55const G_R0_SYM: *u8 = "nr_rerank"
56const G_R0_NOTE: *u8 = "A trained cross-encoder or dense reranker over the top-k"
57const G_VX_TITLE: *u8 = "Voxel exterior flood"
58const G_NONSENSE: *u8 = "Zzzq qqxx wwvv"
59const G_COMMON: *u8 = "sovereign fixture"

functions

61func g_topic(k: i64) -> *u8
72func g_has(hay: *u8, needle: *u8) -> i64 { return inc_contains(hay, inc_slen(hay), needle) }
74func g_result_has(g: *i64, r: *i64, name: *u8) -> i64
82func g_field(line: *u8, k: i64, dst: *u8, cap: i64) -> i64
99func main() -> i64