code wiki / _hdl_build / nx_paper_gen.nx
nx_paper_gen.nx
buildroot/runtime/_hdl_build/nx_paper_gen.nx
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
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
structs
| none |
consts
| 16 | const K_MAGIC_65536: i64 = 65536 |
| 17 | const K_MAGIC_65520: i64 = 65520 |
| 18 | const K_MAGIC_262144: i64 = 262144 |
| 19 | const K_MAGIC_262128: i64 = 262128 |
| 20 | const K_MAGIC_16384: i64 = 16384 |
| 21 | const K_MAGIC_1048592: i64 = 1048592 |
| 22 | const K_MAGIC_786432: i64 = 786432 |
| 23 | const K_MAGIC_1048576: i64 = 1048576 |
functions
| 24 | func _p(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 25 | func _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 } |
| 26 | func _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 } |
| 27 | func pg_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 28 | func 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 |
| 29 | func pg_read(path: *u8, buf: *u8, cap: i64) -> i64 |
| 38 | func pg_slice_contains(hay: *u8, a: i64, b: i64, pat: *u8) -> i64 |
| 51 | func pg_last_line_with(hay: *u8, n: i64, pat: *u8, out: *i64) -> i64 |
| 66 | func pg_token(conf: *u8, pos: i64, le: i64, pool: *u8, poff: *i64) -> i64 called by 1: main |
| 77 | func pg_lineage_cols(lin: *u8, ln: i64, child: *u8, cols: *i64) -> i64 |
| 109 | func pg_sec(fd: i64, label: *u8, buf: *u8, a: i64, b: i64) -> i64 |
| 119 | func pg_emit_head(fd: i64, id: *u8, slug: *u8, child: *u8, lin: *u8, cols: *i64) -> i64 |
| 136 | func pg_emit_tail(fd: i64) -> i64 |
| 146 | func main(argc: i64, argv: *i64) -> i64 |