code wiki / _hdl_build / nx_room_resilience.nx
nx_room_resilience.nx
buildroot/runtime/_hdl_build/nx_room_resilience.nx
about
nx_room_resilience.nx -- MEASURED head-to-head: sovereign proactive FEC vs the
incumbent ARQ/NACK-retransmit recovery model (WebRTC/Zoom/Teams video default),
on an intercontinental link. Converts the room census's "loss-resilience =
BEHIND/unclaimed (no incumbent baseline)" into a MEASURED, caveated exceed.
THE MECHANISM (textbook, RFC-grounded -- not a wave):
ARQ: a lost packet is re-requested (NACK) -> the retransmit arrives +1 RTT later.
On a high-RTT intercontinental link (~250ms RTT) that retransmit usually
arrives AFTER the playout/jitter deadline -> the frame FREEZES.
FEC: k data + m parity ship together; ANY <=m losses in the n=k+m block are
reconstructed from parity ALREADY IN FLIGHT -> 0 added latency, no retransmit,
on-time. RTT-INDEPENDENT by construction.
We REUSE the proven RS GF(256) erasure codec from nx_room_fec.nx (no reimpl, DRY) and
ACTUALLY encode/decode every block under the loss trace -> the on-time count is backed
by byte-exact reconstruction, not arithmetic.
HONEST DISCIPLINE (no-wave): one fixed loss trace, vary ONLY RTT across LAN/moderate/
intercontinental so the win is attributable to RTT, not a constant. Negative controls:
(T3) at LAN RTT, ARQ's cheap retransmit recovers EVERYTHING -> it TIES OR BEATS FEC
(FEC loses the rare >m-burst block) -> the exceed is regime-specific, not rigged.
(T4) a >m-loss block -> FEC frozen>0 (honest recovery bound, not a fake 100%).
(T5) corrupt the generator matrix -> recovery breaks -> parity is load-bearing.
SCOPE CAVEAT (printed): this is vs the ARQ-retransmit model. vs WebRTC's OPTIONAL
FlexFEC the mechanism is parity-of-kind; our exceed THERE is the provable MDS guarantee
(every <=m pattern, audit-replayable, byte-exact) + full sovereignty -- not a lower
loss number, and NOT yet a live WebRTC packet capture.
main() is the SELF-VALIDATING GATE. Evidence -> knowledge/status/room_resilience.log.
license_tier: ORIGINAL
dependencies 2 imports · 0 importers
imports: nx_syscalls.nxnx_room_fec.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
| 32 | const RESIL_MAGIC_1103515245: i64 = 1103515245 |
| 33 | const RESIL_MAGIC_12345: i64 = 12345 |
| 34 | const RESIL_MAGIC_1600: i64 = 1600 |
| 35 | const RESIL_MAGIC_880301: i64 = 880301 |
| 37 | const RESIL_LOG: *u8 = "knowledge/status/room_resilience.log" |
functions
| 39 | func fw(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 } |
| 40 | func fwn(fd: i64, v: i64) -> i64 |
| 52 | func lcg_next(s: *i64) -> i64 { s[0] = (s[0] * RESIL_MAGIC_1103515245 + RESIL_MAGIC_12345) & 0x7fffffffffffffff; return (s[0] >> 16) & 0x7fff } called by 1: make_trace |
| 55 | func make_trace(lost: *i64, slots: i64, loss_pct: i64, seed: i64) -> i64 |
| 63 | func count_data_losses(lost: *i64, B: i64, k: i64, n: i64) -> i64 called by 1: main |
| 71 | func sim_fec_real(exp: *i64, log: *i64, G: *i64, lost: *i64, B: i64, k: i64, m: i64, S: i64, |
| 101 | func sim_arq(lost: *i64, B: i64, k: i64, n: i64, rtt: i64, jitter: i64, res: *i64) -> i64 called by 1: main |
| 118 | func main() -> i64 |