code wiki / _hdl_build / nx_anat_sov.nx

nx_anat_sov.nx

buildroot/runtime/_hdl_build/nx_anat_sov.nx

61323 B1094 linesdepth 4pulls 4 transitivereach 0 importersview sourcekind tool
docsdependenciesstructsconstsfunctions

about

nx_anat_sov.nx -- ★SOVEREIGN NishiLang render of the 8-layer anatomical being (NXMSH2), the PRODUCT half of GX-11: the integer twin of the CUDA benchmark (/world/anatomy_gpu). 100% integer, own f32 decoder, own barycentric z-buffer rasterizer, own PNG -- NO CUDA, NO GPU, NO 3rd-party. Measured against the CUDA reference by the SAME invariants: intact occludes the interior, explode shows all 8 systems, stereo has horizontal disparity. Stereo is OFF-AXIS (parallel, convergence at the model) -- an UPGRADE over the benchmark's toe-in (no keystone). Reads knowledge/being_full.nxmesh; writes a PNG + a JSON stats line. nx_anat_sov <mesh> <intact|explode|skin|layerN> <C|L|R> <W> <H> <out.png> license_tier: ORIGINAL expect_exit: 0

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_png.nx nx_anat_sov.nx

imports: nx_syscalls.nxnx_png.nx

imported by: nobody (leaf or entry point)

call flow from main pre-order; caps 40 nodes / depth 6 declared; ↻ = already shown

main as_hw sys_write as_satoi as_set_perfusion sys_mmap nxa_die sys_write ↻ sys_exit nxa_lock_take nxa_lock_addr sys_write ↻ nxa_lock_give nxa_lock_addr ↻ nxa_report_overrun sys_write ↻ nxa_dump_printable sys_write ↻ nxa_dump_sizes sys_write ↻ as_sin_fill as_wrap sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_munmap sys_close as_rdbits as_streq as_f32mul as_rdbits ↻ as_set_body_span tx_vnoise tx_floordiv tx_h3 tx_lerp as_isqrt as_max

structs

none

consts

11const AS_LIGHT_FALLOFF_K: i64 = 40000
12const AS_PERFUSION_DEN: i64 = 100000
13const AS_BHASKARA_K: i64 = 40500
14const AS_F32_MANT_MASK: i64 = 8388607
15const AS_F32_MANT_SCALE: i64 = 8388608
16const AS_HASH_P1: i64 = 73856093
17const AS_HASH_P2: i64 = 19349663
18const AS_HASH_P3: i64 = 83492791
19const AS_I32_MAX: i64 = 2147483647
20const AS_NOISE_A: i64 = 15731
21const AS_NOISE_B: i64 = 789221
22const AS_NOISE_C: i64 = 1376312589
23const AS_Q16_ONE: i64 = 65536
24const AS_MAGIC_2000000000: i64 = 2000000000
25const AS_KEY_LIGHT_X: i64 = 5423
26const AS_KEY_LIGHT_Y: i64 = 9487
27const AS_KEY_LIGHT_Z: i64 = 12206
28const AS_FILL_LIGHT_X: i64 = 10160
29const AS_FILL_LIGHT_Y: i64 = 4064
30const AS_FILL_LIGHT_Z: i64 = 12190
31const AS_LIT_CEIL: i64 = 1280
32const AS_Q10_ONE: i64 = 1024
39const AS_POSQ0: i64 = 4096
40const AS_TARGET: i64 = 200000
41const AS_ZFAR: i64 = 2000000000
42const AS_Q14: i64 = 16384
47const AS_ARGV_LAST_REQUIRED: i64 = 6
48const AS_ARGC_MIN: i64 = AS_ARGV_LAST_REQUIRED + 1
49const AS_EXIT_USAGE: i64 = 3 // 0 ok - 2 operational (cannot read mesh) - 3 usage, the estate's usage/SKIP code
306const AS_AO_STRENGTH: i64 = 140 // occ 8/8 attenuates to (256-140)/256 before the floor below
307const AS_AO_ATT_FLOOR: i64 = 64 // never crush a cavity to black (the donor's floor, kept)

functions

61func as_set_perfusion(p: i64) -> i64
called by 1: main
68func as_get_perfusion() -> i64 { return AS_PERF }
87func as_set_body_span(ymin: i64, ymax: i64, xctr: i64, xhalf: i64) -> i64
called by 1: main
110func as_rdint(b: *u8, pos: *i64, end: i64) -> i64
called by 1: as_load_sites
132func as_load_sites() -> i64
180func as_anchor_sf(i: i64) -> i64 { let a: *i64 = AS_ASF as *i64; return a[i] }
called by 1: as_flush_thresh
181func as_anchor_th(i: i64) -> i64 { let a: *i64 = AS_ATH as *i64; return a[i] }
called by 1: as_flush_thresh
185func as_flush_thresh(sf: i64, latp: i64) -> i64
208func as_streq(a: *u8, b: *u8) -> i64
called by 1: main
214func as_satoi(s: *u8) -> i64
called by 1: main
220func as_hw(s: *u8) -> i64 { var n: i64 = 0; while s[n] != (0 as u8) { n = n+1 } sys_write(1, s, n); return 0 }
called by 2: as_load_sitesmain calls 1: sys_write
221func as_pn(v: i64) -> i64
called by 1: main calls 2: sys_mmapsys_write
230func as_rdbits(b: *u8, o: i64) -> i64
called by 2: as_f32mulmain
234func as_f32mul(b: *u8, o: i64, mul: i64) -> i64
called by 1: main calls 1: as_rdbits
247func as_isqrt(v: i64) -> i64 { if v <= 0 { return 0 } var x: i64 = v; var y: i64 = (x+1)/2; while y < x { x = y; y = (x + v/x)/2 } return x }
called by 1: main
252func tx_h3(ix: i64, iy: i64, iz: i64) -> i64
called by 1: tx_vnoise
258func tx_floordiv(x: i64, s: i64) -> i64 { var q: i64 = x/s; if x < 0 { if x % s != 0 { q = q - 1 } } return q }
called by 1: tx_vnoise
259func tx_lerp(a: i64, b: i64, t8: i64) -> i64 { return a + (b-a)*t8/256 }
called by 1: tx_vnoise
260func tx_vnoise(x: i64, y: i64, z: i64, s: i64) -> i64
called by 2: tx_fbmmain calls 3: tx_floordivtx_h3tx_lerp
272func tx_fbm(x: i64, y: i64, z: i64) -> i64
called by 1: main calls 1: tx_vnoise
282func as_sin_fill(t: *i64) -> i64
called by 1: main
287func as_wrap(d: i64) -> i64 { var x: i64 = d % 360; if x < 0 { x = x + 360 } return x }
called by 1: main
288func as_min(a: i64, b: i64) -> i64 { if a < b { return a } return b }
called by 1: main
289func as_max(a: i64, b: i64) -> i64 { if a > b { return a } return b }
called by 1: main
310func as_boxblur(src: *i64, tmp: *i64, dst: *i64, N: i64, r: i64) -> i64
called by 1: main
350func as_ssao(fb: *i64, zb: *i64, lb: *i64, W2: i64, H2: i64) -> i64
called by 1: main calls 1: sys_mmap
428func as_dof(fb: *i64, zb: *i64, lb: *i64, W2: i64, H2: i64) -> i64
called by 1: main calls 1: sys_mmap
499func main(argc: i64, argv: *i64) -> i64