code wiki / _hdl_build / nx_paper_gen.nx

nx_paper_gen.nx

buildroot/runtime/_hdl_build/nx_paper_gen.nx

12648 B266 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind tooltopic paper
docsdependenciesstructsconstsfunctions

about

nx_paper_gen.nx -- the team PUBLISHES research papers on what improvements are improving what (RESEARCH-PAPER doctrine + COMPREHENSIBILITY law, operator 2026-06-11). X-RP-001. PLAIN LANGUAGE: a paper here is not prose someone typed -- it is COMPILED from the team's own ledgers, so a human researcher reads WHY a capability exists (lineage: genetics + epigenetics), WHAT improved (anchored gate/meter lines), and exactly where every number came from. If a named source line is MISSING the organ REFUSES to emit -- a paper can never contain an unledgered claim (ATTRIBUTION law: cite or it is an observation). conf row: P <id> <slug> <lineage-child> <log1> <anchor1> <log2> <anchor2> <log3> <anchor3> paper = claim (the lineage WHY) + genetics/mutations/epigenetics + the LAST line of each log holding its anchor + limitations + generated-by stamp output = <outdir>/<id>-<slug>.md (tmp + sys_renameat hot-swap: no torn reads) durable = PAPERGEN rows -> knowledge/status/paper_gen.log; exit 0 iff every conf paper EMITTED argv[1]=papers-conf argv[2]=lineage.tsv argv[3]=outdir (gates use scratch) license_tier: ORIGINAL

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_paper_gen.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_mmap pg_read sys_openat_rd sys_read sys_close sys_exit sys_openat_append pg_token pg_lineage_cols pg_len pg_last_line_with pg_slice_contains pg_len ↻ _fp sys_write ↻ pg_cat sys_openat_wr pg_emit_head _fp ↻ pg_sec _fp ↻ sys_write ↻ pg_sec ↻ pg_emit_tail _fp ↻ _fn sys_mmap ↻ sys_write ↻ sys_now_realtime_sec sys_mmap ↻ sys_clock_gettime_real sys_close ↻ sys_renameat _fn ↻ sys_now_realtime_sec ↻

structs

none

consts

16const K_MAGIC_65536: i64 = 65536
17const K_MAGIC_65520: i64 = 65520
18const K_MAGIC_262144: i64 = 262144
19const K_MAGIC_262128: i64 = 262128
20const K_MAGIC_16384: i64 = 16384
21const K_MAGIC_1048592: i64 = 1048592
22const K_MAGIC_786432: i64 = 786432
23const K_MAGIC_1048576: i64 = 1048576

functions

24func _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
25func _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 }
26func _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 2: pg_emit_tailmain calls 2: sys_mmapsys_write
27func pg_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
28func pg_cat(dst: *u8, off: i64, s: *u8) -> i64 { var i: i64 = 0; while s[i] != (0 as u8) { dst[off+i] = s[i]; i = i + 1 } return off + i }
called by 1: main
29func pg_read(path: *u8, buf: *u8, cap: i64) -> i64
called by 1: main calls 3: sys_openat_rdsys_readsys_close
38func pg_slice_contains(hay: *u8, a: i64, b: i64, pat: *u8) -> i64
called by 1: pg_last_line_with calls 1: pg_len
51func pg_last_line_with(hay: *u8, n: i64, pat: *u8, out: *i64) -> i64
called by 1: main calls 1: pg_slice_contains
66func pg_token(conf: *u8, pos: i64, le: i64, pool: *u8, poff: *i64) -> i64
called by 1: main
77func pg_lineage_cols(lin: *u8, ln: i64, child: *u8, cols: *i64) -> i64
called by 1: main calls 1: pg_len
109func pg_sec(fd: i64, label: *u8, buf: *u8, a: i64, b: i64) -> i64
called by 2: pg_emit_headmain calls 2: _fpsys_write
119func pg_emit_head(fd: i64, id: *u8, slug: *u8, child: *u8, lin: *u8, cols: *i64) -> i64
called by 1: main calls 2: _fppg_sec
136func pg_emit_tail(fd: i64) -> i64
called by 1: main calls 3: _fp_fnsys_now_realtime_sec
146func main(argc: i64, argv: *i64) -> i64