code wiki / _hdl_build / nx_pattern_emit_rankfuse.nx

nx_pattern_emit_rankfuse.nx

buildroot/runtime/_hdl_build/nx_pattern_emit_rankfuse.nx

4120 B62 linesdepth 2pulls 2 transitivereach 1 importersview sourcekind librarytopic pattern
docsdependenciesstructsconstsfunctions

about

nx_pattern_emit_rankfuse.nx -- PATTERN EMITTER: RANK_FUSE (shape 21). Authors a K-way RRF FUSION core that composes the TEAM-OWNED nx_rrf (Cormack-Clarke-Buettcher 2009) over K source-rankings -> one fused top item. This is the researcher's internal+external fusion shape (the first of the session's 5-emitter autonomy backlog), now TEAM-AUTHORABLE hands-off: the Builder runs this emitter on a DATA spec and gets a working module + test, with NO Claude logic in the core (author=emitter). Composing an already-green team organ is exactly the LOG_SCAN/ PERMIL_VERDICT (emit14) precedent. spec[0]=k (2..8 rankings to fuse) spec[1]=n (>0 items) Authored fn (K rrf_add calls BAKED, rule 22 -- no runtime loop over rankings): <name>_fuse(orders: *i64, scores: *i64) -> i64 (orders = K rankings flat, ranking r at orders[r*n]; returns fused argmax) EMIT-TIME RAILS: k outside 2..8 or n<1 -> spec REFUSED, nothing written. license_tier: ORIGINAL

dependencies 1 imports · 1 importers

nx_syscalls.nx nx_pattern_emit_rankfuse.nx nx_pattern_emit_rankfuse_demo.nx

imports: nx_syscalls.nx

imported by: nx_pattern_emit_rankfuse_demo.nx

structs

none

consts

none

functions

13func prf_w(fd: i64, s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(fd, s, n); return 0 }
14func prf_wn(fd: i64, v: i64) -> i64 { let bb: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m; sys_write(fd,"-" as *u8,1)} 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{bb[i]=t[k-1-i];i=i+1} sys_write(fd,bb,k); return 0 }
17func prf_spec_ok(spec: *i64) -> i64
called by 1: pe_rankfuse_author
26func pe_rankfuse_emit_core(fd: i64, name: *u8, spec: *i64) -> i64
called by 1: pe_rankfuse_author calls 2: prf_wprf_wn
42func pe_rankfuse_emit_test(fd: i64, name: *u8, spec: *i64) -> i64
55func pe_rankfuse_author(name: *u8, modpath: *u8, testpath: *u8, spec: *i64) -> i64