code wiki / _hdl_build / nx_room_fec_relay.nx
nx_room_fec_relay.nx
buildroot/runtime/_hdl_build/nx_room_fec_relay.nx
about
nx_room_fec_relay.nx -- R1: FEC wired THROUGH the real sovereign relay. Composes the live
relay core (nx_room_relay: rr_init/rr_post/rr_find/arena) with the proven frame-FEC wire
protocol (nx_room_fec_wire). Each frame is sharded into k data + m parity DATAGRAMS; each
shard is posted to the relay under its own (room, peer*16+shard_idx) key; the receiver
collects whatever survived and reconstructs the WHOLE frame byte-exact from any k shards.
WHY THIS IS THE REAL WIRE-IN (not another sim): it exercises the ACTUAL relay primitives
(rr_post stores each shard in the shared arena; rr_find locates survivors) -- the same code
nx_vroom_daemon runs live. The honest motivation: the live room speaks HTTP/TCP, which
HEAD-OF-LINE STALLS on intercontinental loss exactly like ARQ (TCP retransmits) -- a FEC
datagram path delivers the frame with ZERO retransmit. This gate proves the integrated path.
SCOPE: proves daemon-side FEC transport end-to-end. The browser-client recovery shim + the
vd_stream wire-format change + DEPLOY to live :8446 = the operator-gated last mile.
main() is the SELF-VALIDATING GATE. Evidence -> knowledge/status/room_fec_relay.log.
license_tier: ORIGINAL
dependencies 3 imports · 0 importers
imports: nx_syscalls.nxnx_room_relay.nxnx_room_fec_wire.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
| 21 | const FRR_LOG: *u8 = "knowledge/status/room_fec_relay.log" |
functions
| 23 | func rw(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 } |
| 24 | func rwn(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 as u8;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 } |
| 27 | func frr_send(st: *i64, arena: *u8, room: i64, basepeer: i64, blockid: i64, shards: *i64, n: i64, S: i64, drop: *i64, shardbuf: *u8) -> i64 |
| 42 | func frr_collect(st: *i64, arena: *u8, room: i64, basepeer: i64, n: i64, S: i64, present: *i64, collected: *i64) -> i64 |
| 58 | func main() -> i64 |