code wiki / _hdl_build / nx_swgpu_sota_census.nx
nx_swgpu_sota_census.nx source
↩ module page · 86 lines · 6756 B
1// nx_swgpu_sota_census.nx -- HONEST adversarial census: our sovereign SOFTWARE GPU (nx_swgpu + nx_sdfrender +
2// nx_png/nx_deflate_enc) vs render-SOTA, so we're MEASURED not optimistic (operator doctrine: no-wave, census,
3// liar-killed). Grades HAVE (organ+gate on disk) / PARTIAL / GAP across geometry, lighting, material, pipeline,
4// infra, sovereignty. LIAR-KILL: a fabricated "we do pore-level photoreal SSS today" cell must grade GAP.
5// license_tier: ORIGINAL expect_exit: 0
6import "nx_syscalls.nx"
7
8func cw(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 }
9func cn(v: i64) -> i64 {
10 let b: *u8 = sys_mmap(32) as *u8
11 var x: i64 = v
12 var i: i64 = 31
13 if x == 0 { b[i] = 48 as u8; i = i - 1 }
14 while x > 0 { b[i] = (48 + x % 10) as u8; x = x / 10; i = i - 1 }
15 sys_write(1, (b as i64 + i + 1) as *u8, 31 - i)
16 return 0
17}
18func gs(g: i64) -> *u8 {
19 if g == 2 { return "HAVE " as *u8 }
20 if g == 1 { return "PARTIAL" as *u8 }
21 return "GAP " as *u8
22}
23func row(t: *i64, cell: *u8, g: i64, ev: *u8) -> i64 {
24 cw(" ["); cw(gs(g)); cw("] "); cw(cell); cw("\n "); cw(ev); cw("\n" as *u8)
25 t[g] = t[g] + 1
26 return 0
27}
28
29func main() -> i64 {
30 let t: *i64 = sys_mmap(8 * 8) as *i64
31 cw("=== nx_swgpu_sota_census -- our sovereign SOFTWARE GPU vs render-SOTA (honest, adversarial) ===\n" as *u8)
32
33 cw("-- GEOMETRY --\n" as *u8)
34 row(t, "continuous organic surface " as *u8, 2, "HAVE: nx_sdfrender smooth-min union -> one fused surface (gate: trunk single-run). SOTA parity on smoothness" as *u8)
35 row(t, "high-poly / dense mesh detail " as *u8, 0, "GAP: SOTA uses 100k-1M tri meshes or high-res SDFs; ours = ~18 ellipsoid primitives (blob-level)" as *u8)
36 row(t, "face (eyes/nose/lips) + hands/feet " as *u8, 1, "PARTIAL: hands+feet as blobs; NO facial features. SOTA has full anatomy. THE biggest realism gap" as *u8)
37 row(t, "subdivision / displacement geo " as *u8, 1, "PARTIAL: nx_subdiv exists (watertight subdiv + displacement fields) but NOT wired into the SDF/raster path" as *u8)
38
39 cw("-- LIGHTING --\n" as *u8)
40 row(t, "per-pixel diffuse + specular " as *u8, 2, "HAVE: half-lambert diffuse + Blinn spec, per pixel (both renderers)" as *u8)
41 row(t, "soft shadows " as *u8, 2, "HAVE: nx_sdfrender shadow-ray march + IQ penumbra (gate: lum min dropped 153->18)" as *u8)
42 row(t, "ambient occlusion " as *u8, 2, "HAVE: SDF-normal AO sampling (crevice darkening)" as *u8)
43 row(t, "subsurface scattering (skin) " as *u8, 1, "PARTIAL: cheap terminator-warmth approx; SOTA = real multi-layer SSS / diffusion profile" as *u8)
44 row(t, "global illumination / bounce " as *u8, 0, "GAP: single direct light + ambient const; SOTA = path-traced/GI bounce, IBL from HDR env" as *u8)
45
46 cw("-- MATERIAL --\n" as *u8)
47 row(t, "base albedo + tone mottling " as *u8, 2, "HAVE: skin tone + low-freq mottling" as *u8)
48 row(t, "procedural surface bump " as *u8, 1, "PARTIAL: sine-octave normal perturb (micro-surface); SOTA = measured normal/height maps + pores" as *u8)
49 row(t, "texture maps (albedo/normal/rough) " as *u8, 0, "GAP: no UV texture sampling; SOTA = scanned skin maps. (We HAVE a raster tex path in nx_swgpu, unwired for skin)" as *u8)
50 row(t, "PBR metal/rough BRDF " as *u8, 0, "GAP: ad-hoc shader, not energy-conserving PBR (Cook-Torrance/GGX)" as *u8)
51
52 cw("-- PIPELINE / INFRA (where we are STRONG) --\n" as *u8)
53 row(t, "tiled rasterizer + SDF raymarcher " as *u8, 2, "HAVE: two full render paths, ours end-to-end (nx_swgpu + nx_sdfrender), gated" as *u8)
54 row(t, "our own image codec (PNG DEFLATE) " as *u8, 2, "HAVE: nx_deflate_enc round-trip-proven, 6.7x smaller, adaptive filtering -- a layer few 'engines' own" as *u8)
55 row(t, "full-res compressed output " as *u8, 2, "HAVE: 512x384 frames ship compressed (/swgpu LIVE 1.13MB, 12 frames)" as *u8)
56 row(t, "deterministic + VM-vettable " as *u8, 2, "HAVE: all-integer, byte-identical replays (no incumbent has this)" as *u8)
57 row(t, "programmable shaders (VM-executed) " as *u8, 1, "PARTIAL: nx_wasm_vm CAN execute per-pixel shader bytecode (our VM=the shader core) but NOT yet wired" as *u8)
58 row(t, "anti-aliasing " as *u8, 0, "GAP: 1 sample/pixel, hard edges; SOTA = MSAA/TAA/supersample" as *u8)
59 row(t, "real-time interactive @60fps " as *u8, 1, "PARTIAL: raster path is real-time (/charlab,/mineworld); SDF raymarch = offline (too heavy for 60fps in-browser yet)" as *u8)
60 row(t, "GPU-accelerated (real silicon) " as *u8, 0, "GAP: CPU/software only; Path B (our driver on NVIDIA/AMD/FPGA) is the pending endgame" as *u8)
61
62 cw("-- SOVEREIGNTY (where we WIN outright) --\n" as *u8)
63 row(t, "zero 3rd-party (lang->codec ours) " as *u8, 2, "HAVE: language, compiler, IR, rasterizer, raymarcher, shader-VM, OS, FPGA display, image codec -- ONE owner" as *u8)
64 row(t, "runs on NishiOS/Nishi-browser " as *u8, 2, "HAVE: the SAME code runs on our own OS/browser, no host GPU dependency" as *u8)
65
66 // liar-kill
67 let pre: i64 = t[2]
68 row(t, "pore-level PHOTOREAL SSS today (FAKE)" as *u8, 0, "we do a CHEAP subsurface approx + procedural bump, NOT scanned pore-level photoreal SSS -- if this grades HAVE the census lies" as *u8)
69 var liar_ok: i64 = 0
70 if t[2] == pre { liar_ok = 1 }
71
72 let cells: i64 = t[0] + t[1] + t[2]
73 let score: i64 = (t[2] * 2 + t[1]) * 500 / cells
74 cw("--- TALLY --- HAVE " as *u8); cn(t[2]); cw(" PARTIAL " as *u8); cn(t[1]); cw(" GAP " as *u8); cn(t[0])
75 cw(" cells " as *u8); cn(cells); cw(" score " as *u8); cn(score); cw("permille liar-kill=" as *u8)
76 if liar_ok == 1 { cw("YES\n" as *u8) } else { cw("NO -- INVALID\n" as *u8) }
77 cw("VERDICT (honest): we are STRONG on pipeline/infra/sovereignty (own codec, deterministic, two render\n" as *u8)
78 cw(" paths, zero-3rd-party) and MID on lighting (shadows+AO+spec HAVE, SSS+GI weak). We are WEAK on the\n" as *u8)
79 cw(" things that read as 'photoreal': dense/anatomical GEOMETRY (face/hands, high-poly), TEXTURE MAPS,\n" as *u8)
80 cw(" PBR, and ANTI-ALIASING. The engine is capable; the CHARACTER is blob-level.\n" as *u8)
81 cw("HIGHEST-LEVERAGE NEXT (visible-realism order): 1) FACE + hands/feet geometry (close-up is where\n" as *u8)
82 cw(" photoreal is judged) 2) anti-aliasing (supersample) 3) texture-map sampling on skin 4) PBR BRDF\n" as *u8)
83 cw(" 5) programmable shaders via nx_wasm_vm (the UNIQUE sovereign move) 6) Path B GPU exec (real-time+silicon).\n" as *u8)
84 if liar_ok == 1 { return 0 }
85 return 1
86}