code wiki / (root) / nx_forge_bestof.nx

nx_forge_bestof.nx

buildroot/runtime/nx_forge_bestof.nx

9756 B269 linesdepth 10pulls 30 transitivereach 0 importersview sourcekind tooltopic forge
docsdependenciesstructsconstsfunctions

about

nx_forge_bestof.nx -- BEST-OF-N sampling on fbench T1 with the 1.5B coder + mini-pack (quality lever #2, 2026-07-15). Greedy 1.5B+minipack COMPILES+RUNS but misses bytes (semantic near-miss); temperature sampling explores variants and the byte-exact judge (fg_run) picks any GREEN -- soundness by judging, diversity by sampling. PREFIX-CACHE makes this affordable: sample 1 prefills the ~1350-tok prompt ONCE (snapshot), every further sample re-prefills only the clamped last token (identical prompt) + generates. Early-exit on GREEN. Appends an organ-authored living record (localpass=) to the codegen bench ledger. license_tier: ORIGINAL expect_exit: 0 (measurement organ; the count is the deliverable)

dependencies 2 imports · 0 importers

nx_nofloat_serve_core.nx nx_forge.nx nx_forge_bestof.nx

imports: nx_nofloat_serve_core.nxnx_forge.nx

imported by: nobody (leaf or entry point)

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

main std_puts std_slen sys_write std_pdec 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 ↻ std_itoa sys_mmap ↻ sys_write ↻ bo_read_pack std_putln std_puts ↻ bo_cat nsv_init_i8 nsv_init sys_now_ms sys_mmap ↻ sys_clock_gettime_mono nsv_log sys_write ↻ nf_pool nx_pool_new nx_hw_worker_count nx_hw_cpu_count sys_mmap ↻ nx_chan_new

structs

none

consts

10const K_MAGIC_32768: i64 = 32768
11const K_MAGIC_16384: i64 = 16384
12const K_MAGIC_30000: i64 = 30000
13const K_MAGIC_65536: i64 = 65536

functions

16func bo_read_pack(buf: *u8, cap: i64) -> i64
called by 1: main
35func bo_cat(buf: *u8, o: i64, s: *u8) -> i64
called by 1: main
44func bo_strip(src: *u8, n: i64, out: *u8) -> i64
called by 1: main
89func bo_write(path: *u8, buf: *u8, n: i64) -> i64
called by 1: main
107func main(argc: i64, argv: *i64) -> i64