code wiki / _hdl_build / nx_gx_firstbyte_gate.nx

nx_gx_firstbyte_gate.nx

buildroot/runtime/_hdl_build/nx_gx_firstbyte_gate.nx

13763 B260 linesdepth 3pulls 3 transitivereach 0 importersview sourcekind gate/prooftopic gx
docsdependenciesstructsconstsfunctions

about

nx_gx_firstbyte_gate.nx -- Gx re-grounding: the sovereign graphics stack proven FROM THE FIRST BYTE UP. One canvas, seven panels, each a rung of the chain -- byte0 marker / scanline gradient / framebuffer checksum / triangle raster (count vs analytic area) / z-buffer (near wins though far drawn LAST) / per-pixel lit sphere / SSS wrap vs clay -- then the PNG artifact's OWN first byte (0x89 magic) is read back and verified. Every rung is measured in-gate, not asserted; the composite PNG is the eyeball artifact. HONEST: the deeper rungs (GGX BRDF, browser compositing, PBR) stay in their own gates -- this is the trunk they stand on. license_tier: ORIGINAL expect_exit: 0

dependencies 1 imports · 0 importers

nx_png_write.nx nx_gx_firstbyte_gate.nx

imports: nx_png_write.nx

imported by: nobody (leaf or entry point)

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

main fb_puts fb_edge fb_isqrt fb_wrap nx_png_write_rgb sys_openat_wr sys_mmap sys_write pw_chunk pw_u32be sys_mmap ↻ sys_write ↻ sys_write ↻ pw_crc_block pw_adler32 sys_close fb_pn sys_read_file sys_openat_rd sys_lseek sys_mmap ↻ sys_read sys_close ↻

structs

none

consts

none

functions

10func fb_puts(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
11func fb_pn(v: i64) -> i64 { let b: *u8=sys_mmap(32) as *u8; var x: i64=v; var ng: i64=0; if x<0{ng=1;x=0-x} var i: i64=31; if x==0{b[i]=48 as u8;i=i-1} while x>0{b[i]=(48+x%10) as u8;x=x/10;i=i-1} if ng==1{b[i]=45 as u8;i=i-1} sys_write(1,(b as i64+i+1) as *u8,31-i); return 0 }
called by 1: main
12func fb_isqrt(n: i64) -> i64 { if n<=0 { return 0 } var x: i64=n; var y: i64=(x+n/x)/2; var it: i64=0; while it<64 { if y>=x { it=64 } else { x=y; y=(x+n/x)/2; it=it+1 } } return x }
called by 1: main
13func fb_edge(ax: i64, ay: i64, bx: i64, by: i64, px: i64, py: i64) -> i64 { return (bx-ax)*(py-ay)-(by-ay)*(px-ax) }
called by 1: main
14func fb_wrap(ndl: i64, w: i64, Q: i64) -> i64 { var v: i64=((ndl+w)*Q)/(Q+w); if v<0{v=0} if v>Q{v=Q} return v }
called by 1: main
16func main() -> i64