code wiki / _hdl_build / nx_room_diag.nx
nx_room_diag.nx
buildroot/runtime/_hdl_build/nx_room_diag.nx
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
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
structs
| none |
consts
| 26 | const DIAG_LOG: *u8 = "knowledge/status/room_diag.log" |
| 27 | const D_LOSS: i64 = 50 // > 5% packet loss = LOSSY |
| 28 | const D_JIT: i64 = 30 // > 30ms jitter = JITTERY |
| 29 | const D_RTT: i64 = 350 // > 350ms one-way-ish = high latency (overseas) |
| 30 | const D_UNDER: i64 = 70 // delivered < 70% of target = underserved |
| 33 | const P_OK: i64 = 0 |
| 34 | const P_STARVED: i64 = 1 |
| 35 | const P_LOSSY: i64 = 2 |
| 36 | const P_JITTERY: i64 = 3 |
| 37 | const P_CONGESTED: i64 = 4 |
| 38 | const P_UNDERSERVED: i64 = 5 |
functions
| 40 | func 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 } |
| 41 | func 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 } |
| 43 | func d_pname(code: i64) -> *u8 called by 1: main |
| 51 | func d_fix(code: i64) -> *u8 called by 1: main |
| 61 | func d_classify(loss: i64, jit: i64, rtt: i64, deliv: i64, tgt: i64, layer: i64) -> i64 called by 1: main |
| 83 | func main() -> i64 |