code wiki / (root) / nx_reasoning_gate.nx

nx_reasoning_gate.nx

buildroot/runtime/nx_reasoning_gate.nx

10368 B264 linesdepth 14pulls 62 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_reasoning_gate.nx -- MEASURED gate for sovereign TEST-TIME COMPUTE (self-consistency, Wang 2023) on the REAL model (Qwen2.5-0.5B-Instruct, v4-lazy forward, ChatML path). controls pure: extractor (first/last/none), majority, tie, sentinel liveness greedy is deterministic (Q0 twice -> byte-identical) MEASURE 8 arithmetic questions x { greedy, self-consistency@5 (T=0.8, top-k=40, prime-spaced seeds) } -> accuracy tally The verdict reports whichever way the measurement lands (LIFT / TIE / HURT) -- the gate PASSES (exit 0) when the harness ran mechanically clean; accuracy is REPORTED, not gamed. license_tier: ORIGINAL expect_exit: 0

dependencies 22 imports · 0 importers

nx_syscalls.nx nx_tier.nx nx_le.nx nx_bpe.nx nx_gguf.nx nx_gguf_load.nx nx_gguf_meta.nx nx_f32.nx nx_f32_kv_cache.nx nx_f32_lazy_weight.nx nx_reasoning_gate.nx

diagram shows first 10 each side; +12 more imports, +0 more importers in the complete lists below.

imports: nx_syscalls.nxnx_tier.nxnx_le.nxnx_bpe.nxnx_gguf.nxnx_gguf_load.nxnx_gguf_meta.nxnx_f32.nxnx_f32_kv_cache.nxnx_f32_lazy_weight.nxnx_f32_llama_block.nxnx_f32_llama_block_v4.nxnx_f32_llama_stack_v4.nxnx_f32_llama_layer_lazy_load.nxnx_f32_llm.nxnx_f32_llm_v4.nxnx_f32_llm_read_dims.nxnx_f32_bpe_load.nxnx_f32_llm_special_tokens.nxnx_f32_sampler.nxnx_prng.nxnx_reasoning.nx

imported by: nobody (leaf or entry point)

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

main rg_atoi nx_reason_extract_last_int nx_reason_extract_int sys_mmap nx_reason_majority rg_w sys_write sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close nx_gguf_parse nx_le_read_u32 nx_le_read_u64 nx_le_read_u32 ↻ _gguf_skip_value nx_le_read_u64 ↻ nx_le_read_u32 ↻ _gguf_skip_value ↻ sys_mmap ↻ nx_f32_llama_model_alloc sys_mmap ↻ nx_f32_llm_read_dims_from_ sys_mmap ↻ nx_gguf_meta_find nx_le_read_u64 ↻ nx_le_read_u32 ↻ _gmeta_bytes_equal nx_gguf_skip_value _gguf_skip_value ↻ nx_gguf_meta_read_string_l nx_le_read_u64 ↻ nx_gguf_meta_read_string_p _fld_read_arch_u32 sys_mmap ↻ _fld_concat_key nx_gguf_meta_find ↻

structs

none

consts

38const RG_M: nx_int = 8 // questions
39const RG_N: nx_int = 5 // self-consistency samples per question

functions

41func rg_w(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: rg_wnmain calls 1: sys_write
42func rg_wn(v: i64) -> i64
called by 1: main calls 3: rg_wsys_mmapsys_write
55func rg_wtext(b: *u8, n: i64) -> i64
68func rg_bytes_eq(a: *u8, b: *u8, n: i64) -> i64
called by 1: main
74func rg_atoi(s: *u8) -> i64
called by 1: main
92func main(argc: i64, argv: *i64) -> i64