nx_cast_skin_wrap_gate_t261.nx source
↩ module page · 35 lines · 2802 B
1import "nx_game_page_integrated_t73.nx"
2import "nx_gate_verdict.nx"
3func sw_retain(path:*u8,buf:*u8,n:i64)->i64{
4 var prior_n:i64=0;let prior:*u8=sys_read_file(path,&prior_n)
5 if (prior as i64)>0{let same:i64=gpa_same(prior,prior_n,buf,n);sys_free_file(prior,prior_n);return same}
6 if fxc_create(path,buf,n)==n{return 1};return 0
7}
8func main()->i64{
9 let c:*i64=gv_ctr();let old:*NxBufOwned=rk_owned_new();let fresh:*NxBufOwned=rk_owned_new()
10 if (old as i64)<=0||(fresh as i64)<=0{return 3}
11 let a:i64=gsb_capture_selected_owned("/volume1/homes/elderwesto/nishihost/buildroot/_build/nx_cast_projection_expanded_t234.sov.elf","5c84fe5277e85db3a5e181f050043bbe4be7f085b24eb559d4beb18ee4563cb0",417606,"cast",old,RK_WGSL_TMO_MS,0)
12 let b:i64=gsb_capture_selected_owned("/volume1/homes/elderwesto/nishihost/buildroot/_build/nx_cast_skin_wrap_t261.sov.elf","8a503b9e5273b2923bd33e36f91f3e2479a951b1567538c3150843839fbf6fc7",417021,"cast",fresh,RK_WGSL_TMO_MS,0)
13 gv_check("actual pinned producers fully captured",a==0&&b==0&&old.len>0&&fresh.len>0,c)
14 if a!=0||b!=0||old.len<=0||fresh.len<=0{return 3}
15 let oi:i64=rk_find(old.buf,old.len,0,"--- castfs_glsl GLSL ---")
16 let ni:i64=rk_find(fresh.buf,fresh.len,0,"--- castfs_glsl GLSL ---")
17 gv_check("projection metadata and both vertex dialects unchanged",oi>0&&ni==oi&&gpa_same(old.buf,oi,fresh.buf,ni)==1,c)
18 gv_check("GLSL scalar wrap emitted",rk_find(fresh.buf,fresh.len,0,"vec3 w3=vec3(wr);")>=0,c)
19 gv_check("WGSL scalar wrap emitted",rk_find(fresh.buf,fresh.len,0,"var w3:vec3f=vec3f(wr);")>=0,c)
20 gv_check("old channel-separated body wrap absent",rk_find(fresh.buf,fresh.len,0,"0.469")<0&&rk_find(fresh.buf,fresh.len,0,"0.234")<0,c)
21 gv_check("existing wrap policy retained",rk_find(fresh.buf,fresh.len,0,"float wr=0.42;")>=0&&rk_find(fresh.buf,fresh.len,0,"var wr:f32=0.42;")>=0,c)
22 // Exact rational samples isolate diffuse terminator, without gamma, material tint or specular.
23 // ndl=-.2: old red and green remain positive while blue is clamped to zero.
24 gv_check("old RGB terminator defect reproduced",469-200>0&&234-200>0&&102-200<0,c)
25 var d:i64=-1000;var count:i64=0;var prior:i64=-1;var ok:i64=1
26 while d<=1000{
27 var q:i64=(d+420)*1000000/1420
28 if q<0{q=0};if q>1000000{q=1000000}
29 if q<prior{ok=0};prior=q;count=count+1;d=d+1
30 }
31 gv_check("existing scalar wrap bounded monotonic across normal-light domain",ok==1&&count==2001&&prior==1000000,c)
32 gv_check("candidate capture retained",sw_retain("/volume1/homes/elderwesto/nishihost/buildroot/knowledge/gates/cast-skin-wrap-t261.txt",fresh.buf,fresh.len)==1,c)
33 gv_kv("capture_bytes",fresh.len);rk_owned_close(old);rk_owned_close(fresh)
34 return gv_verdict("CAST-SKIN-WRAP",c,"shared native emission; scalar approximation not measured skin scattering; displacement normal gap retained")
35}