code wiki / _hdl_build / nx_room_bw_measure.nx

nx_room_bw_measure.nx

buildroot/runtime/_hdl_build/nx_room_bw_measure.nx

6824 B124 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind tooltopic room
docsdependenciesstructsconstsfunctions

about

nx_room_bw_measure.nx -- MEASURED root-cause + optimization for the 9fps (operator: live perf for optimization). nx_vroom_loadtest proved the DAEMON does 1538fps -> not the bottleneck. The bottleneck is UPLINK BANDWIDTH: the live client sends a FULL canvas-JPEG every frame (all I-frames). ~9fps x ~20KB = ~1.4Mbps = a saturated uplink. A talking head is mostly STATIC, so the fix is INTER-FRAME coding: send only what changed. MEASURED on a synthetic talking-head (static bg + moving face): 4x4 WHT + quant of (A) the FULL block vs (B) the inter-frame RESIDUAL, counting nonzero coeffs => bytes/frame, then the FPS each achieves on the same uplink. Honest: synthetic content + a real transform/bytes model. Evidence -> knowledge/status/room_bw_measure.log. license_tier: ORIGINAL

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_room_bw_measure.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 sys_mmap synth meas blk_bytes wht_nz bw sys_write bn sys_mmap ↻ sys_write ↻ sys_openat_append sys_close sys_exit

structs

none

consts

10const BW_MAGIC_2500: i64 = 2500
11const BW_MAGIC_1000000: i64 = 1000000
13const BW_LOG: *u8 = "knowledge/status/room_bw_measure.log"

functions

15func bw(fd: i64, s: *u8) -> i64 { var n: i64=0; while s[n]!=(0 as u8){n=n+1} sys_write(fd,s,n); return 0 }
called by 1: main calls 1: sys_write
16func bn(fd: i64, v: i64) -> i64 { let bb: *u8=sys_mmap(28); var m: i64=v; if m<0{m=0-m;sys_write(fd,"-" as *u8,1)} let t: *u8=sys_mmap(28); var k: i64=0; if m==0{t[0]=48 as u8;k=1} while m>0{t[k]=(48+(m%10)) as u8;m=m/10;k=k+1} var i: i64=0; while i<k{bb[i]=t[k-1-i];i=i+1} sys_write(fd,bb,k); return 0 }
called by 1: main calls 2: sys_mmapsys_write
19func wht_nz(B: *i64, tmp: *i64, T: *i64, QSTEP: i64) -> i64
called by 1: meas
28func blk_bytes(nz: i64) -> i64 { if nz==0 { return 0 } return 1 + nz*2 }
called by 1: meas
31func synth(cur: *i64, W: i64, H: i64, f: i64) -> i64
called by 1: main
50func meas(cur: *i64, prev: *i64, W: i64, BX: i64, BY: i64, QSTEP: i64, Bf: *i64, Bd: *i64, tmp: *i64, T: *i64, res: *i64) -> i64
called by 1: main calls 2: blk_byteswht_nz
66func main() -> i64