code wiki / _hdl_build / nx_wasm_craft_gate.nx

nx_wasm_craft_gate.nx

buildroot/runtime/_hdl_build/nx_wasm_craft_gate.nx

209549 B4192 linesdepth 6pulls 35 transitivereach 0 importersview sourcekind gate/prooftopic wasm
docsdependenciesstructsconstsfunctions

about

nx_wasm_craft_gate.nx -- verifies the GENERATED 3D WORLD natively (same base-relative code the wasm runs). The DDA renderer is checked against GROUND TRUTH (a direct grid scan says what the ray must hit), edits are causal (break removes THE targeted voxel, place fills its face-neighbor), the world loop is deterministic, and the input layer's edge contract holds inside the wired game (E held two frames breaks exactly ONE block). PNGs land in knowledge/ for the eyeball + critics. license_tier: ORIGINAL expect_exit: 0

dependencies 3 imports · 0 importers

nx_wasm_craft.nx nx_png_write.nx nx_gate_verdict.nx nx_wasm_craft_gate.nx

imports: nx_wasm_craft.nxnx_png_write.nxnx_gate_verdict.nx

imported by: nobody (leaf or entry point)

structs

none

consts

10const K_BYTE_MASK: i64 = 255 // low-byte extract when reading voxel cells as i64 (T56)
17const T79_DIV: i64 = 12
22const T79_SCALE: i64 = 32
23const T79_SPREAD_MIN: i64 = 12
24const T79_CLAMP_MAX: i64 = 250
25const K_SENTINEL_5A: i64 = 99344109427290 // 0x5A5A5A5A5A5A -- T58's untouched-memory sentinel pattern
32const T88_EIGHTHS: i64 = 8
36const T90_PINS: i64 = 11
37const T90_TREEMAX: i64 = 17
38const K_BIRTH_HOLD_TICKS: i64 = 10000 // T35 fixture: park the birth cooldown far past the measured window so no newborn hijacks the hunter pick
39const K_MAGIC_2000: i64 = 2000 // NX-UNNAMED: mechanical, collision-free placeholder -- this name RESTATES the value and so carries no meaning. Replace it with a domain term that says WHY, or move the number to a config row.
40const K_MAGIC_1100: i64 = 1100 // NX-UNNAMED: mechanical, collision-free placeholder -- this name RESTATES the value and so carries no meaning. Replace it with a domain term that says WHY, or move the number to a config row.
41const K_MAGIC_4242: i64 = 4242 // NX-UNNAMED: mechanical, collision-free placeholder -- this name RESTATES the value and so carries no meaning. Replace it with a domain term that says WHY, or move the number to a config row.
42const K_MAGIC_10000: i64 = 10000 // NX-UNNAMED: mechanical, collision-free placeholder -- this name RESTATES the value and so carries no meaning. Replace it with a domain term that says WHY, or move the number to a config row.
43const K_MAGIC_99999: i64 = 99999 // NX-UNNAMED: mechanical, collision-free placeholder -- this name RESTATES the value and so carries no meaning. Replace it with a domain term that says WHY, or move the number to a config row.
44const K_MAGIC_1560: i64 = 1560 // NX-UNNAMED: mechanical, collision-free placeholder -- this name RESTATES the value and so carries no meaning. Replace it with a domain term that says WHY, or move the number to a config row.
45const K_MAGIC_60000: i64 = 60000 // NX-UNNAMED: mechanical, collision-free placeholder -- this name RESTATES the value and so carries no meaning. Replace it with a domain term that says WHY, or move the number to a config row.
46const K_MAGIC_74549: i64 = 74549 // NX-UNNAMED: mechanical, collision-free placeholder -- this name RESTATES the value and so carries no meaning. Replace it with a domain term that says WHY, or move the number to a config row.
47const K_MAGIC_4629: i64 = 4629 // NX-UNNAMED: mechanical, collision-free placeholder -- this name RESTATES the value and so carries no meaning. Replace it with a domain term that says WHY, or move the number to a config row.
48const K_MAGIC_1310720: i64 = 1310720 // NX-UNNAMED: mechanical, collision-free placeholder -- this name RESTATES the value and so carries no meaning. Replace it with a domain term that says WHY, or move the number to a config row.
49const K_MAGIC_3407872: i64 = 3407872 // NX-UNNAMED: mechanical, collision-free placeholder -- this name RESTATES the value and so carries no meaning. Replace it with a domain term that says WHY, or move the number to a config row.
50const K_MAGIC_1000000007: i64 = 1000000007
51const K_MAGIC_4096: i64 = 4096
52const K_MAGIC_9000: i64 = 9000 // T94 fixture: a poked day phase in ticks, arbitrary but inside DAYLEN (72000)
53const K_MAGIC_20260728: i64 = 20260728
54const K_MAGIC_3000: i64 = 3000
55const K_MAGIC_999999: i64 = 999999
56const K_MAGIC_12345: i64 = 12345
57const K_MAGIC_424242: i64 = 424242
58const K_MAGIC_1024: i64 = 1024
59const K_MAGIC_1536: i64 = 1536
60const K_MAGIC_6144: i64 = 6144
61const K_MAGIC_8191: i64 = 8191
62const K_MAGIC_57344: i64 = 57344
63const K_MAGIC_4611686018427387903: i64 = 4611686018427387903

functions

65func vw(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
67func s9set(base: i64) -> i64 { let s: *i64 = wst(base); s[S_RESW] = 640; s[S_RESH] = 480; s[S_YFLIP] = 1; return 0 }
68func vn(v: i64) -> i64
84func emit(base: i64, path: *u8) -> i64
99func fbck(base: i64) -> i64
107func nblocks(base: i64) -> i64
118func main() -> i64