code wiki / _hdl_build / nx_morpho_rd_gate.nx
nx_morpho_rd_gate.nx
buildroot/runtime/_hdl_build/nx_morpho_rd_gate.nx
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
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
structs
| none |
consts
| 19 | const MQ: i64 = 65536 // Q16 fixed point: 1.0 == 65536 |
| 20 | const MW: i64 = 40 |
| 21 | const MH: i64 = 40 |
| 22 | const MD: i64 = 20 |
| 23 | const MSTEPS: i64 = 1800 |
| 30 | const MDT: i64 = 26214 // 0.4 in Q16 |
functions
| 32 | func 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 |
| 33 | func 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 |
| 34 | func md_idx(x: i64, y: i64, z: i64) -> i64 { return x + y*MW + z*MW*MH } |
| 37 | func md_lap(F: *i64, x: i64, y: i64, z: i64) -> i64 |
| 47 | func md_step(U: *i64, V: *i64, Un: *i64, Vn: *i64, Du: i64, Dv: i64, Fq: i64, Kq: i64) -> i64 |
| 93 | func md_seed(U: *i64, V: *i64, seed: i64, blobs: i64) -> i64 |
| 125 | func md_checksum(V: *i64) -> i64 called by 1: main |
| 132 | func main() -> i64 |