code wiki / _hdl_build / nx_pattern_emit_rankfuse_demo.nx

nx_pattern_emit_rankfuse_demo.nx

buildroot/runtime/_hdl_build/nx_pattern_emit_rankfuse_demo.nx

5040 B68 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind sketch/demotopic pattern
docsdependenciesstructsconstsfunctions

about

nx_pattern_emit_rankfuse_demo.nx -- DEMO/GATE: the Builder runs the RANK_FUSE emitter on a DATA spec and the emitter AUTHORS a working module + test (no Claude logic). Proves shape 21 is now team-authorable: T1 author succeeds for a valid spec (k=3,n=5) and REFUSES a bad spec (k=1) -- the emit-time rail. T2 the AUTHORED module is real RRF code: it contains exactly k=3 'nx_rrf_add' calls + an 'nx_rrf_argmax' + the _fuse fn. T3 determinism: authoring the same spec twice -> byte-identical module. (The authored module rf_authored.nx + its test are written to runtime/_hdl_build/; building rf_authored_test via the runner then proves it COMPILES + PASSES = the autonomy credit, end to end.) expect_exit: 0 license_tier: ORIGINAL

dependencies 2 imports · 0 importers

nx_pattern_emit_rankfuse.nx nx_syscalls.nx nx_pattern_emit_rankfuse_demo.

imports: nx_pattern_emit_rankfuse.nxnx_syscalls.nx

imported by: nobody (leaf or entry point)

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

main dw sys_write sys_mmap pe_rankfuse_author prf_spec_ok sys_openat_wr pe_rankfuse_emit_core prf_w sys_write ↻ prf_wn sys_mmap ↻ sys_write ↻ sys_close pe_rankfuse_emit_test prf_w ↻ prf_wn ↻ dn sys_mmap ↻ sys_write ↻ read_all sys_openat_rd sys_mmap ↻ sys_read sys_close ↻ count_sub sys_exit

structs

none

consts

11const K_MAGIC_65536: i64 = 65536
12const K_MAGIC_16384: i64 = 16384

functions

14func dw(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 1: main calls 1: sys_write
15func dn(v: i64) -> i64 { let b: *u8=sys_mmap(28); var m: i64=v; if m<0{sys_write(1,"-" as *u8,1);m=0-m} let t: *u8=sys_mmap(28); var k: i64=0; if m==0{t[0]=48 as u8;k=1} while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1} var i: i64=0; while i<k{b[i]=t[k-1-i];i=i+1} sys_write(1,b,k); return 0 }
called by 1: main calls 2: sys_mmapsys_write
17func read_all(path: *u8, lenbox: *i64) -> i64
23func count_sub(hay: *u8, hlen: i64, needle: *u8, nlen: i64) -> i64
called by 1: main
29func main() -> i64