code wiki / (root) / nx_batched_gate.nx

nx_batched_gate.nx

buildroot/runtime/nx_batched_gate.nx

11217 B288 linesdepth 15pulls 66 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_batched_gate.nx -- MEASURED gate for BATCHED MULTI-SEQUENCE decode (nx_f32_llama_v4b) on the REAL model. EQUIV batched decode == sequential fork decode BIT-IDENTICAL: prefill once, fork N=3 twice (same seeds); decode one set sequentially (v4p, m=1 per fork) and one set BATCHED (v4b, one M-row forward per round); texts must match byte-for-byte SPEED decode phases timed separately from the shared prefill: sequential N*T m=1 forwards vs T M-row forwards HYGIENE pool returns to all-free license_tier: ORIGINAL expect_exit: 0

dependencies 26 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_batched_gate.nx

diagram shows first 10 each side; +16 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.nxnx_kvcache.nxnx_f32_attn_paged.nxnx_f32_llama_v4p.nxnx_f32_llama_v4b.nx

imported by: nobody (leaf or entry point)

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

main sys_mmap 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 ↻ nx_gguf_meta_read_u32 nx_le_read_u32 ↻ _fld_read_vocab_size_from_ sys_mmap ↻ nx_gguf_find_tensor nx_gguf_tensor_at

structs

none

consts

41const BG_N: nx_int = 3
42const BG_MAXNEW: nx_int = 8

functions

44func bg_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: bg_wnmain calls 1: sys_write
45func bg_wn(v: i64) -> i64
called by 1: main calls 3: bg_wsys_mmapsys_write
58func bg_beq(a: *u8, b: *u8, n: i64) -> i64
called by 1: main
63func bg_stop(rc: *NxReasonCfg, t: nx_int) -> nx_int
called by 1: main
69func bg_emit(rc: *NxReasonCfg, t: nx_int, buf: *u8, len: *i64, one: *i64, db: *u8) -> i64
called by 1: main calls 1: nx_bpe_decode_bytelevel
82func main() -> i64