code wiki / (root) / nx_nxa_stream_emit.nx

nx_nxa_stream_emit.nx

buildroot/runtime/nx_nxa_stream_emit.nx

11910 B63 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind tooltopic nxa
docsdependenciesstructsconstsfunctions

about

nx_nxa_stream_emit.nx -- SOVEREIGN STREAMING NXA viewer emitter. The embedded-base64 viewer (nx_nxa_view_emit) proves small models; this one emits a page that FETCHES the .nxa over HTTP with live progress, verifies every checksum in the browser (exact 64-bit rolling check done in two 32-bit Number lanes -- no BigInt in the hot loop, ~10x faster on 9M-word files), auto- detects the model's up axis, and renders MILLIONS of triangles in WebGL2 at device resolution. This is the modern-polygon-count path: the file is served, not embedded, so size is unbounded. The edge serves static files only up to ~4MB (measured: 4MB=200, 8MB=500), so big NXAs ship as 4MB parts (<url>.pNN) the page refetches and reassembles -- transport chunking, the format bytes untouched. nparts=1 means a single unsplit fetch. INTEROP SYNC LAW: the page carries <meta name="nishi-nxa"> -- third-party browsers run the emitted JS/WebGL2; the NISHI BROWSER reads the marker and renders the NXA NATIVELY instead. usage: nx_nxa_stream_emit <out.html> <title> <nxa-url-base> <nparts> <total-bytes> license_tier: ORIGINAL

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_nxa_stream_emit.nx

imports: nx_syscalls.nx

imported by: nobody (leaf or entry point)

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

main nse_w sys_write sys_mmap nse_ap sys_openat_wr sys_write ↻ sys_close nse_num sys_mmap ↻ sys_write ↻

structs

none

consts

16const NSE_OUT_CAP: i64 = 1048576

functions

18func nse_ap(out: *u8, pos: i64, s: *u8) -> i64
called by 1: main
24func nse_w(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 1: main calls 1: sys_write
25func nse_num(v: i64) -> i64
called by 1: main calls 2: sys_mmapsys_write
37func main(argc: i64, argv: *i64) -> i64