code wiki / _hdl_build / nx_role_parts.nx

nx_role_parts.nx

buildroot/runtime/_hdl_build/nx_role_parts.nx

14269 B316 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind tooltopic role
docsdependenciesstructsconstsfunctions

about

nx_role_parts.nx -- X-ORC-006: SHEET MUSIC, extracted (operator: an orchestra works because everyone reads the SAME score but plays from their own PART). Per beat, derive knowledge/parts/<owner>.txt for EVERY distinct owner in the queue: their TODO/NOVEL rows (id, w, gate, title) with the channel route inline when one exists (the brief-join gene generalized from the tutor seat to every chair). Derived state: sibling-tmp + renameat per part (no-TRUNC immunity, the reloop lesson). Durable: parts files + one PARTS row -> knowledge/status/role_parts.log. Exit 0 = parts derived; exit 1 = unreadable world. argv[1]=queue argv[2]=outdir. license_tier: ORIGINAL

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_role_parts.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 rp_read sys_openat_rd sys_read sys_close sys_exit rp_cols rp_slice_eq rp_part sys_mmap ↻ rp_cat sys_openat_wr _fp sys_write ↻ sys_write ↻ rp_cols ↻ rp_slice_eq ↻ rp_route _fp ↻ sys_write ↻ _fn sys_mmap ↻ sys_write ↻ sys_close ↻ sys_renameat rp_section_part sys_mmap ↻ rp_cat ↻ sys_openat_wr ↻ _fp ↻ sys_write ↻ rp_cols ↻ rp_slice_eq ↻ rp_name_in_csv rp_slice_eq ↻ rp_emit_one _fp ↻

structs

none

consts

11const K_MAGIC_1048576: i64 = 1048576
12const K_MAGIC_1048560: i64 = 1048560
13const K_MAGIC_262144: i64 = 262144
14const K_MAGIC_262128: i64 = 262128
15const K_MAGIC_8192: i64 = 8192
16const K_MAGIC_65536: i64 = 65536
17const K_MAGIC_65520: i64 = 65520

functions

18func _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
19func _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 }
20func _fn(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 }
21func rp_len(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n }
22func rp_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 }
23func rp_read(path: *u8, buf: *u8, cap: i64) -> i64
called by 1: main calls 3: sys_openat_rdsys_readsys_close
33func rp_cols(q: *u8, ls: i64, le: i64, sp: *i64) -> i64
48func rp_slice_eq(a: *u8, s: i64, e: i64, b: *u8, bs: i64, be: i64) -> i64
55func rp_route(fd: i64, tin: *u8, tn: i64, q: *u8, ida: i64, idb: i64) -> i64
called by 2: rp_partrp_emit_one calls 2: _fpsys_write
91func rp_part(q: *u8, qn: i64, tin: *u8, tn: i64, outd: *u8, oa: i64, ob: i64) -> i64
151func rp_name_in_csv(q: *u8, oa: i64, ob: i64, sb: *u8, ca: i64, cb: i64) -> i64
called by 1: rp_section_part calls 1: rp_slice_eq
164func rp_emit_one(fd: i64, q: *u8, sp: *i64, tin: *u8, tn: i64) -> i64
178func rp_section_part(q: *u8, qn: i64, tin: *u8, tn: i64, outd: *u8, sb: *u8, na: i64, nb: i64, la: i64, lb: i64, ca: i64, cb: i64) -> i64
230func main(argc: i64, argv: *i64) -> i64