code wiki / _hdl_build / nx_vrframe.nx

nx_vrframe.nx

buildroot/runtime/_hdl_build/nx_vrframe.nx

10697 B238 linesdepth 4pulls 4 transitivereach 0 importersview sourcekind orphan library
docsdependenciesstructsconstsfunctions

about

nx_vrframe.nx -- F1106 VR-RUNTIME RUNG 1: the SOVEREIGN VR COMPOSITOR FRAME (operator 2026-08-10: "do you know how to actually build a vr hot and virtamate" -> the one honest GAP is the headset runtime; stereo already exists 4/4). This organ produces the SUBMIT-READY frame a VR compositor hands to a headset: two eye views with horizontal parallax (off-axis pinhole per eye) THROUGH the OpenXR-standard radial LENS PRE-DISTORTION (barrel warp r' = r*(1+k1*r^2+k2*r^4)), so the pincushion lens un-warps it to rectilinear -- the characteristic rounded VR frame with black corners. NEVER-BRICK BY CONSTRUCTION (Rule 26): pure compute + ONE regular-file PNG write. It touches NO device/firmware/CMOS/vBIOS namespace -- there is no code path here that can write persistent hardware state, and the gate proves the output sink is a regular knowledge/sites path, never /dev|/sys|/proc. Scene is a deterministic 3D depth test (receding checker floor + depth-sorted pillars) chosen because stereo/lens correctness is what rung 1 proves; the SUBJECT (a VaM-class figure) composes later off the certified body lane. Emits knowledge/nx_vrframe.png (1024x512 L|R) + sites/nishifamily/world/vrframe.png. license_tier: ORIGINAL No hw writes (Rule 26). expect_exit: 0

dependencies 2 imports · 0 importers

nx_syscalls.nx nx_png.nx nx_vrframe.nx

imports: nx_syscalls.nxnx_png.nx

imported by: nobody (leaf or entry point)

structs

none

consts

16const VF_MAGIC_374761393: i64 = 374761393
17const VF_MAGIC_668265263: i64 = 668265263
18const VF_MAGIC_1274126177: i64 = 1274126177
19const VF_MAGIC_1180: i64 = 1180
20const VF_MAGIC_1600: i64 = 1600
21const VF_MAGIC_2100: i64 = 2100
22const VF_MAGIC_2900: i64 = 2900
24const VF_EW: i64 = 384
25const VF_EH: i64 = 384
26const VF_FOCAL: i64 = 420
27const VF_CAMY: i64 = 165 // eye height above the floor (world units)
28const VF_IPD: i64 = 62 // half interpupillary offset in world units (per eye, +/-)
29const VF_FX: i64 = 1024 // fixed-point unit for the distortion polynomial
30const VF_K1: i64 = 120 // barrel radial coefficients (pincushion-lens inverse)
31const VF_K2: i64 = 40
32const VF_TILE: i64 = 130 // floor checker tile (world units)
33const VF_65536: i64 = 65536

functions

35func vw2(s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(1,s,n); return 0 }
36func vn2(v: i64) -> i64
46func vf_clamp(v: i64, lo: i64, hi: i64) -> i64 { if v<lo {return lo} if v>hi {return hi} return v }
47func vf_pack(r: i64, g: i64, b: i64) -> i64
50func vf_hash(a: i64, b: i64) -> i64
59func vf_np() -> i64 { return 6 }
60func vf_pill(i: i64, k: i64) -> i64
73func vf_render_eye(eyeX: i64, out: *i64, px: *i64) -> i64
158func vf_distort(src: *i64, dst: *i64, distort: i64) -> i64
188func vf_build(distort: i64, outpath: *u8) -> i64
216func main(argc: i64, argv: *i64) -> i64