nx_world_snap.nx
buildroot/runtime/nx_world_snap.nx
about
nx_world_snap.nx -- THE WORLD-ART CAPTURE INSTRUMENT (operator 2026-08-12: "make sure you are
running the tools to evaluate the art and realism and quality"). The W1b style overlay applies
in the BROWSER page only, so no estate instrument had ever SEEN a styled world -- this organ
renders any (identity, seed, style-rows) world NATIVELY through the same engine source the wasm
is compiled from (nx_wasm_craft as a lib; its 54-tooth gate is the native-behavior proof), and
writes the frame as PNG for the judge battery (nx_uiq_visual analyze / nx_frame_score / eye).
The style poke here is semantically what the page's NXSP loop does: sp[idx]=val post-init,
idx bounded 7..58 (same belt as the page).
usage: nx_world_snap <out.png> [v] [seed] [style idx:val,...] [ticks]
exit: 0 written+read-back | 2 usage | 5 png-write-fail. license_tier: ORIGINAL
No hw writes (Rule 26).
dependencies 4 imports · 0 importers
imports: nx_wasm_craft.nxnx_genp_allow_lib.nxnx_png_write.nxnx_nxfh_lib.nx
imported by: nobody (leaf or entry point)
structs
| none |
consts
| 16 | const K_MAGIC_20260728: i64 = 20260728 |
| 17 | const K_MAGIC_4096: i64 = 4096 |
| 18 | const K_MAGIC_65536: i64 = 65536 |
| 19 | const K_MODE_RW: i64 = 420 // 0644 -- the .d16 raw depth plane, same mode nx_png_write uses |
| 24 | const WS_Q_NATIVE: i64 = 1 |
| 25 | const WS_CH_Q: i64 = 113 // ASCII 'q' -- first byte of the `q=<n>` reduction keyword |
| 26 | const WS_CH_EQ: i64 = 61 // ASCII '=' |
| 27 | const WS_PERMIL: i64 = 1000 // permil base for the announced resolution fraction |
| 30 | const WS_QKW_LEN: i64 = 2 |
| 31 | const WS_CURSOR_BYTES: i64 = 16 // one i64 cursor cell, page-rounded by mmap |
| 37 | const WS_PERCEPT_W: i64 = 400 |
| 38 | const WS_PERCEPT_H: i64 = 240 |
| 51 | const WS_D16_MAX: i64 = 65535 |
| 55 | const WS_ISQRT_HI_BOUND: i64 = 4294967296 |
functions
| 59 | func ws2_natw() -> i64 { return W } |
| 60 | func ws2_nath() -> i64 { return H } |
| 62 | func ws2_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 63 | func ws2_puts(s: *u8) -> i64 { sys_write(1, s, ws2_slen(s)); return 0 } |
| 64 | func ws2_pn(v: i64) -> i64 |
| 77 | func ws2_int(s: *u8) -> i64 |
| 87 | func ws2_num_at(s: *u8, pos: *i64) -> i64 |
| 99 | func ws2_streq(a: *u8, b: *u8) -> i64 |
| 109 | func main(argc: i64, argv: *i64) -> i64 |