nx_game_page_metadata_candidate_t220.nx
buildroot/runtime/nx_game_page_metadata_candidate_t220.nx
about
nx_game_page_emit.nx -- the SOVEREIGN game-page emitter. Until now the browser page for a wasm
game was assembled by printf blocks in _ops/nx_emit_game.sh -- real emission logic living in
SHELL, against the doctrine (shell only LAUNCHES sovereign ELFs). This organ owns it: reads the
.wasm, base64-encodes it (composes nx_base64 -- one encoder, not a coreutils dependency), and
emits the complete self-contained page (marker, shim, input forwarding, persistence bytes-mover).
usage: nx_game_page_emit <wasm> <out.html> <title> <native-client-name> <controls-html>
RECOVERED 2026-08-02 from buildroot/_build/nx_craft_emit.s (the 14:07 build's data section)
after a failed in-place rewrite TRUNCATED this file to 0 bytes and the damage was copied to
both trees. Every emitted chunk below is the exact byte sequence that build shipped, so the
recovered emitter is byte-equivalent to the last one that passed both gates.
license_tier: ORIGINAL
dependencies 19 imports · 1 importers
diagram shows first 10 each side; +9 more imports, +0 more importers in the complete lists below.
imports: nx_syscalls.nxnx_base64.nxnx_game_page_artifact_lib.nxnx_game_shader_backend_selected_t55.nxnx_game_asset_prepare_emit.nxnx_game_surface_prepare.nxnx_json.nxnx_gpu_choice_workspace_t48.nxnx_site_chrome_search_t53.nxnx_wasmfit.nxnx_hairdyn_lib.nxnx_audio_osc.nxnx_atmosphere.nxnx_glprobe_lib.nxnx_tool_run.nxnx_genp_allow_lib.nxnx_release_view_emit.nxnx_release_recent_lib.nxnx_tier_ladder_lib.nx
imported by: nx_layout_metadata_gate_t220.nx
structs
| none |
consts
| 56 | const GPE_MT_WSRC: *u8 = "const NXMT_WSRC=\"let ex=null;onmessage=async(e)=>{const d=e.data;try{if(d.t==='init'){const i=await WebAssembly.instantiate(d.mod,{env:{memory:d.mem}});ex=i.exports;postMessage({t:'ready'});}else if(d.t==='band'){ex.render_band(BigInt(d.y0),BigInt(d.y1),BigInt(d.wid));postMessage({t:'band'});}}catch(err){postMessage({t:'err',m:String(err)});}};\";\n" |
| 58 | const GPE_WASM_CAP: i64 = 4194304 |
| 141 | const GPE_MAGIC_20260728: i64 = 20260728 |
| 187 | const GPE_EMIT_WEBGL: i64 = 1 |
| 194 | const GPE_ALPHA_BEND_SOFT_Q12: i64 = 40960 // the gate-proven XG_ALPHA_BEND_SOFT_Q12 compliance |
| 195 | const GPE_UNITS_PER_178CM: i64 = 171530 // the page's own 1.78m-to-world-unit pairing |
| 196 | const GPE_G_DEN_60HZ: i64 = 640800 // that pairing carried to a per-tick accel at 60Hz |
| 197 | const GPE_OUT_CAP: i64 = 16777216 |
| 226 | const RK_WGSL_CAP: i64 = 65536 |
| 227 | const RK_WGSL_TMO_MS: i64 = 8000 |
| 228 | const RK_WGSL_ELF: *u8 = "./nx_wgsl.elf" |
| 229 | const RK_WGSL_ELF_ABS: *u8 = "/volume1/homes/elderwesto/nishihost/nx_wgsl.elf" // the emitter's CWD is not always the serving root |
| 230 | const RK_WGSL_BEGIN: *u8 = "--- WGSL ---\n" |
| 231 | const RK_WGSL_END: *u8 = "\nwgsl_bytes=" |
| 232 | const RK_KERNEL_N: i64 = 65536 // u32 lanes per probe (1024 workgroups at the backend's width of 64) |
| 286 | const RK_LAYOUT_BEGIN: *u8 = "struct U{" |
| 287 | const RK_LAYOUT_END: *u8 = "var<uniform> u:U;\n" |
| 288 | const RK_LAYOUT_SIZE_KEY: *u8 = "layoutraw_rc=" |
| 289 | const RK_LAYOUT_NAMES: i64 = 18 |
| 290 | const RK_FLOAT_BYTES: i64 = 4 |
| 369 | const RK_WORLD_FS_BEGIN: *u8 = "--- world_wgsl WGSL ---\n" |
| 370 | const RK_WORLD_FS_END: *u8 = "\nworld_wgsl_rc=" |
| 371 | const RK_WORLD_VS_BEGIN: *u8 = "--- worldvs_wgsl WGSL ---\n" |
| 372 | const RK_WORLD_VS_END: *u8 = "\nworldvs_wgsl_rc=" |
| 434 | const RK_CAST_VS_BEGIN: *u8 = "--- cast_wgsl WGSL ---\n" |
| 435 | const RK_CAST_VS_END: *u8 = "\ncast_wgsl_rc=" |
| 436 | const RK_CAST_FS_BEGIN: *u8 = "--- castfs_wgsl WGSL ---\n" |
| 437 | const RK_CAST_FS_END: *u8 = "\ncastfs_wgsl_rc=" |
| 474 | const RK_LM_JS_SAFE_INTEGER_MAX:i64=9007199254740991 |
| 568 | const RK_CAST_GLSL_VS_BEGIN: *u8 = "--- cast_glsl GLSL ---\n" |
| 569 | const RK_CAST_GLSL_VS_END: *u8 = "\ncast_glsl_rc=" |
| 570 | const RK_CAST_GLSL_FS_BEGIN: *u8 = "--- castfs_glsl GLSL ---\n" |
| 571 | const RK_CAST_GLSL_FS_END: *u8 = "\ncastfs_glsl_rc=" |
| 730 | const GPE_GPU_TIMESTAMP_ENDPOINTS: i64 = 2 |
| 731 | const GPE_GPU_TIMESTAMP_BUFFERS: i64 = 2 |
| 732 | const GPE_GPU_SLOT_BUFFER_BYTES: i64 = GPE_GPU_TIMESTAMP_ENDPOINTS * GPE_GPU_TIMESTAMP_BUFFERS * __size_of(i64) |
| 734 | const GPE_GPU_POLICY_MAX_INTEGER: i64 = 9007199254740991 |
| 735 | const GPE_GPU_POLICY_RADIX: i64 = 10 |
| 736 | const GPE_FACING_INTEGER_MAX: i64 = 2147483647 |
| 737 | const GPE_FACING_HALF_TURN_Q12: i64 = 12868 |
| 1223 | const GPE_HSTR_WORDS_PER_STRAND: i64 = 24 |
| 1224 | const GPE_AXES: i64 = 3 |
| 1230 | const GPE_HAIR_GUIDES: i64 = 900 |
| 1270 | const GPE_HAIR_CYC_FIRST: i64 = 1 |
| 1271 | const GPE_HAIR_CYC_LAST: i64 = 3 |
| 1274 | const GPE_HAIR_CYC_SKIP: i64 = 0 |
| 1275 | const GPE_HAIR_CYC_LEN: i64 = 1 |
| 1276 | const GPE_HAIR_CYC_SLOTS: i64 = 2 |
| 1333 | const GPE_HAIR_DRIVE_FRAMES: i64 = 24 |
| 1340 | const GPE_HAIR_DRIVE_AMP_Q8: i64 = 32 |
| 1343 | const GPE_HAIR_SETTLE_PERIODS_MAX: i64 = 40 |
| 1542 | const GPE_HAIR_AMP_CAP: i64 = 3400 |
| 1568 | const span=(ztop-zbot)||1; |
| 1706 | const GPE_RD_HTML_CAP: i64 = 262144 |
| 1707 | const GPE_RD_PLANS: i64 = 3 |
| 1708 | const GPE_RD_PLAN_GE: *u8 = "buildroot/knowledge/compare/gameengine.plan" |
| 1709 | const GPE_RD_PLAN_GR: *u8 = "buildroot/knowledge/compare/graphics.plan" |
| 1710 | const GPE_RD_PLAN_CS: *u8 = "buildroot/knowledge/compare/charsim.plan" |
functions
| 38 | func rk_tier_ladder() -> *u8 { return tl_emit() } |
| 60 | func gpe_mt_declare(twin:*u8,bytes:i64,url:*u8,pages:i64,maximum:i64)->i64 |
| 86 | func gpe_mt_boot(out: *u8, p0: i64) -> i64 |
| 127 | func gpe_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 } |
| 128 | func gpe_pn(v: i64) -> i64 |
| 199 | func gpe_slen(s: *u8) -> i64 { var k: i64 = 0; while s[k] != (0 as u8) { k = k + 1 } return k } |
| 200 | func gpe_ap(out: *u8, pos: i64, s: *u8) -> i64 |
| 206 | func gpe_ap_n(out: *u8, pos: i64, s: *u8, n: i64) -> i64 |
| 233 | func rk_slen(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } return n } |
| 234 | func rk_err(s: *u8) -> i64 { sys_write(2, s, rk_slen(s)); return 0 } |
| 235 | func rk_num(out: *u8, pos: i64, v: i64) -> i64 |
| 246 | func rk_find(buf: *u8, n: i64, from: i64, needle: *u8) -> i64 |
| 259 | func rk_js_str(out: *u8, pos: i64, src: *u8, n: i64) -> i64 |
| 275 | func rk_capture_wgsl(buf: *u8, ol: *i64) -> i64 |
| 291 | func rk_capture_layout(buf: *u8, ol: *i64) -> i64 |
| 295 | func rk_int_after(buf: *u8, n: i64, needle: *u8) -> i64 |
| 312 | func rk_uniform_offset(buf: *u8, n: i64, name: *u8) -> i64 |
| 331 | func rk_uniform_block(out: *u8, pos: i64) -> i64 |
| 373 | func rk_capture_world(buf: *u8, ol: *i64) -> i64 |
| 377 | func rk_world_span(buf: *u8, n: i64, begin: *u8, end: *u8, bo: *i64) -> i64 |
| 389 | func rk_world_block(out: *u8, pos: i64) -> i64 |
| 441 | func rk_capture_cast(buf: *u8, ol: *i64) -> i64 |
| 451 | func gpe_cast_identity(out:*u8,pos:i64,buf:*u8,n:i64,vo:*i64,fo:*i64)->i64 |
| 475 | func rk_lm_decimal(b:*u8,s:i64,e:i64)->i64 |
| 479 | func rk_lm_prop(b:*u8,s:i64,e:i64,key:*u8)->i64 |
| 486 | func rk_lm_row(b:*u8,s:i64,e:i64,r:*i64)->i64 |
| 502 | func rk_lm_null(out:*u8,pos:i64,name:*u8)->i64 |
| 507 | func rk_layout_obj(out:*u8,pos:i64,buf:*u8,n:i64,rowskey:*u8,sizekey:*u8,name:*u8)->i64 |
| 572 | func rk_cast_glsl(out:*u8,pos:i64,buf:*u8,n:i64)->i64 |
| 591 | func rk_eye_stage(out:*u8,pos:i64,buf:*u8,n:i64,begin:*u8,end:*u8,rc_key:*u8,name:*u8)->i64 |
| 599 | func rk_eye_block(out:*u8,pos:i64)->i64 |
| 629 | func rk_owned_new()->*NxBufOwned |
| 633 | func rk_owned_close(b:*NxBufOwned)->i64 |
| 637 | func rk_capture_cast_owned(b:*NxBufOwned)->i64 |
| 645 | func rk_cast_block(out: *u8, pos: i64) -> i64 |
| 685 | func rk_webgpu_door(out: *u8, pos: i64) -> i64 |
| 739 | func gpe_facing_key(t: *NxJsonTok, key: *u8) -> i64 |
| 746 | func gpe_facing_parse(raw: *u8, n: i64, values: *i64) -> i64 |
| 784 | func gpe_facing_policy(out: *u8, pos: i64) -> i64 |
| 800 | func gpe_gpu_timing_policy(out: *u8, pos: i64) -> i64 |
| 859 | func gpe_prepared_catalogue(out:*u8,pos:i64)->i64 |
| 874 | func gpe_visitors_gpu(out: *u8,pos: i64) -> i64 |
| 880 | func gpe_emit_webgpu(out: *u8, pos: i64) -> i64 |
| 916 | func gpe_verify(out: *u8, n: i64) -> i64 |
| 1088 | func gpe_num(out: *u8, pos: i64, v: i64) -> i64 |
| 1110 | func gpe_sunt(out: *u8, pos: i64) -> i64 |
| 1130 | func gpe_npcs_emit(out: *u8, pos: i64, vnum: i64) -> i64 |
| 1190 | func gpe_build(wasm: *u8, wn: i64, title: *u8, native: *u8, ctrl: *u8, vnum: i64, out: *u8) -> i64 |
| 1231 | func gpe_hstr_pts() -> i64 { return GPE_HSTR_WORDS_PER_STRAND/GPE_AXES } |
| 1232 | func gpe_hair_nseg() -> i64 { return gpe_hstr_pts() - 1 } |
| 1233 | func gpe_hair_seglen() -> i64 { return SD_Q8 } |
| 1241 | func gpe_hair_seed(st: *i64, n: i64, rigid: i64) -> i64 |
| 1282 | func gpe_hair_cycle(out: *i64) -> i64 |
| 1315 | func gpe_hair_cycle_at(slot: i64) -> i64 |
| 1347 | func gpe_hair_drive(t: i64) -> i64 |
| 1352 | func gpe_hair_frames() -> i64 { return GPE_HAIR_DRIVE_FRAMES } |
| 1360 | func gpe_hair_chain_bake(tbl: *i64, rigid: i64) -> i64 |
| 1446 | func gpe_dress_runtime(out: *u8, pos: i64) -> i64 |
| 1473 | func gpe_hair_runtime(out: *u8, pos: i64) -> i64 |
| 1531 | func gpe_hair_npc_doors(out: *u8, pos: i64) -> i64 |
| 1547 | func gpe_hair_geometry(out: *u8, pos: i64) -> i64 |
| 1599 | func gpe_garment_draw(out: *u8, pos: i64) -> i64 |
| 1608 | func gpe_vb_find(b: *u8, n: i64, pat: *u8, from: i64) -> i64 |
| 1632 | func gpe_version_badge(out: *u8, pos: i64) -> i64 |
| 1711 | func gpe_rd_board(path: *u8, dom: *u8, since: *u8, recent: *ReleaseRecent, counts: *i64, read: *i64) -> i64 |
| 1721 | func gpe_release_block(out: *u8, pos: i64) -> i64 |
| 1790 | func gpe_frame_hud(out: *u8, pos: i64) -> i64 |
| 1812 | func gpe_sky_atmos(out: *u8, p: i64, src: *u8) -> i64 |
| 1816 | func gpe_demand_lifecycle(out: *u8, p0: i64) -> i64 |
| 1820 | func gpe_build_s(wasm: *u8, wn: i64, title: *u8, native: *u8, ctrl: *u8, vnum: i64, seed: i64, spec: *u8, out: *u8) -> i64 |