code wiki / _hdl_build / nx_engine_stream_gate.nx
nx_engine_stream_gate.nx
buildroot/runtime/_hdl_build/nx_engine_stream_gate.nx
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
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
structs
| none |
consts
| 24 | const CW: i64 = 1760 // chunk size (world units) |
| 25 | const RNG: i64 = 4400 // stream radius around the viewer |
| 26 | const PW: i64 = 400 |
| 27 | const PH: i64 = 300 |
| 28 | const BG: i64 = 30 + 40*256 + 58*65536 |
functions
| 20 | func hw(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 21 | func 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 } |
| 22 | func 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 |
| 31 | func chunk_mesh(ci: i64, cj: i64, sp: i64) -> i64 |
| 66 | func stream_station(vx: i64, vz: i64, out: *i64) -> i64 |
| 103 | func hash_range(from: i64, to: i64) -> i64 |
| 117 | func main() -> i64 |