code wiki / _hdl_build / nx_room_diag.nx

nx_room_diag.nx

buildroot/runtime/_hdl_build/nx_room_diag.nx

7567 B157 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind tooltopic room
docsdependenciesstructsconstsfunctions

about

nx_room_diag.nx -- X-ROOM: sovereign DETERMINISTIC multi-party room DIAGNOSTIC -- the "WHERE DOES IT SUCK" analyzer. When you test a room with real people, raw "it's choppy" is useless; this ingests per-PARTICIPANT per-tick metrics and pinpoints each person's DOMINANT problem AND the subsystem that fixes it, then ranks worst-first. Per participant columns: [loss_pm, jitter_ms, rtt_ms, delivered_kbps, target_kbps, layer]. Classifier (data-driven thresholds, rule 11) -> a PROBLEM CODE + a FIX subsystem: STARVED (layer==0, no video) -> nx_room_sfu (fairness allocation) LOSSY (loss_pm > LOSS thresh) -> nx_room_fec / nx_room_red JITTERY (jitter_ms > JIT thresh) -> nx_room_jitterbuf CONGESTED (delivered << target AND high rtt) -> nx_room_bwe UNDERSERVED (delivered << target) -> nx_room_simulcast / abr OK (none) -> - Severity ranks dimensions so the ONE thing most worth fixing surfaces first. EXCEED axis (honest): turns a live test into an ACTIONABLE, audit-replayable bottleneck report mapped to the exact sovereign fix -- not a vague "bad call". This is the SENSE layer the self-improving room loop needs. HONEST SCOPE: the analyzer; the live daemon + client must EMIT these per-participant samples (the instrumentation wiring) for a real test -- that is the next deploy step. main() is the SELF-VALIDATING GATE. Evidence -> knowledge/status/room_diag.log. license_tier: ORIGINAL

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_room_diag.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 d_classify dw sys_write dwn sys_mmap ↻ sys_write ↻ d_pname d_fix sys_openat_append sys_close sys_exit

structs

none

consts

26const DIAG_LOG: *u8 = "knowledge/status/room_diag.log"
27const D_LOSS: i64 = 50 // > 5% packet loss = LOSSY
28const D_JIT: i64 = 30 // > 30ms jitter = JITTERY
29const D_RTT: i64 = 350 // > 350ms one-way-ish = high latency (overseas)
30const D_UNDER: i64 = 70 // delivered < 70% of target = underserved
33const P_OK: i64 = 0
34const P_STARVED: i64 = 1
35const P_LOSSY: i64 = 2
36const P_JITTERY: i64 = 3
37const P_CONGESTED: i64 = 4
38const P_UNDERSERVED: i64 = 5

functions

40func dw(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
41func dwn(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;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
43func d_pname(code: i64) -> *u8
called by 1: main
51func d_fix(code: i64) -> *u8
called by 1: main
61func d_classify(loss: i64, jit: i64, rtt: i64, deliv: i64, tgt: i64, layer: i64) -> i64
called by 1: main
83func main() -> i64