nx_gen3d_sota_fetch.nx source
↩ module page · 77 lines · 5487 B
1// nx_gen3d_sota_fetch.nx -- DEEP SOTA for GENERATIVE 3D (operator 2026-07-04: the ecosystem must EMIT the
2// designs -- Z-Image ingested as i2mesh + t2mesh for many objects -- NOT hand-crafted one-offs; ground it,
3// not wikipedia). Banks the REAL image-to-3D / text-to-3D literature + reference code + leaderboards: the
4// generators (DreamFusion/Point-E/Shap-E/GET3D), the fast single-image reconstructors (Zero-1-to-3/One-2-3-45/
5// LRM/TripoSR/InstantMesh), and the extraction/representation backbone. Same sovereign stack as
6// nx_voicegen_sota_fetch. Saves knowledge/fetched/g3d_*.raw. expect_exit: 0 license_tier: ORIGINAL
7import "nx_syscalls.nx"
8import "nx_x509_trust_store.nx"
9import "nx_trust_store_load_from_certdata.nx"
10import "nx_https_fetch_follow.nx"
11const K_MAGIC_4194304: i64 = 4194304
12const K_MAGIC_8388608: i64 = 8388608
13
14func g3_puts(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n + 1 } sys_write(1, s, n); return 0 }
15func g3_putn(v: i64) -> i64 {
16 if v == 0 { sys_write(1, "0" as *u8, 1); return 0 }
17 var m: i64 = v
18 if m < 0 { sys_write(1, "-" as *u8, 1); m = 0 - m }
19 let d: *u8 = sys_mmap(24); var k: i64 = 0
20 while m > 0 { d[k] = (48 + (m % 10)) as u8; m = m / 10; k = k + 1 }
21 var j: i64 = k - 1
22 while j >= 0 { sys_write(1, ((d as i64)+j) as *u8, 1); j = j - 1 }
23 return 0
24}
25func have_file(path: *u8) -> i64 { let fd: i64 = sys_openat_rd(path); if fd < 0 { return 0 } sys_close(fd); return 1 }
26func fetch_save(url: *u8, opath: *u8, store: *TrustStore, out: *u8, cap: i64) -> i64 {
27 if have_file(opath) == 1 { g3_puts(opath); g3_puts(" [have-skip]\n"); return 1 }
28 let status: *i64 = sys_mmap(8) as *i64
29 let n: i64 = nx_https_fetch_follow(url, store, out, cap, 6, status)
30 g3_puts(url); g3_puts(" status="); g3_putn(status[0]); g3_puts(" bytes="); g3_putn(n)
31 if n <= 0 { g3_puts(" FETCH-FAIL\n"); return 0 }
32 var gz: i64 = 0
33 if n >= 2 { if out[0] == 0x1f as u8 { if out[1] == 0x8b as u8 { gz = 1 } } }
34 if gz == 1 { g3_puts(" [GZIP-skip]\n"); return 0 }
35 let fd: i64 = sys_openat_wr(opath, 0x1a4)
36 if fd < 0 { g3_puts(" SAVE-FAIL\n"); return 0 }
37 sys_write(fd, out, n); sys_close(fd)
38 g3_puts(" SAVED\n")
39 return 1
40}
41
42func main() -> i64 {
43 let r: i64 = nx_trust_store_load_from_certdata("data/mozilla_certdata.txt" as *u8, 512, K_MAGIC_4194304)
44 if r <= 0 { g3_puts("G3D: certdata load failed\n"); return 1 }
45 let store: *TrustStore = r as *TrustStore
46 g3_puts("CA roots="); g3_putn(trust_store_count(store)); g3_puts("\n")
47 let cap: i64 = K_MAGIC_8388608
48 let out: *u8 = sys_mmap(cap)
49 var ok: i64 = 0
50
51 g3_puts("== TEXT-to-3D generators (t2mesh: prompt -> geometry, many objects) ==\n")
52 ok = ok + fetch_save("https://arxiv.org/abs/2209.14988" as *u8, "knowledge/fetched/g3d_dreamfusion.raw" as *u8, store, out, cap) // DreamFusion (SDS)
53 ok = ok + fetch_save("https://arxiv.org/abs/2212.08751" as *u8, "knowledge/fetched/g3d_pointe.raw" as *u8, store, out, cap) // Point-E
54 ok = ok + fetch_save("https://arxiv.org/abs/2305.02463" as *u8, "knowledge/fetched/g3d_shape.raw" as *u8, store, out, cap) // Shap-E
55 ok = ok + fetch_save("https://arxiv.org/abs/2209.11163" as *u8, "knowledge/fetched/g3d_get3d.raw" as *u8, store, out, cap) // GET3D (textured meshes)
56
57 g3_puts("== IMAGE-to-3D reconstructors (i2mesh: our Z-Image -> mesh) ==\n")
58 ok = ok + fetch_save("https://arxiv.org/abs/2303.11328" as *u8, "knowledge/fetched/g3d_zero123.raw" as *u8, store, out, cap) // Zero-1-to-3
59 ok = ok + fetch_save("https://arxiv.org/abs/2306.16928" as *u8, "knowledge/fetched/g3d_one2345.raw" as *u8, store, out, cap) // One-2-3-45
60 ok = ok + fetch_save("https://arxiv.org/abs/2311.04400" as *u8, "knowledge/fetched/g3d_lrm.raw" as *u8, store, out, cap) // LRM (large reconstruction model)
61 ok = ok + fetch_save("https://arxiv.org/abs/2403.02151" as *u8, "knowledge/fetched/g3d_triposr.raw" as *u8, store, out, cap) // TripoSR (fast single-image)
62 ok = ok + fetch_save("https://arxiv.org/abs/2404.07191" as *u8, "knowledge/fetched/g3d_instantmesh.raw" as *u8, store, out, cap) // InstantMesh
63
64 g3_puts("== REFERENCE CODE (README = arch/deps/extraction backbone) ==\n")
65 ok = ok + fetch_save("https://raw.githubusercontent.com/threestudio-project/threestudio/main/README.md" as *u8, "knowledge/fetched/g3d_threestudio.raw" as *u8, store, out, cap)
66 ok = ok + fetch_save("https://raw.githubusercontent.com/VAST-AI-Research/TripoSR/main/README.md" as *u8, "knowledge/fetched/g3d_triposr_code.raw" as *u8, store, out, cap)
67 ok = ok + fetch_save("https://raw.githubusercontent.com/openai/shap-e/main/README.md" as *u8, "knowledge/fetched/g3d_shape_code.raw" as *u8, store, out, cap)
68
69 g3_puts("== papers-with-code (measured leaderboards) ==\n")
70 ok = ok + fetch_save("https://paperswithcode.com/task/image-to-3d" as *u8, "knowledge/fetched/g3d_pwc_i2m.raw" as *u8, store, out, cap)
71 ok = ok + fetch_save("https://paperswithcode.com/task/text-to-3d" as *u8, "knowledge/fetched/g3d_pwc_t2m.raw" as *u8, store, out, cap)
72
73 g3_puts("gen3D SOTA: fetched/have="); g3_putn(ok); g3_puts(" / 14\n")
74 if ok >= 9 { g3_puts("verdict=GREEN (real i2mesh/t2mesh papers+code+leaderboard on disk; grep knowledge/fetched/g3d_*.raw)\n"); sys_exit(0); return 0 }
75 g3_puts("verdict=PARTIAL (re-run to resume; some hosts may block -> note which)\n")
76 sys_exit(1); return 1
77}