code wiki / (root) / nx_body_artifact_identity_t60.nx

nx_body_artifact_identity_t60.nx source

↩ module page · 19 lines · 1250 B

1import "nx_authored_cast_artifact_gate_t55.nx" 2import "nx_game_page_artifact_lib.nx" 3func identity_text(path:*u8)->i64{ 4 let n:*i64=sys_mmap(8) as *i64;let b:*u8=sys_read_file(path,n);if (b as i64)<=0{return 3} 5 let hash:*u8=sys_mmap(GPA_SHA_HEX+1);gpa_sha(b,n[0],hash);let num:*u8=sys_mmap(WG_NUMBUF);let z:i64=eb_num(num,0,WG_NUMBUF,n[0]);num[z]=0 as u8 6 wg_puts("artifact|");wg_puts(path);wg_puts("|bytes=");wg_puts(num);wg_puts("|sha256=");wg_puts(hash);wg_puts("\n");sys_free_file(b,n[0]);return 0 7} 8func main()->i64{ 9 let m:*i64=sir_new();shsrc_cast_vs(m) 10 let out:*u8=sys_mmap(WG_EMIT_CAP);let tr:*i64=sys_mmap(WG_TRACE_CAP*8) as *i64;let tn:*i64=sys_mmap(8) as *i64 11 let n:i64=wgsl_emit_module(m,STAGE_VERTEX,out,WG_EMIT_CAP,tr,WG_TRACE_CAP,tn) 12 if m[M_OVER]!=0||n<=0{return 3} 13 if am_write("/tmp/nx_cast_authored_t60_vs.wgsl",out,n)!=0{return 4} 14 if identity_text("/tmp/nx_cast_authored_t60_vs.wgsl")!=0{return 5} 15 if identity_text("/tmp/nx_imported_body_t49.wasm")!=0{return 6} 16 if identity_text("/tmp/nx_imported_body_shared_t49.wasm")!=0{return 7} 17 if identity_text("runtime/_hdl_build/nx_wasm_craft_imported_body_t49.nx")!=0{return 8} 18 wg_puts("PASS exact retained artifact identities; GPU transform execution unqualified\n");return 0 19}