nx_craft_search_emit_t53.nx
buildroot/runtime/nx_craft_search_emit_t53.nx
about
nx_craft_emit.nx -- THE SOVEREIGN CRAFT SHIP LANE (retires _ops/nx_emit_game.sh's laptop/WSL
dependency for /world/craft): gate-check -> .nx -> .wat -> .wasm -> page -> live docroot,
every stage BYTE-ASSERTED before the next runs (the emit script's founding law, organ form:
a green tool on empty input is not a check -- a 0-byte .wat once shipped a 20-byte "game").
The page itself is built IN-PROCESS by gpe_build (nx_game_page_emit as a LIB -- one emitter,
not a fork), and the deploy is tmp+rename with a READ-BACK byte+marker assert (what LANDED
is the claim, never what was written). Gate RED = refuses to emit anything at all.
usage: nx_craft_emit (runs from nishihost cwd like every registered tool)
exit: 0 SHIPPED | 2 gate-red | 3 wat | 4 wasm | 5 page | 6 deploy | 7 readback | 8 recipe-malformed
W1 (2026-08-12): worlds come from knowledge/world_recipes.conf rows (name\tvnum\tseed\tout\t
title\tcontrols); the builtin three below are the fallback when the file is absent, and the
source actually consumed is ANNOUNCED (recipe_src=) on every run.
license_tier: ORIGINAL No hw writes (Rule 26).
dependencies 9 imports · 1 importers
imports: nx_syscalls.nxnx_game_page_search_t53.nxnx_softbind.nxnx_jsbalance.nxnx_jsscope.nxnx_relief_lib.nxnx_nxa_fk.nxnx_wasm_memory_lib.nxnx_wasm_craft.nx
imported by: nx_craft_search_fit_t53.nx
call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown
structs
| none |
consts
| 30 | const CE_GATE: *u8 = "nx_wasm_craft_gate.elf" |
| 31 | const CE_CWAT: *u8 = "nx_compile_wat.elf" |
| 32 | const CE_WATC: *u8 = "nx_wat_compiler.elf" |
| 35 | const CE_VMGATE: *u8 = "nx_wasm_craft_vm_gate.elf" |
| 36 | const CE_SRC: *u8 = "buildroot/runtime/nx_wasm_craft.nx" |
| 37 | const CE_WAT: *u8 = "buildroot/_build/nx_wasm_craft_emit.wat" |
| 38 | const CE_WASM: *u8 = "buildroot/_build/nx_wasm_craft_emit.wasm" |
| 46 | const CE_WAT_MT: *u8 = "buildroot/_build/nx_wasm_craft_emit_mt.wat" |
| 47 | const CE_WASM_MT: *u8 = "buildroot/_build/nx_wasm_craft_emit_mt.wasm" |
| 48 | const CE_MT_TMP: *u8 = "sites/nishifamily/world/craft_mt.wasm.stage" |
| 49 | const CE_MT_OUT: *u8 = "sites/nishifamily/world/craft_mt.wasm" |
| 50 | const CE_SHARED: *u8 = "--shared" |
| 54 | const CE_MT_HEADROOM: i64 = 2 |
| 55 | const CE_MT_PAGES_MIN: i64 = 16 |
| 56 | const CE_MT_PAGES_MAX: i64 = 65536 |
| 57 | const CE_TMP: *u8 = "sites/nishifamily/world/craft.html.stage" |
| 58 | const CE_OUT: *u8 = "sites/nishifamily/world/craft.html" |
| 59 | const CE_TITLE: *u8 = "NISHI CRAFT - SOVEREIGN 3D" |
| 60 | const CE_NATIVE: *u8 = "nx_desktop_craft" |
| 63 | const CE_TMP2: *u8 = "sites/nishifamily/world/beach.html.stage" |
| 64 | const CE_OUT2: *u8 = "sites/nishifamily/world/beach.html" |
| 65 | const CE_TITLE2: *u8 = "NISHI SHORE - REVIEW STAGE" |
| 66 | const CE_CTRL2: *u8 = "the flat-light REVIEW STAGE: mixed beachwear across the cast (bred, stable per girl) · same engine, same controls as <a href=\"craft\">NISHI CRAFT</a> · ?review=1 auto-frames the nearest girl<br>ISEKAI: cross to <a href=\"craft\">NISHI CRAFT</a> or <a href=\"vale\">NISHI VALE</a> — level, ledger and party come along" |
| 69 | const CE_TMP3: *u8 = "sites/nishifamily/world/vale.html.stage" |
| 70 | const CE_OUT3: *u8 = "sites/nishifamily/world/vale.html" |
| 71 | const CE_TITLE3: *u8 = "NISHI VALE - THE MEDIEVAL HIGHLAND" |
| 72 | const CE_CTRL3: *u8 = "deep woods, cold snowline, cave-riddled stone — and wardens who hunt WIDE by day · your traveler arrives with his ledger, his level and his party from <a href=\"craft\">NISHI CRAFT</a> or <a href=\"beach\">NISHI SHORE</a> · <b>G</b> invites a bonded girl to your party · same controls" |
| 73 | const CE_CTRL: *u8 = "click canvas = MOUSELOOK (Esc frees) · <b>WASD</b> move · <b>SPACE</b> jump · L/R-click or <b>E</b>/<b>B</b> break/place · <b>Q</b> cycles 7 slots (blocks · HOE · SEEDS) · till grass, plant, let rain or a pond do the rest, break the GOLDEN crop = harvest · <b>E</b> on a girl = meet her, <b>G</b> invites her to your party · nights are the wardens' · <b>H</b> home · gamepad + touch<br>ISEKAI: your level, ledger and party travel with you — walk into <a href=\"beach\">NISHI SHORE</a> or <a href=\"vale\">NISHI VALE</a> · <a href=\"craft_immersion\">what is broken and what is next</a>" |
| 74 | const CE_MIN_WAT: i64 = 500000 |
| 75 | const CE_MIN_WASM: i64 = 50000 |
| 76 | const CE_MIN_PAGE: i64 = 100000 |
| 77 | const CE_MODE: i64 = 0x1a4 |
| 163 | const CE_COMPILE_ARG_WORDS: i64 = 1+2+2+3+2+1 |
| 281 | const CW_NPC_ASSET: *u8 = "sites/nishifamily/world/ref9d.nxa" |
| 309 | const CW_FACE_SPAN_UM: i64 = 250000 // a 250mm head region: the per-region atlas this argues for |
| 332 | const CW_NXA_UNIT_UM: i64 = 10 // VERT/SKEL units are 0.01 mm, so one unit is ten microns |
| 333 | const CW_SKEL_W: i64 = 8 // words per joint: parent, tx ty tz, qx qy qz qw |
| 334 | const CW_TEXC_W_G: i64 = 2 // TEXC payload word 2 is the atlas grid g |
| 355 | const CW_Q16: i64 = 65536 |
| 571 | const CE_EV_CAP: i64 = 8192 |
functions
| 79 | func ce_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 80 | func ce_puts(s: *u8) -> i64 { sys_write(1, s, ce_slen(s)); return 0 } |
| 81 | func ce_pn(v: i64) -> i64 called by 8: cw_band_linecw_chart_linecw_chart_adequacycw_atlas_adequatecw_npc_atlascw_donors+2 calls 2: sys_writesys_mmap |
| 99 | func ce_stamp(t: *u8) -> *u8 |
| 114 | func ce_run_argv(elf: *u8,argv: *i64) -> i64 called by 3: ce_runce_run5ce_compile_craft calls 7: sys_mmapsys_munmapsys_forksys_execvesys_exitsys_wait4+1 |
| 135 | func ce_run(elf: *u8,a1: *u8,a2: *u8) -> i64 |
| 147 | func ce_run5(elf: *u8,a1: *u8,a2: *u8,a3: *u8,a4: *u8,a5: *u8) -> i64 |
| 164 | func ce_compiler_argv(out: *u8,shared_max: *u8,argv: *i64,words: i64,floor_text: *u8,limit_text: *u8) -> i64 |
| 192 | func ce_compile_craft(out: *u8,shared_max: *u8) -> i64 |
| 209 | func ce_num_str(v: i64, b: *u8) -> i64 |
| 225 | func ce_wat_pages(p: *u8) -> i64 |
| 254 | func ce_find(hay: *u8, n: i64, needle: *u8) -> i64 |
| 267 | func ce_fsize(p: *u8) -> i64 |
| 282 | func cw_rd64(b: *u8, off: i64) -> i64 { var v: i64 = 0; var k: i64 = 7; while k >= 0 { v = v*256 + (b[off+k] as i64); k = k - 1 } return v } |
| 283 | func cw_tag4(b: *u8, off: i64, t: *u8) -> i64 { if b[off] == t[0] { if b[off+1] == t[1] { if b[off+2] == t[2] { if b[off+3] == t[3] { return 1 } } } } return 0 } |
| 310 | func cw_band_line(nm: *u8, lambda_um: i64, res: i64) -> i64 |
| 335 | func cw_bone_span_um(ab: *u8, skoff: i64, nj: i64, j: i64) -> i64 |
| 356 | func cw_chart_vres(ab: *u8, tc: i64, rectoff: i64, j: i64, res: i64, g: i64) -> i64 |
| 362 | func cw_chart_line(nm: *u8, jj: i64, span: i64, cres: i64) -> i64 called by 1: cw_chart_adequacy calls 5: rlf_bands_carried_spanrlf_bands_countce_putsce_pnrlf_texel_um_span |
| 374 | func cw_chart_adequacy(ab: *u8, res: i64) -> i64 |
| 434 | func cw_atlas_adequate(ab: *u8, tmoff: i64) -> i64 called by 1: cw_npc_atlas calls 7: cw_rd64ce_putsce_pnrlf_texel_umcw_band_linerlf_band_resolvable_span+1 |
| 475 | func cw_npc_atlas(page: *u8, pn: i64) -> i64 |
| 510 | func cw_donors() -> i64 |
| 572 | func ce_cat(d: *u8, p: i64, s: *u8) -> i64 called by 1: ce_evidence |
| 577 | func ce_catn(d: *u8, p: i64, v: i64) -> i64 called by 1: ce_evidence |
| 587 | func ce_evidence(base_ctrl: *u8, out: *u8) -> i64 |
| 608 | func main() -> i64 |
| 834 | func ce_ship(out: *u8, pn: i64, tmpp: *u8, outp: *u8) -> i64 |