code wiki / _hdl_build / nx_emitter_transduce.nx

nx_emitter_transduce.nx

buildroot/runtime/_hdl_build/nx_emitter_transduce.nx

5920 B101 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_emitter_transduce.nx -- X-AUT-006 v0 PROBE: validate that reference->emitter is MECHANICAL (the operator Level-2 question: get the BUILDER to author its own emitters). I hand-transcribed gd_gamma into pe6_author_gamma; this proves that transcription is a mechanical string transform, not a creative act. v0 = line-faithful transducer: read a reference .nx, emit a template that RE-EMITS it via pe_w (quote/backslash escaped). When the emitted template runs, its output must BYTE-MATCH the reference (round-trip = the mechanism is sound). v1 (next) lifts numeric literals to c[] refs. in: reference source path + out template path + out marker for round-trip the emitted template is itself a runnable .nx whose main() writes the reproduction. Durable: TRANSDUCE row -> knowledge/status/transduce.log. Exit 0 = round-trip exact. argv[1]=reference argv[2]=template-out argv[3]=reproduction-out. license_tier: ORIGINAL

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_emitter_transduce.nx

imports: nx_syscalls.nx

imported by: nobody (leaf or entry point)

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

main _p sys_write sys_exit sys_mmap tr_read sys_openat_rd sys_read sys_close sys_openat_wr _fp sys_write ↻ tr_esc sys_mmap ↻ sys_write ↻ sys_close ↻ sys_write ↻ sys_openat_append _fn sys_mmap ↻ sys_write ↻ sys_now_realtime_sec sys_mmap ↻ sys_clock_gettime_real

structs

none

consts

13const K_MAGIC_2097152: i64 = 2097152
14const K_MAGIC_2097136: i64 = 2097136
15const K_MAGIC_4194304: i64 = 4194304
16const K_MAGIC_4194288: i64 = 4194288

functions

17func _p(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
18func _fp(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 }
called by 1: main calls 1: sys_write
19func _fn(fd: i64, v: i64) -> i64 { let bb: *u8=sys_mmap(28); var m: i64=v; if m<0{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{bb[i]=t[k-1-i];i=i+1}; sys_write(fd,bb,k); return 0 }
called by 1: main calls 2: sys_mmapsys_write
20func tr_read(path: *u8, buf: *u8, cap: i64) -> i64
called by 1: main calls 3: sys_openat_rdsys_readsys_close
30func tr_esc(fd: i64, c: i64) -> i64
called by 1: main calls 2: sys_mmapsys_write
39func main(argc: i64, argv: *i64) -> i64