code wiki / _hdl_build / nx_morpho_rd_gate.nx

nx_morpho_rd_gate.nx

buildroot/runtime/_hdl_build/nx_morpho_rd_gate.nx

16248 B343 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind gate/proof
docsdependenciesstructsconstsfunctions

about

nx_morpho_rd_gate.nx -- MORPHOGENESIS CORE rung 1: volumetric tissue growth by 3D Gray-Scott reaction-diffusion, driven from a compact genome. This is the "Infinigen layer" for anatomy: no organ meshes are stored, the structure GROWS from a seed + a handful of genome scalars. ★SUBSTRATE CORRECTIONS vs the proposal, deliberate and load-bearing: (1) NishiLang, not C. C is bench-oracle-only here by standing law; product paths are sovereign .nx. (2) ALL-INTEGER Q16 fixed point, not float. Our measured sovereign exceed is BIT-EXACT DETERMINISM (identical replay -> identical checksum, proven in nx_gx4_walk). Floats would hand that away for nothing -- reaction-diffusion needs no float, and T6 below PROVES the determinism we would have lost. (3) Renders through our own raster path, not Vulkan/DX12 (host GPU APIs are exactly what the sovereign steer forbids). The eyeball artifact goes out through our canonical PNG writer. GATE = known-answer MATH first, emergence second. A pattern that merely "looks organic" proves nothing; the Laplacian is checked against exact discrete identities (constant->0, linear->0, x^2->2), the trivial steady state is checked to be genuinely steady, and only THEN is emergence measured. license_tier: ORIGINAL expect_exit: 0

dependencies 1 imports · 0 importers

nx_png_write.nx nx_morpho_rd_gate.nx

imports: nx_png_write.nx

imported by: nobody (leaf or entry point)

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

main md_puts md_lap md_idx md_idx ↻ md_pn md_step md_idx ↻ md_lap ↻ md_seed md_idx ↻ md_checksum nx_png_write_rgb sys_openat_wr sys_mmap sys_write pw_chunk pw_u32be sys_mmap ↻ sys_write ↻ sys_write ↻ pw_crc_block pw_adler32 sys_close sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close ↻

structs

none

consts

19const MQ: i64 = 65536 // Q16 fixed point: 1.0 == 65536
20const MW: i64 = 40
21const MH: i64 = 40
22const MD: i64 = 20
23const MSTEPS: i64 = 1800
30const MDT: i64 = 26214 // 0.4 in Q16

functions

32func md_puts(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
33func md_pn(v: i64) -> i64 { let b: *u8=sys_mmap(32) as *u8; var x: i64=v; var ng: i64=0; if x<0{ng=1;x=0-x} var i: i64=31; if x==0{b[i]=48 as u8;i=i-1} while x>0{b[i]=(48+x%10) as u8;x=x/10;i=i-1} if ng==1{b[i]=45 as u8;i=i-1} sys_write(1,(b as i64+i+1) as *u8,31-i); return 0 }
called by 1: main
34func md_idx(x: i64, y: i64, z: i64) -> i64 { return x + y*MW + z*MW*MH }
37func md_lap(F: *i64, x: i64, y: i64, z: i64) -> i64
called by 2: md_stepmain calls 1: md_idx
47func md_step(U: *i64, V: *i64, Un: *i64, Vn: *i64, Du: i64, Dv: i64, Fq: i64, Kq: i64) -> i64
called by 1: main calls 2: md_idxmd_lap
93func md_seed(U: *i64, V: *i64, seed: i64, blobs: i64) -> i64
called by 1: main calls 1: md_idx
125func md_checksum(V: *i64) -> i64
called by 1: main
132func main() -> i64