code wiki / _hdl_build / nx_wasm_craft_gate.nx
nx_wasm_craft_gate.nx
buildroot/runtime/_hdl_build/nx_wasm_craft_gate.nx
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
imports: nx_wasm_craft.nxnx_png_write.nxnx_gate_verdict.nx
imported by: nobody (leaf or entry point)
structs
| none |
consts
| 10 | const K_BYTE_MASK: i64 = 255 // low-byte extract when reading voxel cells as i64 (T56) |
| 17 | const T79_DIV: i64 = 12 |
| 22 | const T79_SCALE: i64 = 32 |
| 23 | const T79_SPREAD_MIN: i64 = 12 |
| 24 | const T79_CLAMP_MAX: i64 = 250 |
| 25 | const K_SENTINEL_5A: i64 = 99344109427290 // 0x5A5A5A5A5A5A -- T58's untouched-memory sentinel pattern |
| 32 | const T88_EIGHTHS: i64 = 8 |
| 36 | const T90_PINS: i64 = 11 |
| 37 | const T90_TREEMAX: i64 = 17 |
| 38 | const K_BIRTH_HOLD_TICKS: i64 = 10000 // T35 fixture: park the birth cooldown far past the measured window so no newborn hijacks the hunter pick |
| 39 | const 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. |
| 40 | const 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. |
| 41 | const 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. |
| 42 | const 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. |
| 43 | const 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. |
| 44 | const 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. |
| 45 | const 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. |
| 46 | const 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. |
| 47 | const 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. |
| 48 | const 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. |
| 49 | const 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. |
| 50 | const K_MAGIC_1000000007: i64 = 1000000007 |
| 51 | const K_MAGIC_4096: i64 = 4096 |
| 52 | const K_MAGIC_9000: i64 = 9000 // T94 fixture: a poked day phase in ticks, arbitrary but inside DAYLEN (72000) |
| 53 | const K_MAGIC_20260728: i64 = 20260728 |
| 54 | const K_MAGIC_3000: i64 = 3000 |
| 55 | const K_MAGIC_999999: i64 = 999999 |
| 56 | const K_MAGIC_12345: i64 = 12345 |
| 57 | const K_MAGIC_424242: i64 = 424242 |
| 58 | const K_MAGIC_1024: i64 = 1024 |
| 59 | const K_MAGIC_1536: i64 = 1536 |
| 60 | const K_MAGIC_6144: i64 = 6144 |
| 61 | const K_MAGIC_8191: i64 = 8191 |
| 62 | const K_MAGIC_57344: i64 = 57344 |
| 63 | const K_MAGIC_4611686018427387903: i64 = 4611686018427387903 |
functions
| 65 | func vw(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 } |
| 67 | func s9set(base: i64) -> i64 { let s: *i64 = wst(base); s[S_RESW] = 640; s[S_RESH] = 480; s[S_YFLIP] = 1; return 0 } |
| 68 | func vn(v: i64) -> i64 |
| 84 | func emit(base: i64, path: *u8) -> i64 |
| 99 | func fbck(base: i64) -> i64 |
| 107 | func nblocks(base: i64) -> i64 |
| 118 | func main() -> i64 |