code wiki / _hdl_build / nx_room_sfu.nx

nx_room_sfu.nx

buildroot/runtime/_hdl_build/nx_room_sfu.nx

7413 B136 linesdepth 2pulls 2 transitivereach 0 importersview sourcekind tooltopic room
docsdependenciesstructsconstsfunctions

about

nx_room_sfu.nx -- X-ROOM (GEN-ROOM-sfu-selective-forward): sovereign DETERMINISTIC SFU bandwidth ALLOCATOR -- the selective-forwarding intelligence of a multi-party video room, benchmarked HEAD-TO-HEAD against Jitsi Videobridge's PUBLISHED algorithm. RESEARCH-GROUNDED (jitsi-videobridge/doc/allocation.md + BandwidthAllocator.kt): Jitsi orders sources by speech activity (dominant speaker first), applies last-N (sources beyond N get maxHeight=0), then runs an ITERATIVE GREEDY allocation: loop sources in priority order, improve() each to its highest affordable layer before moving on. Jitsi's doc ADMITS: "No explicit fairness mechanism ensures equal distribution among same-priority sources." => under constrained bandwidth the greedy pass STARVES lower-priority participants (0 layers = NO video for that person). EXCEED axis (honest, measured): same last-N + dominant-speaker ordering, but a BASE-LAYER FAIRNESS guarantee FIRST (every in-frame participant gets the base layer if the budget covers all bases), THEN prioritized improvement with the remainder. Result at the SAME bandwidth: NO starvation (everyone visible) where Jitsi's greedy leaves several participants with no video at all -- plus deterministic + audit- replayable (same inputs -> same allocation, which a runtime-BWE greedy cannot promise). HONEST SCOPE: allocation algorithm head-to-head (fairness/determinism); NOT a throughput bench on Jitsi's hardware (Xeon E5-1620v2, 1056 streams/550Mbps/20% CPU). main() is the SELF-VALIDATING GATE. Evidence -> knowledge/status/room_sfu.log. license_tier: ORIGINAL

dependencies 1 imports · 0 importers

nx_syscalls.nx nx_room_sfu.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 sfu_alloc sfu_visible sfu_total uw sys_write uwn sys_mmap ↻ sys_write ↻ sys_openat_append sys_close sys_exit

structs

none

consts

26const SFU_LOG: *u8 = "knowledge/status/room_sfu.log"

functions

28func uw(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
29func uwn(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
35func sfu_alloc(base: i64, mid: i64, high: i64, N: i64, last_n: i64, budget: i64, mode: i64, alloc: *i64) -> i64
called by 1: main
70func sfu_total(alloc: *i64, N: i64) -> i64
called by 1: main
76func sfu_visible(alloc: *i64, N: i64) -> i64 { // #endpoints getting ANY video
called by 1: main
83func main() -> i64