code wiki / _hdl_build / nx_room_bwe.nx
nx_room_bwe.nx
buildroot/runtime/_hdl_build/nx_room_bwe.nx
about
nx_room_bwe.nx -- X-ROOM (overseas-grade): sovereign DETERMINISTIC delay-gradient
BANDWIDTH ESTIMATOR / CONGESTION CONTROLLER (Google-Congestion-Control style). The
estimator nx_room_abr rides on: ABR picks a quality layer, but only as well as the
bandwidth estimate it is given. On a variable-bandwidth intercontinental link, a
DELAY-based detector senses a building queue from RISING one-way delay and backs off
BEFORE any packet is lost -- whereas a loss-based controller only reacts AFTER the
overseas queue has already overflowed (by which point latency has spiked).
MODEL: per packet-group, m[i] = inter-group one-way-delay gradient (ms; >0 = queue
growing). Overuse detector: acc accumulates positive gradients, drains on flat/neg;
acc>thresh => OVERUSE (signal rate DECREASE) detected at the delay rise. A separate
loss flag marks where a loss-based controller would FIRST react.
EXCEED axis (honest) vs loss-based congestion control: PROACTIVE -- the delay detector
fires strictly EARLIER than the loss event on the same trace (measured lead), and is
deterministic + audit-replayable + sovereign. HONEST SCOPE: a simplified accumulator
overuse detector (the GCC trendline+adaptive-threshold + rate AIMD = deeper rung).
main() is the SELF-VALIDATING GATE. Evidence -> knowledge/status/room_bwe.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
| 22 | const BWE_MAGIC_100000: i64 = 100000 |
| 24 | const BWE_LOG: *u8 = "knowledge/status/room_bwe.log" |
functions
| 26 | func 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 } |
| 27 | func bwn(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 } |
| 31 | func bwe_run(m: *i64, lossf: *i64, N: i64, thresh: i64, drain: i64, out: *i64) -> i64 called by 1: main |
| 48 | func main() -> i64 |