code wiki / _hdl_build / nx_ng_world.nx

nx_ng_world.nx

buildroot/runtime/_hdl_build/nx_ng_world.nx

10752 B183 linesdepth 5pulls 8 transitivereach 0 importersview sourcekind tooltopic ng
docsdependenciesstructsconstsfunctions

about

nx_ng_world.nx -- CAP-WORLD-MODEL, generation 14: THE ENDPOINT of the neural-graphics ladder. The leap past every prior rung (which rendered STATIC scenes): a learned DYNAMICS model -- state x action -> next state -- that can be ROLLED OUT (applied repeatedly) and RENDERED frame-by-frame = an interactive neural game engine (Ha&Schmidhuber world model / GameNGen / Genie / Sora-class). src ng_world_sora, ng_world_t2v, ng_world_worldmodel. Reuses the renderer (software raster into nx_image, displayed via the nx_scene_demo canvas bridge -- the only browser touch). Learns the transition rule from observed (state,action,next) transitions, then SIMULATES a NOVEL action sequence and renders the rollout as a spacetime filmstrip (rows = time, cols = space). Q16, no float. Honest gated proof of the DEFINING (interactive) property: T1 LEARN-DYNAMICS -- recover the transition rule from data (|V-V*| small); T2 INTERACTIVE ROLLOUT -- a NOVEL action sequence (not the training one) is simulated correctly (predicted trajectory == true world, err~0) = actions drive the next frame, generalizes; T3 NEG-CONTROL -- a model that IGNORES the action (V=0, static) CANNOT predict (the action is load-bearing = what makes it a *world* model, not a static scene); T4 RENDER+EMIT -- the rollout renders to a viewable filmstrip. HONEST: 1-DOF state (object x-position), linear dynamics; full world-model = high-dim latent state + learned non-linear dynamics + frame-conditioned generation = the follow-on. Sovereign: nx_image + nx_base64 + syscalls. The emitted artifact is PUBLISHED via nx_ng_publish (NOT local show-and-tell). license_tier: ORIGINAL expect_exit: 0

dependencies 3 imports · 0 importers

nx_image.nx nx_itoa_lib.nx nx_base64.nx nx_ng_world.nx

imports: nx_image.nxnx_itoa_lib.nxnx_base64.nx

imported by: nobody (leaf or entry point)

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

main wp rollout wqm wqm ↻ w_abs max_traj_err w_abs ↻ nx_image_alloc sys_mmap nx_image_set nx_img_canvas_page b64_encode b64_enc_char sc_app sc_app_n sys_openat_wr wpn nxi_out nxi_fd sys_mmap ↻ ccz_cat_num sys_write sys_munmap sys_openat_append wl_ws wl_wn nxi_fd ↻

structs

none

consts

21const V_MAGIC_1024: i64 = 1024
22const V_MAGIC_8192: i64 = 8192
23const V_MAGIC_262144: i64 = 262144
25const WLOG: *u8 = "knowledge/status/ng_world.log"
26const OUTP: *u8 = "web_assets/ng_world_view.html"
27const Q16: i64 = 65536
28const NT: i64 = 12 // timesteps (filmstrip rows)
29const IW: i64 = 32 // space pixels (cols)
30const V_TRUE: i64 = 9830 // true per-action velocity 0.15
31const X0: i64 = 16384 // initial state 0.25
32const BR2: i64 = 655 // blob radius^2 (~0.1^2) for rendering
33const EPOCHS: i64 = 1000
34const LRQ: i64 = 2048

functions

36func wp(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
41func wpn(v: i64) -> i64 { nxi_out(v); return 0 }
called by 1: main calls 1: nxi_out
42func w_abs(v: i64) -> i64 { if v<0 { return 0-v } return v }
called by 2: max_traj_errmain
43func wqm(a: i64, b: i64) -> i64 { return (a*b)>>16 }
called by 2: rolloutmain
44func wl_ws(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 }
called by 1: main
49func wl_wn(fd: i64, v: i64) -> i64 { nxi_fd(fd, v); return 0 }
called by 1: main calls 1: nxi_fd
52func sc_app(out: *u8, off: *i64, s: *u8) -> i64 { var i: i64 = 0; while s[i] != (0 as u8) { out[off[0]] = s[i]; off[0] = off[0] + 1; i = i + 1 } return 0 }
called by 1: nx_img_canvas_page
53func sc_app_n(out: *u8, off: *i64, v: i64) -> i64
called by 1: nx_img_canvas_page
60func nx_img_canvas_page(img: *Image, scale: i64, out: *u8, cap: i64) -> i64
called by 1: main calls 3: b64_encodesc_appsc_app_n
84func rollout(x0: i64, V: i64, acts: *i64, traj: *i64) -> i64
called by 1: main calls 1: wqm
90func max_traj_err(a: *i64, b: *i64) -> i64
called by 1: main calls 1: w_abs
96func main() -> i64