code wiki / _hdl_build / nx_engine_stream_gate.nx

nx_engine_stream_gate.nx

buildroot/runtime/_hdl_build/nx_engine_stream_gate.nx

10102 B229 linesdepth 4pulls 7 transitivereach 0 importersview sourcekind gate/prooftopic engine
docsdependenciesstructsconstsfunctions

about

nx_engine_stream_gate.nx -- ★R6 GENERATIVE STREAMING (the Cesium-convergence rung, taken the fusion way): Cesium streams STORED tiles (3D Tiles servers); we REGENERATE chunks from seed as the viewer travels -- the GENERATOR is the tile server (zero stored tiles, integer-deterministic). A viewer walks a 10-station journey across the nx_worldpipe world; at each station the working set is regenerated: near chunks fine, far chunks coarse, chunks behind EVICTED. T1 UNBOUNDED WORLD / BOUNDED BUFFER: the journey's cumulative unique-chunk geometry EXCEEDS the mesh caps (the whole world cannot exist at once) while every station fits comfortably. T2 DETERMINISTIC REVISIT: returning to station 0 regenerates chunk (0,0) BIT-IDENTICALLY (hash-equal) -- no tile store needed, the seed IS the storage. T3 SEAMS: same-LOD adjacent chunks share edge heights EXACTLY (one height function, one seed). LOD-boundary T-junction cracks are NAMED as residual (the skirt/stitching rung). T4 EVICTION is real: at a far station the old origin chunks are GONE from the buffer. T5 evidence: three stations of the journey rendered (textured + sun-shadowed). license_tier: ORIGINAL expect_exit: 0

dependencies 4 imports · 0 importers

nx_syscalls.nx nx_png.nx nx_trimesh.nx nx_worldpipe.nx nx_engine_stream_gate.nx

imports: nx_syscalls.nxnx_png.nxnx_trimesh.nxnx_worldpipe.nx

imported by: nobody (leaf or entry point)

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

main hw sys_write wp_init wp_hydro_bake sys_mmap wp_flow_h wp_param tm_noise3 tm_hash3 wp_height_core wp_spline wp_iabs tm_noise3 ↻ wp_clamp tm_hash3 ↻ wp_hyd_stamp tm_set_spec tm_set_image tm_set_tex sys_mmap ↻ stream_station tm_reset sys_mmap ↻ chunk_mesh tm_nv wp_height wp_height_raw wp_param ↻ wp_height_params tm_noise3 ↻ wp_height_core ↻ wp_hyd_bed wp_iabs ↻ wp_surface wp_biome wp_param ↻ wp_height_raw ↻ wp_hyd_bed ↻ tm_vert

structs

none

consts

24const CW: i64 = 1760 // chunk size (world units)
25const RNG: i64 = 4400 // stream radius around the viewer
26const PW: i64 = 400
27const PH: i64 = 300
28const BG: i64 = 30 + 40*256 + 58*65536

functions

20func hw(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
21func 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 calls 2: sys_mmapsys_write
22func clearfb(fb: *i64, n: i64, c: i64) -> i64 { var i: i64=0; while i<n { fb[i]=c; i=i+1 } return 0 }
called by 1: main
31func chunk_mesh(ci: i64, cj: i64, sp: i64) -> i64
66func stream_station(vx: i64, vz: i64, out: *i64) -> i64
103func hash_range(from: i64, to: i64) -> i64
called by 1: main calls 2: sys_mmaptm_vpos
117func main() -> i64